{"record":{"id":"5f69bac117e159fd","repo":"flowable/flowable-engine","slug":"scopetype-is-null-5f69ba","errorCode":null,"errorMessage":"scopeType is null","messagePattern":"scopeType is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/HistoricDecisionExecutionQueryImpl.java","lineNumber":135,"sourceCode":"            throw new FlowableIllegalArgumentException(\"executionId is null\");\n        }\n        this.executionId = executionId;\n        return this;\n    }\n    \n    @Override\n    public DmnHistoricDecisionExecutionQuery activityId(String activityId) {\n        if (activityId == null) {\n            throw new FlowableIllegalArgumentException(\"activityId is null\");\n        }\n        this.activityId = activityId;\n        return this;\n    }\n    \n    @Override\n    public DmnHistoricDecisionExecutionQuery 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 DmnHistoricDecisionExecutionQuery withoutScopeType() {\n        this.withoutScopeType = true;\n        return this;\n    }\n\n    @Override\n    public DmnHistoricDecisionExecutionQuery processInstanceIdWithChildren(String processInstanceId) {\n        this.processInstanceIdWithChildren = processInstanceId;\n        return this;\n    }\n\n    @Override","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/HistoricDecisionExecutionQueryImpl.java#L117-L153","documentation":"FlowableIllegalArgumentException thrown by DmnHistoricDecisionExecutionQuery.scopeType(String) when the caller passes a null scope type. The DMN historic query API requires every filter criterion to be non-null so the underlying query builder can construct a valid WHERE clause. It is an immediate fail-fast guard, not a state corruption.","triggerScenarios":"Calling dmnHistoryService.createHistoricDecisionExecutionQuery().scopeType(null), typically when the scope type variable comes from an unset configuration value, a deserialized map entry, or an unassigned method parameter.","commonSituations":"Building the query programmatically from config properties or request parameters where the scope-type key is absent; refactoring that renames a constant leaving a field null; passing a variable that was never initialized instead of omitting the scopeType filter entirely.","solutions":["Pass a valid non-null scope type string (e.g. the scope type of the execution, such as 'bpmn' or 'cmmn') instead of null.","If no scope filtering is desired, omit the scopeType() call entirely — it is an optional filter.","Null-check the source of the value (config, request param, variable) before invoking scopeType()."],"exampleFix":"// before\nquery.scopeType(config.get(\"scopeType\"));\n// after\nString scopeType = config.get(\"scopeType\");\nif (scopeType != null) {\n    query.scopeType(scopeType);\n}","handlingStrategy":"validation","validationCode":"if (scopeType == null || scopeType.isEmpty()) { throw new IllegalArgumentException(\"scopeType must be a non-empty string\"); }","typeGuard":"boolean isValidScopeType(Object v) { return v instanceof String s && !s.isEmpty(); }","tryCatchPattern":"try {\n    query.scopeType(scopeType);\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"Ignoring scopeType filter: {}\", e.getMessage());\n}","preventionTips":["Only call scopeType() when the value is known non-null; it is an optional filter.","Centralize query building in one helper that skips null filters.","Never build filters from unvalidated config/request maps."],"tags":["flowable","dmn","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"}