{"record":{"id":"26ccb9eabb19f788","repo":"flowable/flowable-engine","slug":"planitemdefinitionids-is-null","errorCode":null,"errorMessage":"planItemDefinitionIds is null","messagePattern":"planItemDefinitionIds is null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java","lineNumber":1069,"sourceCode":"    }\n\n    @Override\n    public HistoricCaseInstanceQuery activePlanItemDefinitionId(String planItemDefinitionId) {\n        if (planItemDefinitionId == null) {\n            throw new FlowableIllegalArgumentException(\"planItemDefinitionId is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.activePlanItemDefinitionId = planItemDefinitionId;\n        } else {\n            this.activePlanItemDefinitionId = planItemDefinitionId;\n        }\n        return this;\n    }\n    \n    @Override\n    public HistoricCaseInstanceQuery activePlanItemDefinitionIds(Set<String> planItemDefinitionIds) {\n        if (planItemDefinitionIds == null) {\n            throw new FlowableIllegalArgumentException(\"planItemDefinitionIds is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.activePlanItemDefinitionIds = planItemDefinitionIds;\n        } else {\n            this.activePlanItemDefinitionIds = planItemDefinitionIds;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricCaseInstanceQuery involvedUser(String userId) {\n        if (userId == null) {\n            throw new FlowableIllegalArgumentException(\"involvedUser is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.involvedUser = userId;\n        } else {\n            this.involvedUser = userId;","sourceCodeStart":1051,"sourceCodeEnd":1087,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java#L1051-L1087","documentation":"HistoricCaseInstanceQueryImpl.activePlanItemDefinitionIds(Set<String>) throws FlowableIllegalArgumentException when the set of plan item definition ids is null. The set is stored directly on the query (or its OR object) to build an IN clause, so a null set is invalid input and is rejected eagerly.","triggerScenarios":"Calling activePlanItemDefinitionIds(null) on a HistoricCaseInstanceQuery, inside or outside an or() block, before executing the query.","commonSituations":"A downstream method returns null instead of an empty set when no plan item definitions match; deserialization of a config list yields null; constructing queries generically where the set parameter is optional but passed as null.","solutions":["Pass a non-null Set; initialize with new HashSet<>() or Set.of() rather than leaving the variable null.","Only call activePlanItemDefinitionIds when the set is present; skip the filter otherwise.","Ensure list-to-set conversion helpers never return null (return an empty set instead).","Check that a mapping/config step didn't fail silently and leave the set unset."],"exampleFix":"// before\nquery.activePlanItemDefinitionIds(planItemDefinitionIds); // may be null\n// after\nif (planItemDefinitionIds != null && !planItemDefinitionIds.isEmpty()) {\n    query.activePlanItemDefinitionIds(planItemDefinitionIds);\n}","handlingStrategy":"validation","validationCode":"if (planItemDefinitionIds == null || planItemDefinitionIds.isEmpty()) {\n    throw new IllegalArgumentException(\"planItemDefinitionIds must be non-empty\");\n}\nquery.activePlanItemDefinitionIds(planItemDefinitionIds);","typeGuard":"boolean isNonEmpty(Set<String> s) {\n    return s != null && !s.isEmpty();\n}","tryCatchPattern":"try {\n    query.activePlanItemDefinitionIds(ids);\n} catch (FlowableIllegalArgumentException e) {\n    if (\"planItemDefinitionIds is null\".equals(e.getMessage())) {\n        // treat as no filter or rethrow with context\n    } else {\n        throw e;\n    }\n}","preventionTips":["Initialize id sets eagerly (Collections.emptySet / new HashSet) instead of null","Check set contents before applying IN-style filters","Ensure converters/mappers return empty collections, never null","Log when a filter is skipped due to missing ids so behavior is visible"],"tags":["java","flowable","cmmn","query","null-argument"],"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"}