{"record":{"id":"dc38e9732a9ce964","repo":"flowable/flowable-engine","slug":"destination-destinationactivityname-not-found","errorCode":null,"errorMessage":"destination '${destinationActivityName}' not found.  (referenced from transition in '${sourceActivityId}')","messagePattern":"destination '(.+?)' not found\\.  \\(referenced from transition in '(.+?)'\\)","errorType":"exception","errorClass":"ActivitiException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/pvm/ProcessDefinitionBuilder.java","lineNumber":121,"sourceCode":"    }\n\n    public ProcessDefinitionBuilder behavior(ActivityBehavior activityBehaviour) {\n        getActivity().setActivityBehavior(activityBehaviour);\n        return this;\n    }\n\n    public ProcessDefinitionBuilder property(String name, Object value) {\n        processElement.setProperty(name, value);\n        return this;\n    }\n\n    public PvmProcessDefinition buildProcessDefinition() {\n        for (Object[] unresolvedTransition : unresolvedTransitions) {\n            TransitionImpl transition = (TransitionImpl) unresolvedTransition[0];\n            String destinationActivityName = (String) unresolvedTransition[1];\n            ActivityImpl destination = processDefinition.findActivity(destinationActivityName);\n            if (destination == null) {\n                throw new ActivitiException(\"destination '\" + destinationActivityName + \"' not found.  (referenced from transition in '\" + transition.getSource().getId() + \"')\");\n            }\n            transition.setDestination(destination);\n        }\n        return processDefinition;\n    }\n\n    protected ActivityImpl getActivity() {\n        return (ActivityImpl) scopeStack.peek();\n    }\n\n    public ProcessDefinitionBuilder scope() {\n        getActivity().setScope(true);\n        return this;\n    }\n\n    public ProcessDefinitionBuilder executionListener(ExecutionListener executionListener) {\n        if (transition != null) {\n            transition.addExecutionListener(executionListener);","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/pvm/ProcessDefinitionBuilder.java#L103-L139","documentation":"ActivitiException thrown in buildProcessDefinition when an unresolved transition's destination activity id does not match any activity in the finished process definition. Transitions are created with deferred destinations; resolution happens once, at build time, via processDefinition.findActivity. This indicates a dangling edge in the process graph.","triggerScenarios":"Calling startTransition(destId, ...) with an id that never matches an activity added via startActivity(id) (or the id was set after buildProcessDefinition), then calling buildProcessDefinition().","commonSituations":"Typos in target ids, referencing an activity defined in a different scope/process, or building the definition before all activities were declared (order of builder calls).","solutions":["Ensure the id passed to startTransition exactly matches an id used in startActivity(...) within the same builder.","Create the destination activity before calling buildProcessDefinition().","Log the source activity id (given in the message) and correct the reference or remove the orphan transition."],"exampleFix":"// before\nbuilder.startTransition(\"tskApprove\"); // activity never declared\n// after\nbuilder.startActivity(\"tskApprove\").endActivity();\nbuilder.startActivity(\"tskStart\").startTransition(\"tskApprove\").endActivity(); // now resolves","handlingStrategy":"validation","validationCode":"Set<String> declared = new HashSet<>();\n// ... collect ids passed to startActivity(...) ...\nif (!declared.contains(transitionTargetId)) {\n  throw new IllegalArgumentException(\"transition target '\" + transitionTargetId + \"' is not a declared activity\");\n}\nbuilder.buildProcessDefinition();","typeGuard":null,"tryCatchPattern":"try {\n  PvmProcessDefinition def = builder.buildProcessDefinition();\n} catch (ActivitiException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"not found\")) {\n    log.error(\"Dangling transition reference in process model: \" + e.getMessage());\n  }\n  throw e;\n}","preventionTips":["Declare all activities before wiring transitions and calling buildProcessDefinition().","Keep a set of declared activity ids and validate transition targets against it.","Lint the BPMN model for unresolved targetRef values before conversion."],"tags":["java","pvm","unresolved-reference","process-definition-builder"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}