{"record":{"id":"db7ad85030f2d9a8","repo":"flowable/flowable-engine","slug":"error-while-sending-signal-for-event-subscription","errorCode":null,"errorMessage":"Error while sending signal for event subscription '${eventSubscription.getId()}': no activity associated with event subscription. Hint: The activityId of this event should be present in the BPMN.","messagePattern":"Error while sending signal for event subscription '(.+?)': no activity associated with event subscription\\. Hint: The activityId of this event should be present in the BPMN\\.","errorType":"exception","errorClass":"ActivitiException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/event/AbstractEventHandler.java","lineNumber":42,"sourceCode":"import org.activiti.engine.impl.persistence.entity.ExecutionEntity;\r\nimport org.activiti.engine.impl.pvm.process.ActivityImpl;\r\nimport org.flowable.common.engine.impl.interceptor.EngineConfigurationConstants;\r\nimport org.flowable.engine.impl.delegate.ActivityBehavior;\r\n\r\n/**\r\n * @author Daniel Meyer\r\n * @author Falko Menge\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\r\n        ExecutionEntity execution = eventSubscription.getExecution();\r\n        ActivityImpl activity = eventSubscription.getActivity();\r\n\r\n        if (activity == null) {\r\n            throw new ActivitiException(\"Error while sending signal for event subscription '\" + eventSubscription.getId() + \"': \"\r\n                    + \"no activity associated with event subscription. Hint: The activityId of this event should be present in the BPMN.\");\r\n        }\r\n\r\n        if (payload instanceof Map) {\r\n            @SuppressWarnings(\"unchecked\")\r\n            Map<String, Object> processVariables = (Map<String, Object>) payload;\r\n            execution.setVariables(processVariables);\r\n        }\r\n\r\n        ActivityBehavior activityBehavior = activity.getActivityBehavior();\r\n        if (activityBehavior instanceof BoundaryEventActivityBehavior\r\n                || activityBehavior instanceof EventSubProcessStartEventActivityBehavior) {\r\n\r\n            try {\r\n\r\n                dispatchActivitiesCanceledIfNeeded(eventSubscription, execution, activity, commandContext);\r\n\r\n                activityBehavior.execute(execution);\r","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/event/AbstractEventHandler.java#L24-L60","documentation":"When an event (signal/message) subscription fires, AbstractEventHandler signals the execution at the subscription's activity. If the activity resolved from the subscription's activityId is null — the BPMN no longer contains that activity — the handler throws ActivitiException instead of delivering the signal.","triggerScenarios":"handleEvent invoked for an EventSubscriptionEntity whose getActivity() returns null: the subscription references an activityId missing from the deployed process definition (changed/deleted BPMN, stale subscription from an older deployment).","commonSituations":"Redeploying a process model where an event-bound activity (boundary event, intermediate catch) was renamed or removed while subscriptions from old instances remain; signaling via runtimeService.signalEventReceived for a stale subscription.","solutions":["Redeploy the process definition so the activityId referenced by the subscription exists in the BPMN","Delete or migrate stale event subscriptions (runtimeService.createEventSubscriptionQuery()...delete / migration) before signaling","Corrupt-process-data-fix: verify the event subscription's activityId matches an element id in the current BPMN XML"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"EventSubscription sub = runtimeService.createEventSubscriptionQuery()\n        .subscriptionId(id).singleResult();\nif (sub == null || sub.getActivityId() == null) {\n    throw new IllegalStateException(\"Subscription has no resolvable activity\");\n}","typeGuard":"boolean isSignalable(EventSubscriptionEntity s) {\n    return s.getActivity() != null;\n}","tryCatchPattern":"try {\n    runtimeService.signalEventReceived(signalName);\n} catch (ActivitiException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"no activity associated\")) {\n        // redeploy definition / delete stale subscription\n    }\n}","preventionTips":["Keep activityId of events stable across process model redeployments","Clean up event subscriptions of old deployments before changing BPMN element ids","Use process instance migration when redefining running instances"],"tags":["event-subscription","bpmn","signal","stale-data"],"backgroundTag":"entity-not-found","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"}