{"record":{"id":"993a120e103dd607","repo":"flowable/flowable-engine","slug":"invalid-case-definition-id-null","errorCode":null,"errorMessage":"Invalid case definition id : null","messagePattern":"Invalid case definition id : null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/deployer/CmmnDeploymentManager.java","lineNumber":60,"sourceCode":"    protected DeploymentCache<CaseDefinitionCacheEntry> caseDefinitionCache;\n    protected List<EngineDeployer> deployers;\n    protected CmmnEngineConfiguration cmmnEngineConfiguration;\n    protected CmmnDeploymentEntityManager deploymentEntityManager;\n    protected CaseDefinitionEntityManager caseDefinitionEntityManager;\n\n    public void deploy(EngineDeployment deployment) {\n        deploy(deployment, null);\n    }\n\n    public void deploy(EngineDeployment deployment, Map<String, Object> deploymentSettings) {\n        for (EngineDeployer deployer : deployers) {\n            deployer.deploy(deployment, deploymentSettings);\n        }\n    }\n\n    public CaseDefinition findDeployedCaseDefinitionById(String caseDefinitionId) {\n        if (caseDefinitionId == null) {\n            throw new FlowableIllegalArgumentException(\"Invalid case definition id : null\");\n        }\n\n        CaseDefinitionCacheEntry cacheEntry = caseDefinitionCache.get(caseDefinitionId);\n        CaseDefinition caseDefinition = cacheEntry != null ? cacheEntry.getCaseDefinition() : null;\n\n        if (caseDefinition == null) {\n            caseDefinition = caseDefinitionEntityManager.findById(caseDefinitionId);\n            if (caseDefinition == null) {\n                throw new FlowableObjectNotFoundException(\"no deployed case definition found with id '\" + caseDefinitionId + \"'\", CaseDefinition.class);\n            }\n            caseDefinition = resolveCaseDefinition(caseDefinition).getCaseDefinition();\n        }\n        return caseDefinition;\n    }\n\n    public CaseDefinition findDeployedLatestCaseDefinitionByKey(String caseDefinitionKey) {\n        CaseDefinition caseDefinition = caseDefinitionEntityManager.findLatestCaseDefinitionByKey(caseDefinitionKey);\n","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/deployer/CmmnDeploymentManager.java#L42-L78","documentation":"findDeployedCaseDefinitionById resolves a case definition by its id, first from the definition cache and then from the database. A null id cannot be looked up, so the manager immediately throws FlowableIllegalArgumentException. This is a defensive precondition check before any cache or persistence access.","triggerScenarios":"Passing null as caseDefinitionId to CmmnRuntimeService/Management/TaskService methods such as getCaseDefinition, getCmmnModel, or internal caseDefinition(...) resolution when the id variable was never populated.","commonSituations":"A variable or DTO field holding the definition id left null because a case was never started; a mapping bug where the wrong request field is read; deserialization producing null for the id.","solutions":["Ensure the caller supplies a non-null case definition id before invoking the API","Check where the id originates (process variable, request body) and fail fast with your own validation message","If id is optional in your flow, guard with a null check and skip the lookup"],"exampleFix":"// before\ncaseDefinition = cmmnRuntimeService.getCaseDefinition(caseDefinitionId); // caseDefinitionId is null\n// after\nif (caseDefinitionId != null) {\n    caseDefinition = cmmnRuntimeService.getCaseDefinition(caseDefinitionId);\n}","handlingStrategy":"validation","validationCode":"if (caseDefinitionId == null || caseDefinitionId.isBlank()) throw new IllegalArgumentException(\"caseDefinitionId required\");","typeGuard":null,"tryCatchPattern":"try { def = cmmnRuntimeService.getCaseDefinition(id); } catch (FlowableIllegalArgumentException e) { /* null id — fix caller */ }","preventionTips":["Null-check ids at API boundaries","Fail fast with a clear message when an id field is absent in input DTOs"],"tags":["null-check","illegal-argument","case-definition"],"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"}