{"record":{"id":"cc2960e774be01d7","repo":"flowable/flowable-engine","slug":"executionids-is-null-cc2960","errorCode":null,"errorMessage":"executionIds is null","messagePattern":"executionIds is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/VariableInstanceQueryImpl.java","lineNumber":101,"sourceCode":"        return this;\n    }\n\n    @Override\n    public VariableInstanceQueryImpl executionId(String executionId) {\n        if (executionId == null) {\n            throw new FlowableIllegalArgumentException(\"Execution id is null\");\n        }\n        if (excludeLocalVariables) {\n            throw new FlowableIllegalArgumentException(\"Cannot use executionId together with excludeLocalVariables\");\n        }\n        this.executionId = executionId;\n        return this;\n    }\n\n    @Override\n    public VariableInstanceQueryImpl executionIds(Set<String> executionIds) {\n        if (executionIds == null) {\n            throw new FlowableIllegalArgumentException(\"executionIds is null\");\n        }\n        if (executionIds.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"Set of executionIds is empty\");\n        }\n        if (excludeLocalVariables) {\n            throw new FlowableIllegalArgumentException(\"Cannot use executionIds together with excludeLocalVariables\");\n        }\n        this.executionIds = executionIds;\n        return this;\n    }\n\n    public VariableInstanceQuery activityInstanceId(String activityInstanceId) {\n        this.activityInstanceId = activityInstanceId;\n        return this;\n    }\n\n    @Override\n    public VariableInstanceQuery taskId(String taskId) {","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/VariableInstanceQueryImpl.java#L83-L119","documentation":"VariableInstanceQuery.executionIds(Set<String>) requires a non-null set of execution ids. Flowable throws FlowableIllegalArgumentException immediately when null is passed, because filtering by an absent collection is meaningless. This is a build-time argument validation; no database query runs.","triggerScenarios":"Passing null to executionIds(), e.g. variableInstanceQuery.executionIds(someSetThatIsNull) where the set was never initialized or came from an upstream API returning null.","commonSituations":"A variable holding execution ids was conditionally populated and ended up null, or a service method forwards an optional id collection straight into the query builder.","solutions":["Ensure the set is initialized before calling executionIds()","Skip calling executionIds() entirely when the collection is null, falling back to an unfiltered query or another filter","Default to Collections.emptySet() and branch around the empty case before reaching the query"],"exampleFix":"// before\nquery.executionIds(executionIds); // may be null\n// after\nif (executionIds != null) {\n    query.executionIds(executionIds);\n}","handlingStrategy":"validation","validationCode":"if (executionIds == null) {\n    throw new IllegalArgumentException(\"executionIds must be non-null before querying\");\n}","typeGuard":"Set<String> safeSet(Set<String> s) { return s == null ? Collections.emptySet() : s; }","tryCatchPattern":"try {\n    query.executionIds(executionIds);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().equals(\"executionIds is null\")) {\n        // fall back to query without the executionIds filter\n    } else { throw e; }\n}","preventionTips":["Use Objects.requireNonNull or Optional for id collections at API boundaries","Initialize collections eagerly instead of conditionally","Avoid forwarding nullable collections straight into Flowable query builders"],"tags":["flowable","null-check","query-validation","variable-instance-query"],"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"}