{"record":{"id":"64b47b5385afe026","repo":"flowable/flowable-engine","slug":"referencetype-is-null-64b47b","errorCode":null,"errorMessage":"referenceType is null","messagePattern":"referenceType is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java","lineNumber":713,"sourceCode":"    }\n\n    @Override\n    public CaseInstanceQuery caseInstanceReferenceId(String referenceId) {\n        if (referenceId == null) {\n            throw new FlowableIllegalArgumentException(\"referenceId is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.referenceId = referenceId;\n        } else {\n            this.referenceId = referenceId;\n        }\n        return this;\n    }\n\n    @Override\n    public CaseInstanceQuery caseInstanceReferenceType(String referenceType) {\n        if (referenceType == null) {\n            throw new FlowableIllegalArgumentException(\"referenceType is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.referenceType = referenceType;\n        } else {\n            this.referenceType = referenceType;\n        }\n        return this;\n    }\n\n    @Override\n    public CaseInstanceQuery caseInstanceIsCompleteable() {\n        if (inOrStatement) {\n            this.currentOrQueryObject.completeable = true;\n        } else {\n            this.completeable = true;\n        }\n        return this;\n    }","sourceCodeStart":695,"sourceCodeEnd":731,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java#L695-L731","documentation":"FlowableIllegalArgumentException thrown by CaseInstanceQueryImpl.caseInstanceReferenceType(String) when referenceType is null. Like referenceId, the reference type filter requires an explicit non-null value; null signals misuse of the query API. Provide a valid type string or skip the filter.","triggerScenarios":"Calling caseInstanceReferenceType(null) on a CaseInstanceQuery, e.g. when the type field of a request/DTO is absent.","commonSituations":"Pairing referenceId/referenceType filters where only one is provided by the caller; misconfigured start-form mappings leaving referenceType unset.","solutions":["Pass a non-null referenceType string.","Apply the filter conditionally when the value exists.","If filtering by referenceId only, drop the referenceType call.","Validate the DTO before query construction."],"exampleFix":"// before\nquery.caseInstanceReferenceType(input.referenceType); // may be null\n// after\nif (input.referenceType != null) {\n    query.caseInstanceReferenceType(input.referenceType);\n}","handlingStrategy":"validation","validationCode":"if (referenceType != null) { query.caseInstanceReferenceType(referenceType); }","typeGuard":"boolean hasText(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try { query.caseInstanceReferenceType(refType); } catch (FlowableIllegalArgumentException e) { log.warn(\"referenceType null: {}\", e.getMessage()); }","preventionTips":["Apply referenceId/referenceType filters as a pair only when both exist.","Validate input objects before query building.","Keep filter construction in one null-safe helper."],"tags":["flowable","cmmn","query","null-check"],"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"}