{"record":{"id":"5dedc62ba484f6fc","repo":"flowable/flowable-engine","slug":"decisionkey-is-null-5dedc6","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/ExecuteDecisionCmd.java","lineNumber":59,"sourceCode":"\n    public ExecuteDecisionCmd(String decisionKey, String parentDeploymentId, Map<String, Object> variables) {\n        this(decisionKey, variables);\n        executeDecisionContext.setParentDeploymentId(parentDeploymentId);\n    }\n\n    public ExecuteDecisionCmd(String decisionKey, String parentDeploymentId, Map<String, Object> variables, String tenantId) {\n        this(decisionKey, parentDeploymentId, variables);\n        executeDecisionContext.setTenantId(tenantId);\n    }\n\n    public ExecuteDecisionCmd(ExecuteDecisionContext executeDecisionContext) {\n        super(executeDecisionContext);\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 = resolveDefinition();\n\n        execute(commandContext, definition);\n\n        return null;\n    }\n\n}\n","sourceCodeStart":41,"sourceCodeEnd":70,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/ExecuteDecisionCmd.java#L41-L70","documentation":"ExecuteDecisionCmd refuses to run a DMN decision when the decision key on the ExecuteDecisionContext is null. The engine cannot resolve a DmnDefinition without a key, so it fails fast with FlowableIllegalArgumentException instead of a confusing lookup error later. The key is normally set via DmnDecisionService.executeDecision with a decision key or by the calling activity behavior.","triggerScenarios":"Calling DmnEngine/DmnRuleServices.executeDecision(...) or building an ExecuteDecisionContext (via ExecuteDecisionBuilder) without ever calling decisionKey(String) — e.g. key variable itself null, or the key comes from an unset process/flow variable.","commonSituations":"Spring/XML config where the decision key is injected from a property that is missing or empty-null; dynamic keys resolved from a process variable that was never set; refactor renaming the builder method so the key assignment was dropped.","solutions":["Set the decision key explicitly: dmnEngine.getRuleServices().getDmnDecisionService().executeDecision(\"myDecisionKey\", variables)","If the key comes from a variable/property, check it is non-null before invoking the engine and fail with a clear application-level message","Verify the ExecuteDecisionContext/ExecuteDecisionBuilder construction includes executeDecisionContext.setDecisionKey(...) or .decisionKey(...) before execute()"],"exampleFix":"// before\nString key = config.getDecisionKey(); // may be null\ndecisionService.executeDecision(key, vars);\n// after\nString key = config.getDecisionKey();\nif (key == null || key.isEmpty()) {\n    throw new IllegalStateException(\"DMN decision key not configured\");\n}\ndecisionService.executeDecision(key, vars);","handlingStrategy":"validation","validationCode":"if (decisionKey == null || decisionKey.isEmpty()) throw new IllegalArgumentException(\"decisionKey must be set before executing a decision\");","typeGuard":null,"tryCatchPattern":"try { decisionService.executeDecision(key, vars); } catch (FlowableIllegalArgumentException e) { if (e.getMessage().contains(\"decisionKey is null\")) { throw new ConfigurationException(\"DMN decision key not configured\", e); } throw e; }","preventionTips":["Always populate the decision key in one central wrapper around the DMN engine","Fail application startup when the configured decision key property is missing","Log the decision key source (property, variable) so null origins are traceable"],"tags":["flowable","dmn","null-argument","api-misuse"],"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"}