{"record":{"id":"5d54d42af8463164","repo":"flowable/flowable-engine","slug":"decisionkey-is-null-5d54d4","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/ExecuteDecisionServiceCmd.java","lineNumber":61,"sourceCode":"\n    public ExecuteDecisionServiceCmd(String decisionKey, String parentDeploymentId, Map<String, Object> variables) {\n        this(decisionKey, variables);\n        executeDecisionContext.setParentDeploymentId(parentDeploymentId);\n    }\n\n    public ExecuteDecisionServiceCmd(String decisionKey, String parentDeploymentId, Map<String, Object> variables, String tenantId) {\n        this(decisionKey, parentDeploymentId, variables);\n        executeDecisionContext.setTenantId(tenantId);\n    }\n\n    public ExecuteDecisionServiceCmd(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    @Override\n    protected void execute(CommandContext commandContext, DmnDefinition definition) {\n        DecisionService decisionService = definition.getDecisionServiceById(executeDecisionContext.getDecisionKey());\n\n        if (decisionService == null) {\n            throw new FlowableIllegalArgumentException(\"no decision service with id: '\" + executeDecisionContext.getDecisionKey() + \"' found in definition\");\n        }\n\n        executeDecisionContext.setDmnElement(decisionService);","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/ExecuteDecisionServiceCmd.java#L43-L79","documentation":"ExecuteDecisionServiceCmd performs the same null-key guard as ExecuteDecisionCmd, but for decision service invocations: it throws FlowableIllegalArgumentException when executeDecisionContext.getDecisionKey() is null. The decision key here identifies the decision service element inside the deployed DMN definition, and it is required before definition resolution can proceed.","triggerScenarios":"Calling DmnDecisionService.executeDecisionService(...) or executeDecisionServiceWithVariables(...) with a null key, or building an ExecuteDecisionContext without setting the key.","commonSituations":"Key passed in from an upstream service result that is null; REST/API layer dropping the key parameter; decision service key stored in a config map keyed incorrectly so lookup returns null.","solutions":["Pass a non-null decision service key: getDmnDecisionService().executeDecisionService(\"myDecisionService\", variables)","Trim/fail fast on the caller side when the incoming key is null or blank","Confirm the builder chain ends with .decisionServiceKey(...) / decisionKey(...) being invoked before execute"],"exampleFix":"// before\ndecisionService.executeDecisionService(request.getKey(), vars);\n// after\nString key = request.getKey();\nObjects.requireNonNull(key, \"decision service key is required\");\ndecisionService.executeDecisionService(key, vars);","handlingStrategy":"validation","validationCode":"if (serviceKey == null || serviceKey.isBlank()) throw new IllegalArgumentException(\"decision service key is required\");","typeGuard":null,"tryCatchPattern":"try { decisionService.executeDecisionService(key, vars); } catch (FlowableIllegalArgumentException e) { if (e.getMessage().equals(\"decisionKey is null\")) { return badRequest(\"decision service key missing\"); } throw e; }","preventionTips":["Extract the key from requests with explicit null checks at the API boundary","Use constants/enums for known decision service keys instead of free-form strings","Cover the key-passing path with a unit test asserting a non-null key"],"tags":["flowable","dmn","decision-service","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"}