{"record":{"id":"0b1da941602c7020","repo":"flowable/flowable-engine","slug":"error-while-sending-signal-for-eventsubscripti","errorCode":null,"errorMessage":"Error while sending signal for \" + eventSubscription + \": no activity associated with event subscription","messagePattern":"Error while sending signal for \" \\+ eventSubscription \\+ \": no activity associated with event subscription","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/event/AbstractEventHandler.java","lineNumber":36,"sourceCode":"import org.flowable.common.engine.impl.interceptor.CommandContext;\r\nimport org.flowable.engine.impl.persistence.entity.ExecutionEntity;\r\nimport org.flowable.engine.impl.util.CommandContextUtil;\r\nimport org.flowable.engine.impl.util.EventSubscriptionUtil;\r\nimport org.flowable.eventsubscription.service.impl.persistence.entity.EventSubscriptionEntity;\r\n\r\n/**\r\n * @author Tijs Rademakers\r\n */\r\npublic abstract class AbstractEventHandler implements EventHandler {\r\n    \r\n    @Override\r\n    public void handleEvent(EventSubscriptionEntity eventSubscription, Object payload, CommandContext commandContext) {\r\n        String executionId = eventSubscription.getExecutionId();\r\n        ExecutionEntity execution = CommandContextUtil.getExecutionEntityManager(commandContext).findById(executionId);\r\n        FlowNode currentFlowElement = (FlowNode) execution.getCurrentFlowElement();\r\n\r\n        if (currentFlowElement == null) {\r\n            throw new FlowableException(\"Error while sending signal for \" + eventSubscription + \": no activity associated with event subscription\");\r\n        }\r\n\r\n        EventSubscriptionUtil.processPayloadMap(payload, execution, currentFlowElement, commandContext);\r\n\r\n        CommandContextUtil.getAgenda().planTriggerExecutionOperation(execution);\r\n    }\r\n\r\n}\r\n","sourceCodeStart":18,"sourceCodeEnd":45,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/event/AbstractEventHandler.java#L18-L45","documentation":"Thrown by AbstractEventHandler.handleEvent when an event subscription (signal/message) points to an execution whose currentFlowElement is null. The engine cannot deliver the signal or payload because it doesn't know which BPMN activity the subscription is bound to - i.e. the execution's persisted activity state is inconsistent with the subscription.","triggerScenarios":"runtimeService.signal(eventSubscriptionId/eventName/payload) or message correlation hitting an EventSubscriptionEntity whose execution has no current flow element - e.g. execution already moved past the boundary/catch event, corrupted or manually-modified ACT_RU_EXECUTION rows, or signaling a subscription for an execution in a state where the flow element is not (re)loaded.","commonSituations":"Double signal delivery racing with execution continuing; DB state tampered with or restored from inconsistent backups; engine version upgrade leaving stale runtime rows; signaling a process instance that already passed the catch event.","solutions":["Check whether the execution already consumed the event; don't signal twice (guard with a process variable or idempotent correlation).","Verify runtime data consistency: inspect ACT_RU_EVENT_SUBSCR and ACT_RU_EXECUTION for the executionId; if stale, delete the process instance (deleteProcessInstance) and restart.","Restore from a consistent backup or re-deploy the process definition if runtime tables are corrupted.","If reproducible after an upgrade, check for known Flowable upgrade bugs and run the appropriate upgrade scripts."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"EventSubscription sub = runtimeService.createEventSubscriptionQuery().executionId(executionId).singleResult();\nif (sub == null) {\n    throw new IllegalStateException(\"no active subscription to signal\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    runtimeService.signal(executionId, payload);\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"no activity associated with event subscription\")) {\n        // treat as already-delivered / stale subscription; log and skip\n    }\n}","preventionTips":["Make signal delivery idempotent; never signal the same subscription twice.","Never hand-edit or restore partial ACT_RU_* tables.","Correlate messages/signals only for instances confirmed to be waiting.","Follow official upgrade scripts when upgrading engine versions."],"tags":["bpmn","signal","event-subscription","process-engine"],"backgroundTag":"invalid-state-transition","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}