{"record":{"id":"96a6f91929f919aa","repo":"flowable/flowable-engine","slug":"message-errorcode-errorcode","errorCode":null,"errorMessage":"${message} (errorCode='${errorCode}')","messagePattern":"(.+?) \\(errorCode='(.+?)'\\)","errorType":"error_code","errorClass":"BpmnError","httpStatus":null,"severity":"warning","filePath":"modules/flowable5-compatibility/src/main/java/org/flowable/compatibility/DefaultFlowable5CompatibilityHandler.java","lineNumber":1162,"sourceCode":"        activity5Job.setExecutionId(job.getExecutionId());\n        activity5Job.setId(job.getId());\n        activity5Job.setJobHandlerConfiguration(job.getJobHandlerConfiguration());\n        activity5Job.setJobHandlerType(job.getJobHandlerType());\n        activity5Job.setEndDate(job.getEndDate());\n        activity5Job.setRepeat(job.getRepeat());\n        activity5Job.setProcessDefinitionId(job.getProcessDefinitionId());\n        activity5Job.setProcessInstanceId(job.getProcessInstanceId());\n        activity5Job.setRetries(job.getRetries());\n        activity5Job.setRevision(job.getRevision());\n        activity5Job.setTenantId(job.getTenantId());\n        activity5Job.setExceptionMessage(job.getExceptionMessage());\n        return activity5Job;\n    }\n\n    protected void handleActivitiException(org.activiti.engine.ActivitiException e) {\n        if (e instanceof org.activiti.engine.delegate.BpmnError) {\n            org.activiti.engine.delegate.BpmnError activiti5BpmnError = (org.activiti.engine.delegate.BpmnError) e;\n            throw new BpmnError(activiti5BpmnError.getErrorCode(), activiti5BpmnError.getMessage());\n\n        } else if (e instanceof org.activiti.engine.ActivitiClassLoadingException) {\n            throw new FlowableClassLoadingException(e.getMessage(), e.getCause());\n\n        } else if (e instanceof org.activiti.engine.ActivitiObjectNotFoundException) {\n            org.activiti.engine.ActivitiObjectNotFoundException activiti5ObjectNotFoundException = (org.activiti.engine.ActivitiObjectNotFoundException) e;\n            throw new FlowableObjectNotFoundException(activiti5ObjectNotFoundException.getMessage(),\n                    activiti5ObjectNotFoundException.getObjectClass(), activiti5ObjectNotFoundException.getCause());\n\n        } else if (e instanceof org.activiti.engine.ActivitiOptimisticLockingException) {\n            throw new FlowableOptimisticLockingException(e.getMessage());\n\n        } else if (e instanceof org.activiti.engine.ActivitiIllegalArgumentException) {\n            throw new FlowableIllegalArgumentException(e.getMessage(), e.getCause());\n\n        } else {\n            if (e.getCause() instanceof org.activiti.engine.delegate.BpmnError) {\n                org.activiti.engine.delegate.BpmnError activiti5BpmnError = (org.activiti.engine.delegate.BpmnError) e.getCause();","sourceCodeStart":1144,"sourceCodeEnd":1180,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-compatibility/src/main/java/org/flowable/compatibility/DefaultFlowable5CompatibilityHandler.java#L1144-L1180","documentation":"In handleActivitiException, an Activiti 5 BpmnError crossing the compatibility boundary is rethrown as a Flowable BpmnError carrying the original errorCode and message. This is a faithful translation, not a malfunction — the v5 error propagation is mapped onto the v6 BpmnError type.","triggerScenarios":"Executing a v5-style service task/delegate through the compatibility handler that signals a BpmnError (throw new org.activiti.engine.delegate.BpmnError(code, msg) or an ActivitiException whose translation path reaches the BpmnError branch).","commonSituations":"Migrated Activiti 5 Java delegates/execution listeners signaling business errors that are expected to be caught by a v6 boundary error event.","solutions":["Expected behavior: attach a boundary error event with a matching errorCode to catch it in the process","Verify the errorCode string matches exactly (case-sensitive) between the thrown BpmnError and the boundary event definition","If it should not propagate, remove or guard the BpmnError throw in the v5 delegate"],"exampleFix":"// before\nthrow new org.activiti.engine.delegate.BpmnError(\"ERR_404\");\n// after (catch on boundary event <boundaryEvent errorRef=\"ERR_404\">) or handle explicitly:\ntry { delegate.execute(execution); } catch (BpmnError e) { /* handle */ }","handlingStrategy":"try-catch","validationCode":"// Ensure the boundary error event exists for the errorCode before the process runs\nassert processDefinitionContainsBoundaryError(processDefinitionId, \"ERR_404\");","typeGuard":null,"tryCatchPattern":"try {\n    handler.executeJob(job);\n} catch (BpmnError e) {\n    execution.getProcessInstance().signal(\"boundary-\" + e.getErrorCode()); // or let engine route it\n}","preventionTips":["Keep errorCode strings in constants shared between delegates and BPMN boundary events","Accept BpmnError propagation as the designed business-error channel in v5 bridges","Add boundary error events to migrated process definitions"],"tags":["compatibility","bpmn-error","activiti5"],"backgroundTag":"invalid-state-transition","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"}