{"record":{"id":"2da7a4f6eb825a2d","repo":"flowable/flowable-engine","slug":"process-model-for-executionentity-could-not-be","errorCode":null,"errorMessage":"Process model for ${executionEntity} could not be found","messagePattern":"Process model for (.+?) could not be found","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"critical","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/BoundaryCompensateEventActivityBehavior.java","lineNumber":56,"sourceCode":"public class BoundaryCompensateEventActivityBehavior extends BoundaryEventActivityBehavior {\n\n    private static final long serialVersionUID = 1L;\n\n    protected CompensateEventDefinition compensateEventDefinition;\n\n    public BoundaryCompensateEventActivityBehavior(CompensateEventDefinition compensateEventDefinition, boolean interrupting) {\n        super(interrupting);\n        this.compensateEventDefinition = compensateEventDefinition;\n    }\n\n    @Override\n    public void execute(DelegateExecution execution) {\n        ExecutionEntity executionEntity = (ExecutionEntity) execution;\n        BoundaryEvent boundaryEvent = (BoundaryEvent) execution.getCurrentFlowElement();\n\n        Process process = ProcessDefinitionUtil.getProcess(execution.getProcessDefinitionId());\n        if (process == null) {\n            throw new FlowableException(\"Process model for \" + executionEntity + \" could not be found\");\n        }\n\n        Activity sourceActivity = null;\n        Activity compensationActivity = null;\n        List<Association> associations = process.findAssociationsWithSourceRefRecursive(boundaryEvent.getId());\n        for (Association association : associations) {\n            sourceActivity = boundaryEvent.getAttachedToRef();\n            FlowElement targetElement = process.getFlowElement(association.getTargetRef(), true);\n            if (targetElement instanceof Activity activity) {\n                if (activity.isForCompensation()) {\n                    compensationActivity = activity;\n                    break;\n                }\n            }\n        }\n        \n        if (sourceActivity == null) {\n            throw new FlowableException(\"Parent activity for boundary compensation event could not be found for \" + executionEntity);","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/BoundaryCompensateEventActivityBehavior.java#L38-L74","documentation":"Flowable throws this when the BPMN process model for the execution's process definition cannot be resolved while activating a compensation boundary event. BoundaryCompensateEventActivityBehavior.execute() calls ProcessDefinitionUtil.getProcess(processDefinitionId) and fails hard if it returns null, because it cannot locate the boundary event's associations without the model. This normally indicates a corrupt or inconsistent deployment/definition cache rather than user input.","triggerScenarios":"Executing a process containing a boundary compensate event whose process definition cannot be loaded via ProcessDefinitionUtil.getProcess() — e.g. the definition was deleted from ACT_RE_PROCDEF, the definition cache was cleared/invalidated mid-execution, or a dynamic/injected processDefinitionId does not match any deployed model.","commonSituations":"Deleting process definitions while process instances are still running; custom code that manipulates the deployment cache; cluster environments with inconsistent in-memory definition caches; migrating process definitions across engines without redeploying the model.","solutions":["Verify the process definition still exists: query ACT_RE_PROCDEF for the processDefinitionId shown in the message; redeploy the BPMN model if it was deleted.","Restart the engine node (or clear/rebuild the process definition cache) so ProcessDefinitionUtil can reload the model from the database.","Check that processDefinitionId on the execution is not being altered by custom code (ExecutionListeners, custom CommandContext handling).","If in a cluster, ensure all nodes deploy from the same database and cache invalidation propagates."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"boolean isDefinitionDeployable(String processDefinitionId) {\n    ProcessDefinition def = repositoryService.createProcessDefinitionQuery()\n        .processDefinitionId(processDefinitionId).singleResult();\n    return def != null && !def.isSuspended();\n}","typeGuard":null,"tryCatchPattern":"try {\n    runtimeService.signal(executionId);\n} catch (FlowableException e) {\n    if (e.getMessage().startsWith(\"Process model for\")) {\n        // definition missing: redeploy model or restart instance\n    }\n}","preventionTips":["Never delete process definitions with active instances; use setProcessDefinitionCategory/delete with cascade awareness.","Keep all cluster nodes on the same database and avoid clearing the definition cache independently.","Monitor deployment state before migrating instances to a new engine version."],"tags":["flowable","bpmn","process-definition","compensation","cache"],"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"}