{"record":{"id":"41f99d493e7f7df4","repo":"flowable/flowable-engine","slug":"decisiontableid-is-null","errorCode":null,"errorMessage":"decisionTableId is null","messagePattern":"decisionTableId is null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/GetDmnDefinitionCmd.java","lineNumber":39,"sourceCode":"import org.flowable.dmn.model.DmnDefinition;\n\n/**\n * @author Joram Barrez\n */\npublic class GetDmnDefinitionCmd implements Command<DmnDefinition>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n\n    protected String decisionTableId;\n\n    public GetDmnDefinitionCmd(String decisionTableId) {\n        this.decisionTableId = decisionTableId;\n    }\n\n    @Override\n    public DmnDefinition execute(CommandContext commandContext) {\n        if (decisionTableId == null) {\n            throw new FlowableIllegalArgumentException(\"decisionTableId is null\");\n        }\n\n        return DecisionUtil.getDmnDefinitionByDecisionId(decisionTableId);\n    }\n}","sourceCodeStart":21,"sourceCodeEnd":44,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/GetDmnDefinitionCmd.java#L21-L44","documentation":"GetDmnDefinitionCmd loads a DmnDefinition by decision table id, using DecisionUtil.getDmnDefinitionByDecisionId. The command first validates that the decisionTableId passed to its constructor is not null and throws FlowableIllegalArgumentException otherwise, since a null id cannot resolve to any definition.","triggerScenarios":"Calling DmnRepositoryService.getDmnDefinition(null) or new GetDmnDefinitionCmd(null) via the command executor.","commonSituations":"Passing the result of a getDecisionTableById call that returned null, using a process definition id by mistake instead of a decision table id, or a variable that was never initialized.","solutions":["Pass a non-null decision table id obtained from DmnRepositoryService.createDecisionTableQuery() results","Validate the id before invoking the repository API","Confirm you are using the correct id kind (decision table id, not deployment or rule id)"],"exampleFix":"// before\nDmnDefinition def = dmnRepositoryService.getDmnDefinition(decisionTableId);\n// after\nObjects.requireNonNull(decisionTableId, \"decisionTableId must not be null\");\nDmnDefinition def = dmnRepositoryService.getDmnDefinition(decisionTableId);","handlingStrategy":"validation","validationCode":"if (decisionTableId == null || decisionTableId.isEmpty()) {\n    throw new IllegalArgumentException(\"decisionTableId required\");\n}","typeGuard":"boolean hasId(String id) { return id != null && !id.isEmpty(); }","tryCatchPattern":"try {\n    def = dmnRepositoryService.getDmnDefinition(decisionTableId);\n} catch (FlowableIllegalArgumentException e) {\n    log.error(\"decisionTableId was null\", e);\n    return Optional.empty();\n}","preventionTips":["Use Objects.requireNonNull on ids before engine calls","Distinguish decision table ids from other engine id types in variable names","Fail fast when an upstream lookup returns null instead of propagating the null id"],"tags":["java","flowable-dmn","null-check","validation"],"backgroundTag":"null-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"}