{"record":{"id":"dc637ebcfded7fd4","repo":"flowable/flowable-engine","slug":"cannot-fail-external-jobs-there-is-no-bpmn-or-cmm","errorCode":null,"errorMessage":"Cannot fail external jobs. There is no BPMN or CMMN engine available","messagePattern":"Cannot fail external jobs\\. There is no BPMN or CMMN engine available","errorType":"exception","errorClass":"FlowableException","httpStatus":500,"severity":"error","filePath":"modules/flowable-external-job-rest/src/main/java/org/flowable/external/job/rest/service/api/acquire/ExternalWorkerAcquireJobResource.java","lineNumber":306,"sourceCode":"    }\n\n    protected ExternalWorkerJobAcquireBuilder createExternalWorkerAcquireBuilder() {\n        if (managementService != null) {\n            return managementService.createExternalWorkerJobAcquireBuilder();\n        } else if (cmmnManagementService != null) {\n            return cmmnManagementService.createExternalWorkerJobAcquireBuilder();\n        } else {\n            throw new FlowableException(\"Cannot acquire external jobs. There is no BPMN or CMMN engine available\");\n        }\n    }\n\n    protected ExternalWorkerJobFailureBuilder createExternalWorkerJobFailureBuilder(String jobId, String workerId) {\n        if (managementService != null) {\n            return managementService.createExternalWorkerJobFailureBuilder(jobId, workerId);\n        } else if (cmmnManagementService != null) {\n            return cmmnManagementService.createExternalWorkerJobFailureBuilder(jobId, workerId);\n        } else {\n            throw new FlowableException(\"Cannot fail external jobs. There is no BPMN or CMMN engine available\");\n        }\n    }\n}\n","sourceCodeStart":288,"sourceCodeEnd":310,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-external-job-rest/src/main/java/org/flowable/external/job/rest/service/api/acquire/ExternalWorkerAcquireJobResource.java#L288-L310","documentation":"FlowableException thrown by createExternalWorkerJobFailureBuilder when both the BPMN managementService and CMMN cmmnManagementService are null while a worker tries to report a job failure. Failing an external job requires an engine to route the failure to. Symmetric to the acquire-side check but on the failure path.","triggerScenarios":"POST to the external worker job failure endpoint (failureBuilder path) on a deployment where neither engine's ManagementService is wired into ExternalWorkerAcquireJobResource.","commonSituations":"REST module deployed standalone without engine beans; misconfigured Spring context excluding ProcessEngine/CmmnEngine services; engine startup failure.","solutions":["Ensure a BPMN or CMMN engine is configured so its ManagementService is injected into the resource.","Verify engine auto-configuration is enabled and the datasource is valid.","Inspect startup logs to confirm the engine (and its services) initialized successfully."],"exampleFix":"// before: no engine config in application.yml\n// after\nflowable:\n  process:\n    enabled: true\n  cmmn:\n    enabled: true","handlingStrategy":"fallback","validationCode":"if (processEngine == null && cmmnEngine == null) { throw new IllegalStateException(\"Cannot report failures: no engine configured\"); }","typeGuard":null,"tryCatchPattern":"try { failureBuilder(jobId, workerId).failure(message); } catch (FlowableException e) { if (e.getMessage().contains(\"Cannot fail external jobs\")) { alertOps(\"Engine misconfiguration\"); } }","preventionTips":["Verify engine beans are present before starting workers","Add a health check that fails fast when no ManagementService exists","Keep BPMN or CMMN engine enabled in deployment config"],"tags":["configuration","engine","external-worker","rest-api"],"backgroundTag":"missing-dependency","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"}