{"record":{"id":"7eef73076169053d","repo":"flowable/flowable-engine","slug":"decisionkey-is-null-7eef73","errorCode":null,"errorMessage":"decisionKey is null","messagePattern":"decisionKey is null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/ExecuteDecisionWithAuditTrailCmd.java","lineNumber":59,"sourceCode":"    \n    public ExecuteDecisionWithAuditTrailCmd(String decisionKey, Map<String, Object> variables) {\n        super(decisionKey, variables);\n    }\n\n    public ExecuteDecisionWithAuditTrailCmd(String decisionKey, String parentDeploymentId, Map<String, Object> variables) {\n        this(decisionKey, variables);\n        executeDecisionContext.setParentDeploymentId(parentDeploymentId);\n    }\n\n    public ExecuteDecisionWithAuditTrailCmd(String decisionKey, String parentDeploymentId, Map<String, Object> variables, String tenantId) {\n        this(decisionKey, parentDeploymentId, variables);\n        executeDecisionContext.setTenantId(tenantId);\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        if (executeDecisionContext.getDecisionKey() == null) {\n            throw new FlowableIllegalArgumentException(\"decisionKey is null\");\n        }\n\n        DmnDefinition definition;\n        try {\n            definition = resolveDefinition();\n        } catch (FlowableException e) {\n            DecisionExecutionAuditContainer container = new DecisionExecutionAuditContainer();\n            container.setFailedWithException(e);\n\n            executeDecisionContext.setDecisionExecution(container);\n            return null;\n        }\n\n        execute(commandContext, definition);\n\n        return null;\n    }\n","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/ExecuteDecisionWithAuditTrailCmd.java#L41-L77","documentation":"ExecuteDecisionWithAuditTrailCmd executes a decision and records an audit trail, but first rejects a null decision key with FlowableIllegalArgumentException. Same guard as ExecuteDecisionCmd because the audit-trail variant resolves the definition by the same key.","triggerScenarios":"Calling getDmnDecisionService().executeDecisionWithAuditTrail(key, vars) or building an audit-trail ExecuteDecisionContext with a null key (e.g. key variable unset, builder method not invoked).","commonSituations":"Audit-enabled deployments (DmnEngineConfiguration setting isEnableEvaluationsAuditTrail) where the key is provided dynamically and happens to be null; unit tests forgetting to set the key.","solutions":["Set a non-null decision key before executing: executeDecisionWithAuditTrail(\"myDecision\", vars)","Guard the key at the call site and raise an application-specific error when null","Check any wrapper/utility class used by your project ensures the key is populated before delegating to the DMN engine"],"exampleFix":"// before\nDmnDecisionTableAuditTrailInfo info = ds.executeDecisionWithAuditTrail(props.get(\"decisionKey\"), vars);\n// after\nString key = (String) props.get(\"decisionKey\");\nif (key == null) throw new IllegalArgumentException(\"decisionKey property missing\");\nDmnDecisionTableAuditTrailInfo info = ds.executeDecisionWithAuditTrail(key, vars);","handlingStrategy":"validation","validationCode":"if (key == null || key.isEmpty()) throw new IllegalArgumentException(\"decision key is required for audited execution\");","typeGuard":null,"tryCatchPattern":"try { decisionService.executeDecisionWithAuditTrail(key, vars); } catch (FlowableIllegalArgumentException e) { if (e.getMessage().equals(\"decisionKey is null\")) { log.error(\"Audited decision executed without key\"); throw e; } throw e; }","preventionTips":["Validate configuration supplying the key at boot time","Wrap audit-trail execution in a helper that enforces key presence","Include the decision key in request DTO validation (e.g. @NotNull/@NotBlank)"],"tags":["flowable","dmn","audit-trail","null-argument"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}