{"record":{"id":"525ad4016ae30398","repo":"Activiti/Activiti","slug":"no-process-definition-found-for-id","errorCode":null,"errorMessage":"No process definition found for id '","messagePattern":"No process definition found for id '","errorType":"exception","errorClass":"ActivitiObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/event/SignalEventHandler.java","lineNumber":63,"sourceCode":"    @SuppressWarnings(\"unchecked\")\n    @Override\n    public void handleEvent(EventSubscriptionEntity eventSubscription, Object payload, CommandContext commandContext) {\n        if (eventSubscription.getExecutionId() != null) {\n            dispatchActivitySignalledEvent(\n                eventSubscription.getExecution(),\n                eventSubscription.getEventName(),\n                payload,\n                commandContext\n            );\n\n            super.handleEvent(eventSubscription, payload, commandContext);\n        } else if (eventSubscription.getProcessDefinitionId() != null) {\n            // Find initial flow element matching the signal start event\n            String processDefinitionId = eventSubscription.getProcessDefinitionId();\n            ProcessDefinition processDefinition = ProcessDefinitionUtil.getProcessDefinition(processDefinitionId);\n\n            if (processDefinition == null) {\n                throw new ActivitiObjectNotFoundException(\n                    \"No process definition found for id '\" + processDefinitionId + \"'\",\n                    ProcessDefinition.class\n                );\n            }\n\n            if (processDefinition.isSuspended()) {\n                throw new ActivitiException(\n                    \"Could not handle signal: process definition with id: \" + processDefinitionId + \" is suspended\"\n                );\n            }\n\n            org.activiti.bpmn.model.Process process = ProcessDefinitionUtil.getProcess(processDefinitionId);\n            FlowElement flowElement = process.getFlowElement(eventSubscription.getActivityId(), true);\n            if (flowElement == null) {\n                throw new ActivitiException(\n                    \"Could not find matching FlowElement for activityId \" + eventSubscription.getActivityId()\n                );\n            }","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/Activiti/Activiti/blob/56435b1a97deeafdc09dd40074b056c89fba5a8a/activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/event/SignalEventHandler.java#L45-L81","documentation":"SignalEventHandler looks up a process definition when a signal is delivered to a signal start event. If ProcessDefinitionUtil.getProcessDefinition returns null for the stored processDefinitionId, an ActivitiObjectNotFoundException with ProcessDefinition.class as the object type is thrown.","triggerScenarios":"A signal event subscription references a processDefinitionId that no longer exists in the repository when the signal is dispatched.","commonSituations":"Deployment removed (cascade delete) while signal start subscriptions were registered; environment where the DB was copied/cleaned but runtime subscriptions remained; process definition deleted manually via management APIs.","solutions":["Check RepositoryService.createProcessDefinitionQuery().processDefinitionId(id) returns a result; redeploy the missing BPMN if not.","Avoid cascade-deleting deployments with registered signal start events, or re-signal only to active definitions.","Clean stale rows in ACT_RU_EVENT_SUBSCRipt for the deleted definition.","Use latest process definition keys rather than pinned ids if definitions are frequently redeployed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (repositoryService.createProcessDefinitionQuery().processDefinitionId(defId).singleResult() == null) { redeploy(); }","typeGuard":null,"tryCatchPattern":"try { runtimeService.signal(subId); } catch (ActivitiObjectNotFoundException e) { log.warn(\"definition gone, ignoring signal\", e); }","preventionTips":["Avoid cascade deletion of deployments with active signal subscriptions.","Query event subscriptions before signaling to confirm targets still exist.","Re-register signal start events after redeployment by restarting instances or updating subscriptions."],"tags":["activiti","signal","process-definition","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"56435b1a97deeafdc09dd40074b056c89fba5a8a","analyzedAt":"2026-09-09T21:00:06.703Z","contentChangedAt":"2026-09-09T21:00:06.703Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}