{"record":{"id":"81a6c3bedba594bb","repo":"flowable/flowable-engine","slug":"invalid-signal-handling-no-execution-nor-process","errorCode":null,"errorMessage":"Invalid signal handling: no execution nor process definition set for \" + eventSubscription","messagePattern":"Invalid signal handling: no execution nor process definition set for \" \\+ eventSubscription","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/event/SignalEventHandler.java","lineNumber":72,"sourceCode":"            if (processDefinition.isSuspended()) {\r\n                throw new FlowableException(\"Could not handle signal: process definition with id: \" + processDefinitionId + \" is suspended for \" + eventSubscription);\r\n            }\r\n\r\n            // Start process instance via the flow element linked to the event\r\n            FlowElement flowElement = process.getFlowElement(eventSubscription.getActivityId(), true);\r\n            if (flowElement == null) {\r\n                throw new FlowableException(\"Could not find matching FlowElement for \" + eventSubscription);\r\n            }\r\n\r\n            ProcessInstanceHelper processInstanceHelper = CommandContextUtil.getProcessEngineConfiguration(commandContext).getProcessInstanceHelper();\r\n            processInstanceHelper.createAndStartProcessInstanceWithInitialFlowElement(processDefinition, null, null, null, flowElement, process,\r\n                    getPayloadAsMap(payload), null, null, null, true);\r\n\r\n        } else if (eventSubscription.getScopeId() != null && ScopeTypes.CMMN.equals(eventSubscription.getScopeType())) {\r\n            CommandContextUtil.getProcessEngineConfiguration(commandContext).getCaseInstanceService().handleSignalEvent(eventSubscription, getPayloadAsMap(payload));\r\n        \r\n        } else {\r\n            throw new FlowableException(\"Invalid signal handling: no execution nor process definition set for \" + eventSubscription);\r\n        }\r\n    }\r\n\r\n    protected Map<String, Object> getPayloadAsMap(Object payload) {\r\n        Map<String, Object> variables = null;\r\n        if (payload instanceof Map) {\r\n            variables = (Map<String, Object>) payload;\r\n        }\r\n        return variables;\r\n    }\r\n\r\n}\r\n","sourceCodeStart":54,"sourceCodeEnd":85,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/event/SignalEventHandler.java#L54-L85","documentation":"A signal event subscription must be bound either to an execution (intermediate signal catch) or to a process definition (signal start event), or to a CMMN case scope. This error means the EventSubscription had neither an execution id, nor a process definition id, nor a matching CMMN scope — i.e. the subscription is orphaned or of an unhandled type.","triggerScenarios":"Calling signalEventReceived for an EventSubscriptionEntity with null executionId, null processDefinitionId, and a scopeId/scopeType combination that is not CMMN — e.g. corrupted ACT_RU_EVENT_SUBSCR rows or custom/unknown scope types.","commonSituations":"Direct manipulation/migration of the runtime tables, plugins registering custom scope types the BPM signal handler does not know, partially deleted process instances leaving orphaned subscriptions.","solutions":["Inspect ACT_RU_EVENT_SUBSCR for the subscription: fill in or remove the row if it is orphaned.","Ensure the signal is routed through runtimeService.createSignalEvent(signalName)...send() rather than manually crafted subscription handling.","If a custom scope type is used, register an appropriate event handler; the BPM SignalEventHandler only handles execution-, process-definition- and CMMN-scoped signals.","Reproduce with the subscription id and file a Flowable issue if the data is consistent."],"exampleFix":"// before\nruntimeService.signalEventReceived(sub.getEventName(), sub.getId()); // subscription has no execution/definition\n// after\nEventSubscription sub = runtimeService.createEventSubscriptionQuery()\n    .subscriptionId(id).singleResult();\nif (sub != null && sub.getExecutionId() == null && sub.getProcessDefinitionId() == null) {\n    runtimeService.deleteEventSubscription(id); // cleanup orphan before re-signaling\n}","handlingStrategy":"validation","validationCode":"EventSubscription sub = runtimeService.createEventSubscriptionQuery().subscriptionId(id).singleResult();\nif (sub == null || (sub.getExecutionId() == null && sub.getProcessDefinitionId() == null\n        && (sub.getScopeId() == null || !\"cmmn\".equals(sub.getScopeType())))) {\n    throw new IllegalStateException(\"Orphaned signal subscription: \" + id);\n}","typeGuard":null,"tryCatchPattern":"try {\n    runtimeService.signalEventReceived(signalName, subscriptionId);\n} catch (FlowableException e) {\n    if (e.getMessage().startsWith(\"Invalid signal handling\")) {\n        runtimeService.deleteEventSubscription(subscriptionId);\n    } else { throw e; }\n}","preventionTips":["Never manipulate ACT_RU_EVENT_SUBSCR directly without engine APIs.","When deleting process instances programmatically, delete their event subscriptions too.","Register custom event handlers for any custom scope types.","Query subscriptions via runtimeService.createEventSubscriptionQuery and validate bindings before signaling."],"tags":["flowable","bpmn","signal","orphaned-subscription"],"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-14T11:17:12.474Z"}