{"record":{"id":"cb316f17987963a3","repo":"flowable/flowable-engine","slug":"decision-table-id-is-null","errorCode":null,"errorMessage":"Decision table id is null","messagePattern":"Decision table id is null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/SetDecisionTableCategoryCmd.java","lineNumber":41,"sourceCode":"\r\n/**\r\n * @author Joram Barrez\r\n */\r\npublic class SetDecisionTableCategoryCmd implements Command<Void> {\r\n\r\n    protected String decisionTableId;\r\n    protected String category;\r\n\r\n    public SetDecisionTableCategoryCmd(String decisionTableId, String category) {\r\n        this.decisionTableId = decisionTableId;\r\n        this.category = category;\r\n    }\r\n\r\n    @Override\r\n    public Void execute(CommandContext commandContext) {\r\n\r\n        if (decisionTableId == null) {\r\n            throw new FlowableIllegalArgumentException(\"Decision table id is null\");\r\n        }\r\n\r\n        DecisionEntity decisionTable = CommandContextUtil.getDecisionEntityManager(commandContext).findById(decisionTableId);\r\n\r\n        if (decisionTable == null) {\r\n            throw new FlowableObjectNotFoundException(\"No decision table found for id = '\" + decisionTableId + \"'\");\r\n        }\r\n\r\n        // Update category\r\n        decisionTable.setCategory(category);\r\n\r\n        // Remove process definition from cache, it will be refetch later\r\n        DeploymentCache<DecisionCacheEntry> decisionTableCache = CommandContextUtil.getDmnEngineConfiguration().getDefinitionCache();\r\n        if (decisionTableCache != null) {\r\n            decisionTableCache.remove(decisionTableId);\r\n        }\r\n\r\n        CommandContextUtil.getDecisionEntityManager(commandContext).update(decisionTable);\r","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/SetDecisionTableCategoryCmd.java#L23-L59","documentation":"SetDecisionTableCategoryCmd updates the category of a decision table. It first validates that decisionTableId is non-null and throws FlowableIllegalArgumentException ('Decision table id is null') otherwise. Called via DmnRepositoryService.setDecisionTableCategory.","triggerScenarios":"Calling dmnRepositoryService.setDecisionTableCategory(null, category) or new SetDecisionTableCategoryCmd(null, category).","commonSituations":"Ids collected from UI forms or deployment results that were null, refactors renaming id variables, or an optional lookup earlier returning nothing.","solutions":["Pass a valid non-null decision table id from DmnRepositoryService.createDecisionTableQuery()","Validate the id before calling setDecisionTableCategory","Fix upstream code that produced a null id"],"exampleFix":"// before\nrepositoryService.setDecisionTableCategory(decisionTableId, \"newCat\");\n// after\nif (decisionTableId == null) throw new IllegalArgumentException(\"decisionTableId required\");\nrepositoryService.setDecisionTableCategory(decisionTableId, \"newCat\");","handlingStrategy":"validation","validationCode":"if (decisionTableId == null || decisionTableId.isEmpty()) {\n    throw new IllegalArgumentException(\"decisionTableId required\");\n}","typeGuard":"boolean hasDecisionTableId(String id) { return id != null && !id.isEmpty(); }","tryCatchPattern":"try {\n    repositoryService.setDecisionTableCategory(decisionTableId, category);\n} catch (FlowableIllegalArgumentException e) {\n    log.error(\"Null decisionTableId passed\", e);\n    throw new BadRequestException(\"decisionTableId required\");\n}","preventionTips":["Obtain ids from query results, never from free-form input without checks","Use requireNonNull at API boundaries","Keep category-update logic behind a service method that validates inputs"],"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"}