{"record":{"id":"84bdc7d414eafedc","repo":"flowable/flowable-engine","slug":"no-matching-parent-execution-for-error-code-er","errorCode":null,"errorMessage":"No matching parent execution for error code \" + errorId + \" found for \" + delegateExecution","messagePattern":"No matching parent execution for error code \" \\+ errorId \\+ \" found for \" \\+ delegateExecution","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/helper/ErrorPropagation.java","lineNumber":264,"sourceCode":"                                                \"ERROR_EVENT \" + errorId, false, false, false);\n\n                // Event\n                ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration();\n                FlowableEventDispatcher eventDispatcher = null;\n                if (processEngineConfiguration != null) {\n                    eventDispatcher = processEngineConfiguration.getEventDispatcher();\n                }\n                if (eventDispatcher != null && eventDispatcher.isEnabled()) {\n                    processEngineConfiguration.getEventDispatcher()\n                            .dispatchEvent(FlowableEventBuilder.createEntityEvent(FlowableEngineEventType.PROCESS_COMPLETED_WITH_ERROR_END_EVENT, processInstanceEntity),\n                                    processEngineConfiguration.getEngineCfgKey());\n                }\n            }\n\n            executeEventHandler(matchingEvent, parentExecution, currentExecution, errorVariableContainer);\n\n        } else {\n            throw new FlowableException(\"No matching parent execution for error code \" + errorId + \" found for \" + delegateExecution);\n        }\n    }\n\n    protected static void executeEventHandler(Event event, ExecutionEntity parentExecution, ExecutionEntity currentExecution,\n            BpmnErrorVariableContainer errorVariableContainer) {\n        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration();\n        FlowableEventDispatcher eventDispatcher = null;\n\n        String errorId = errorVariableContainer.getErrorCode();\n        String errorCode = errorId;\n        BpmnModel bpmnModel = ProcessDefinitionUtil.getBpmnModel(parentExecution.getProcessDefinitionId());\n        if (bpmnModel != null) {\n            String modelError = bpmnModel.getErrors().get(errorId);\n            if (modelError != null) {\n                errorCode = modelError;\n                errorVariableContainer.setErrorCode(errorCode);\n            }\n        }","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/helper/ErrorPropagation.java#L246-L282","documentation":"Thrown by ErrorPropagation.executeCatch as a FlowableException when an error being propagated (propagateError) cannot be matched to any parent execution's error boundary event, error start event, or event handler for the given error code. No catch construct exists anywhere in the parent execution hierarchy, so Flowable cannot deliver the error.","triggerScenarios":"A BpmnError is thrown (BpmnError.throwException / delegateExecution) with an error code, but no error boundary event, error event subprocess, or error start event matching that code exists on any parent execution — the matching lookup returns null and executeCatch throws.","commonSituations":"Typo or mismatch between the thrown error code and the boundary event's errorRef; missing errorRef attribute on the boundary event; error thrown from a call activity or listener where the catching scope was expected to exist; error code changed in the delegate but not in the model.","solutions":["Add or fix an error boundary event / error event subprocess whose errorRef matches the thrown error code","Ensure the boundary event is attached to the correct activity (one that encloses the throwing execution)","Verify the error code string matches exactly (case, whitespace) between throw site and catch definition","If the process should end on unmatched errors, catch the BpmnError earlier or add a fallback error event subprocess"],"exampleFix":"// before: no catch defined, delegate throws\nthrow new BpmnError(\"VALIDATION_FAILED\");\n// after: add to BPMN on the enclosing service task\n<boundaryEvent id=\"catchValidation\" attachedToRef=\"validateTask\">\n  <errorEventDefinition errorRef=\"VALIDATION_FAILED\"/>\n</boundaryEvent>","handlingStrategy":"validation","validationCode":"// Before throwing, confirm a catch exists for the error code in the deployment\nboolean hasCatch = model.getBpmnModel().getMainProcess().getFlowElementsStream()\n    .anyMatch(fe -> fe instanceof BoundaryEvent\n        && ((BoundaryEvent) fe).getEventDefinitions().stream()\n            .anyMatch(ed -> ed instanceof ErrorEventDefinition\n                && code.equals(((ErrorEventDefinition) ed).getErrorRef())));\nif (!hasCatch) throw new IllegalStateException(\"No boundary event catches error code \" + code);","typeGuard":null,"tryCatchPattern":"try { runtimeService.startProcessInstanceByKey(key, vars); }\ncatch (FlowableException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"No matching parent execution for error code\")) {\n        log.error(\"Uncaught BPMN error: {}\", e.getMessage());\n    } else throw e;\n}","preventionTips":["Keep thrown error codes and errorRef values in a shared constants class","Ensure every BpmnError throw site is covered by a boundary event or error event subprocess","Test error paths (happy path only tests will miss this) in CI"],"tags":["bpmn","error-handling","bpmnerror","uncaught-error"],"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"}