{"record":{"id":"2c809f392a830c26","repo":"flowable/flowable-engine","slug":"invalid-sourceelementid-sourceelementid-no-e","errorCode":null,"errorMessage":"Invalid sourceElementId '${sourceElementId}': no element found for this id n process definition '${processDefinitionId}'","messagePattern":"Invalid sourceElementId '(.+?)': no element found for this id n process definition '(.+?)'","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/util/ExecutionGraphUtil.java","lineNumber":62,"sourceCode":"\n        FlowElement sourceFlowElement = process.getFlowElement(sourceElementId, true);\n        FlowNode sourceElement = null;\n        if (sourceFlowElement instanceof FlowNode) {\n            sourceElement = (FlowNode) sourceFlowElement;\n        } else if (sourceFlowElement instanceof SequenceFlow) {\n            sourceElement = (FlowNode) ((SequenceFlow) sourceFlowElement).getTargetFlowElement();\n        }\n\n        FlowElement targetFlowElement = process.getFlowElement(targetElementId, true);\n        FlowNode targetElement = null;\n        if (targetFlowElement instanceof FlowNode) {\n            targetElement = (FlowNode) targetFlowElement;\n        } else if (targetFlowElement instanceof SequenceFlow) {\n            targetElement = (FlowNode) ((SequenceFlow) targetFlowElement).getTargetFlowElement();\n        }\n\n        if (sourceElement == null) {\n            throw new FlowableException(\"Invalid sourceElementId '\" + sourceElementId + \"': no element found for this id n process definition '\" + processDefinitionId + \"'\");\n        }\n        if (targetElement == null) {\n            throw new FlowableException(\"Invalid targetElementId '\" + targetElementId + \"': no element found for this id n process definition '\" + processDefinitionId + \"'\");\n        }\n\n        Set<String> visitedElements = new HashSet<>();\n        return isReachable(process, sourceElement, targetElement, visitedElements);\n    }\n\n    public static boolean isReachable(Process process, FlowNode sourceElement, FlowNode targetElement, Set<String> visitedElements) {\n        \n        // Special case: start events in an event subprocess might exist as an execution and are most likely be able to reach the target\n        // when the target is in the event subprocess, but should be ignored as they are not 'real' runtime executions (but rather waiting for a trigger)\n        if (sourceElement instanceof StartEvent && isInEventSubprocess(sourceElement)) {\n            return false;\n        }\n\n        // No outgoing seq flow: could be the end of eg . the process or an embedded subprocess","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/util/ExecutionGraphUtil.java#L44-L80","documentation":"ExecutionGraphUtil.isReachable validates that the source element id can be resolved to a FlowNode in the deployed process model before doing a graph traversal. When BpmnModel.getElementById (or equivalent lookup) returns nothing for sourceElementId, Flowable throws this FlowableException because reachability cannot be computed from a nonexistent element.","triggerScenarios":"Calling the public isReachable(processDefinitionId, sourceElementId, targetElementId) API where sourceElementId does not match any flow element in the process definition resolved from the repository/deployment cache.","commonSituations":"Typo in the element id; using an id from a different (older/newer) process definition version; passing a sequence-flow id as the source where a flow node is required and the lookup fails; ids from a process definition that was redeployed or deleted.","solutions":["Verify the sourceElementId exists in the current process definition (inspect the BPMN XML or use BpmnModel.getElementById) and correct the id.","Make sure you reference the same process definition version — pass the exact processDefinitionId of the deployed definition containing the element.","Check whether the definition was redeployed and element ids were regenerated; update callers accordingly.","Null-check the element in caller code against the model before invoking isReachable."],"exampleFix":"// before\nboolean ok = executionGraphUtil.isReachable(\"procDef:1\", \"wrongTaskId\", \"endEvent\");\n\n// after\nBpmnModel model = repositoryService.getBpmnModel(processDefinitionId);\nif (model.getFlowElement(\"startTask\") != null) {\n    boolean ok = executionGraphUtil.isReachable(processDefinitionId, \"startTask\", \"endEvent\");\n}","handlingStrategy":"validation","validationCode":"BpmnModel model = repositoryService.getBpmnModel(processDefinitionId);\nif (model.getFlowElement(sourceElementId) == null) {\n    throw new IllegalArgumentException(\"sourceElementId \" + sourceElementId + \" not in \" + processDefinitionId);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Resolve element ids from the same process definition version you pass in","Never hardcode element ids across deployments; read them from the model","Validate BPMN ids after diagram edits before programmatic use"],"tags":["process-model","invalid-id","graph-traversal"],"backgroundTag":"invalid-argument-value","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"}