{"record":{"id":"38d2b7a3cd78da01","repo":"flowable/flowable-engine","slug":"decision-does-not-contain-decision-key","errorCode":null,"errorMessage":"decision does not contain decision key","messagePattern":"decision does not contain decision key","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/audit/DecisionExecutionAuditUtil.java","lineNumber":38,"sourceCode":"import org.flowable.dmn.engine.impl.util.CommandContextUtil;\nimport org.flowable.dmn.model.Decision;\nimport org.flowable.dmn.model.DecisionService;\nimport org.flowable.dmn.model.DecisionTable;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n/**\n * @author Yvo Swillens\n */\npublic class DecisionExecutionAuditUtil {\n\n    private static final Logger LOGGER = LoggerFactory.getLogger(DecisionExecutionAuditUtil.class);\n\n    public static DecisionServiceExecutionAuditContainer initializeDecisionServiceExecutionAudit(DecisionService decisionService, ExecuteDecisionContext executeDecisionInfo) {\n\n        if (decisionService == null || decisionService.getId() == null) {\n            LOGGER.error(\"decision service does not contain key\");\n            throw new IllegalArgumentException(\"decision does not contain decision key\");\n        }\n        \n        DmnEngineConfiguration dmnEngineConfiguration = CommandContextUtil.getDmnEngineConfiguration();\n\n        return new DecisionServiceExecutionAuditContainer(decisionService.getId(), decisionService.getName(), executeDecisionInfo.getDecisionVersion(),\n                dmnEngineConfiguration.isStrictMode(), executeDecisionInfo.getVariables(), dmnEngineConfiguration.getClock().getCurrentTime());\n    }\n\n    public static DecisionExecutionAuditContainer initializeDecisionExecutionAudit(Decision decision, ExecuteDecisionContext executeDecisionInfo) {\n\n        if (decision == null || decision.getId() == null) {\n            LOGGER.error(\"decision does not contain key\");\n            throw new IllegalArgumentException(\"decision does not contain decision key\");\n        }\n\n        DecisionTable decisionTable = (DecisionTable) decision.getExpression();\n\n        if (decisionTable.getHitPolicy() == null) {","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/audit/DecisionExecutionAuditUtil.java#L20-L56","documentation":"DecisionExecutionAuditUtil.initializeDecisionServiceExecutionAudit requires a DecisionService with a non-null id before creating the audit container. If the decision service object or its id is null, it logs 'decision service does not contain key' and throws IllegalArgumentException.","triggerScenarios":"Calling initializeDecisionServiceExecutionAudit with a null DecisionService, or one parsed/deployed without an id attribute, or an id that was never populated during deployment.","commonSituations":"Hand-built DecisionService model objects used programmatically without setting the id; malformed DMN XML missing the id attribute; an entity loaded with a partial projection lacking the id.","solutions":["Set the id on the DecisionService (or deploy the correct DMN XML with an id attribute)","Null-check the decision service and its id before invoking the audit util","Redeploy the DMN artifact if the deployed model lacks the id"],"exampleFix":"// before\nDecisionService ds = new DecisionServiceImpl(); // no id\naudit = DecisionExecutionAuditUtil.initializeDecisionServiceExecutionAudit(ds, ctx);\n// after\nds.setId(\"decision-service-1\");\naudit = DecisionExecutionAuditUtil.initializeDecisionServiceExecutionAudit(ds, ctx);","handlingStrategy":"validation","validationCode":"if (decisionService == null || decisionService.getId() == null) {\n  throw new IllegalArgumentException(\"decision service must have an id before audit init\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set ids when constructing DMN model objects programmatically","Include id attributes in DMN XML","Null-check before calling audit utilities"],"tags":["dmn","audit","null","flowable"],"backgroundTag":"missing-required-argument","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"}