{"record":{"id":"790cecdf72531c7e","repo":"flowable/flowable-engine","slug":"scopetype-is-null-790cec","errorCode":null,"errorMessage":"scopeType is null","messagePattern":"scopeType is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-batch-service/src/main/java/org/flowable/batch/service/impl/BatchPartQueryImpl.java","lineNumber":166,"sourceCode":"            throw new FlowableIllegalArgumentException(\"scopeId is null\");\n        }\n        this.scopeId = scopeId;\n        return this;\n    }\n\n    @Override\n    public BatchPartQuery subScopeId(String subScopeId) {\n        if (subScopeId == null) {\n            throw new FlowableIllegalArgumentException(\"subScopeId is null\");\n        }\n        this.subScopeId = subScopeId;\n        return this;\n    }\n\n    @Override\n    public BatchPartQuery scopeType(String scopeType) {\n        if (scopeType == null) {\n            throw new FlowableIllegalArgumentException(\"scopeType is null\");\n        }\n        this.scopeType = scopeType;\n        return this;\n    }\n\n    @Override\n    public BatchPartQuery tenantId(String tenantId) {\n        if (tenantId == null) {\n            throw new FlowableIllegalArgumentException(\"tenantId is null\");\n        }\n        this.tenantId = tenantId;\n        return this;\n    }\n\n    @Override\n    public BatchPartQuery tenantIdLike(String tenantIdLike) {\n        if (tenantIdLike == null) {\n            throw new FlowableIllegalArgumentException(\"tenantIdLike is null\");","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-batch-service/src/main/java/org/flowable/batch/service/impl/BatchPartQueryImpl.java#L148-L184","documentation":"BatchPartQueryImpl.scopeType() throws FlowableIllegalArgumentException when the scopeType argument is null. scopeType (e.g. 'bpmn', 'cmmn') is validated non-null at setter time because it drives both filtering and the typed batch handling downstream.","triggerScenarios":"Calling batchPartQuery().scopeType(null), or deriving the scope type from a variable/config entry that is absent.","commonSituations":"Generic batch handling code that reads a scope-type config key with no default; passing EngineConfiguration scope types when the engine module is not installed.","solutions":["Pass a valid scope type constant such as ScopeTypes.BPMN or ScopeTypes.CMMN","Only chain .scopeType(...) when the value is non-null","Confirm the scope type is set on the configuration or entity it is read from"],"exampleFix":"// before\nquery.scopeType(config.getScopeType()); // may be null\n// after\nif (config.getScopeType() != null) {\n    query.scopeType(config.getScopeType());\n} else {\n    query.scopeType(ScopeTypes.BPMN);\n}","handlingStrategy":"validation","validationCode":"if (scopeType == null) {\n    scopeType = ScopeTypes.BPMN; // sensible default\n}\nquery.scopeType(scopeType);","typeGuard":"boolean hasScopeType(String s) { return s != null && !s.isEmpty(); }","tryCatchPattern":"try {\n    query.scopeType(scopeType);\n} catch (FlowableIllegalArgumentException e) {\n    query.scopeType(ScopeTypes.BPMN);\n}","preventionTips":["Default scope type at configuration load time, not at query time","Use ScopeTypes constants instead of raw strings resolved from maps","Validate engine configuration on startup so scope type is never null downstream"],"tags":["java","flowable","null-check","query-api"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}