{"record":{"id":"30c5f82c71622458","repo":"flowable/flowable-engine","slug":"could-not-execute-decision-instance-no-dmn-servic","errorCode":null,"errorMessage":"Could not execute decision instance: no dmn service found. For ${planItemInstanceEntity}","messagePattern":"Could not execute decision instance: no dmn service found\\. For (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/behavior/impl/DecisionTaskActivityBehavior.java","lineNumber":63,"sourceCode":"\r\n    protected static final String EXPRESSION_DECISION_TABLE_THROW_ERROR_FLAG = \"decisionTaskThrowErrorOnNoHits\";\r\n    protected static final String STRING_DECISION_TABLE_FALLBACK_TO_DEFAULT_TENANT = \"fallbackToDefaultTenant\";\r\n    protected static final String STRING_DECISION_TABLE_SAME_DEPLOYMENT = \"sameDeployment\";\r\n\r\n    protected DecisionTask decisionTask;\r\n    protected Expression decisionRefExpression;\r\n\r\n    public DecisionTaskActivityBehavior(Expression decisionRefExpression, DecisionTask decisionTask) {\r\n        super(decisionTask.isBlocking(), decisionTask.getBlockingExpression());\r\n        this.decisionTask = decisionTask;\r\n        this.decisionRefExpression = decisionRefExpression;\r\n    }\r\n\r\n    @Override\r\n    public void execute(CommandContext commandContext, PlanItemInstanceEntity planItemInstanceEntity) {\r\n        DmnDecisionService dmnRuleService = CommandContextUtil.getDmnRuleService(commandContext);\r\n        if (dmnRuleService == null) {\r\n            throw new FlowableException(\"Could not execute decision instance: no dmn service found. For \" + planItemInstanceEntity);\r\n        }\r\n\r\n        String externalRef = null;\r\n        if (decisionTask != null && decisionTask.getDecision() != null &&\r\n                StringUtils.isNotEmpty(decisionTask.getDecision().getExternalRef())) {\r\n            \r\n            externalRef = decisionTask.getDecision().getExternalRef();\r\n            \r\n        } else if (decisionRefExpression != null) {\r\n            Object externalRefValue = decisionRefExpression.getValue(planItemInstanceEntity);\r\n            if (externalRefValue != null) {\r\n                externalRef = externalRefValue.toString();\r\n            }\r\n            \r\n            if (StringUtils.isEmpty(externalRef)) {\r\n                throw new FlowableException(\"Could not execute decision: no externalRef defined for \" + planItemInstanceEntity);\r\n            }\r\n        }\r","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/behavior/impl/DecisionTaskActivityBehavior.java#L45-L81","documentation":"The CMMN engine's DecisionTaskActivityBehavior executes a DMN decision when a decision (task) plan item activates. Before doing so it looks up the DmnDecisionService from the command context; if none is registered, the engine cannot execute any decision and throws this FlowableException. This almost always means the DMN engine is not wired into the CMMN engine configuration.","triggerScenarios":"Executing a CMMN case containing a decision (task) plan item while CommandContextUtil.getDmnRuleService(commandContext) returns null — i.e. the DMN engine configuration was never added to the CMMN engine.","commonSituations":"Applications that include flowable-cmmn-engine but not flowable-dmn-engine (or flowable-dmn-spring/boot starter) on the classpath; engine configurations built without cmmnEngineConfiguration.setDmnEngineConfiguration(...) or without DmnEngineConfigurator registered in the process/cmmn engine configurators list.","solutions":["Add the DMN engine dependency (org.flowable:flowable-dmn-engine or the flowable-dmn-spring-boot-starter) to your project.","Register a DmnEngineConfigurator in the engine configuration so the DmnDecisionService becomes available in the command context: cmmnEngineConfiguration.setConfigurators(List.of(new DmnEngineConfigurator())) or use the Spring/Boot auto-configuration.","If constructing the CmmnEngineConfiguration manually, set cmmnEngineConfiguration.setDmnEngineConfiguration(dmnEngineConfiguration).","Verify the decision task's decision/externalRef resolution is what you intend; but first confirm a DMN decision with that key is deployed — deploy the DMN model with the CMMN model if needed."],"exampleFix":"// before\nCmmnEngineConfiguration cfg = new StandaloneCmmnEngineConfiguration();\ncfg.buildEngine(); // decision task fails: no dmn service found\n// after\nCmmnEngineConfiguration cfg = new StandaloneCmmnEngineConfiguration();\nDmnEngineConfigurator dmnConfigurator = new DmnEngineConfigurator();\ncfg.addConfigurator(dmnConfigurator); // wires DmnDecisionService into command context\ncfg.buildEngine();","handlingStrategy":"validation","validationCode":"boolean isDmnWired(CmmnEngineConfiguration cfg) {\n    return cfg != null && cfg.getDmnEngineConfiguration() != null;\n}","typeGuard":"if (commandContext != null && CommandContextUtil.getDmnRuleService(commandContext) == null) {\n    throw new IllegalStateException(\"DMN engine not configured for CMMN engine\");\n}","tryCatchPattern":"try {\n    caseRuntimeService.triggerPlanItemInstance(planItemId);\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"no dmn service found\")) {\n        throw new ConfigurationException(\"Register DmnEngineConfigurator in engine config\", e);\n    }\n    throw e;\n}","preventionTips":["Always include a DMN engine dependency when using CMMN decision tasks","Add an engine smoke test that executes a trivial decision task at startup","Use the Flowable Spring/Boot starters so configurators are auto-registered"],"tags":["cmmn","dmn","missing-dependency","configuration"],"backgroundTag":"missing-dependency","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"}