{"record":{"id":"f8135d5c6409a799","repo":"flowable/flowable-engine","slug":"executionids-is-null-or-empty","errorCode":null,"errorMessage":"executionIds is null or empty","messagePattern":"executionIds is null or empty","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/InternalVariableInstanceQueryImpl.java","lineNumber":113,"sourceCode":"            throw new FlowableIllegalArgumentException(\"processInstanceId is empty\");\n        }\n        this.processInstanceId = processInstanceId;\n        return this;\n    }\n\n    @Override\n    public InternalVariableInstanceQuery executionId(String executionId) {\n        if (StringUtils.isEmpty(executionId)) {\n            throw new FlowableIllegalArgumentException(\"executionId is empty\");\n        }\n        this.executionId = executionId;\n        return this;\n    }\n\n    @Override\n    public InternalVariableInstanceQuery executionIds(Collection<String> executionIds) {\n        if (executionIds == null || executionIds.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"executionIds is null or empty\");\n        }\n        this.executionIds = executionIds;\n        return this;\n    }\n\n    @Override\n    public InternalVariableInstanceQuery withoutTaskId() {\n        if (taskId != null || taskIds != null) {\n            throw new FlowableIllegalArgumentException(\"Cannot combine withoutTaskId() with task(String) or taskIds(Collection) in the same query\");\n        }\n        this.withoutTaskId = true;\n        return this;\n    }\n\n    @Override\n    public InternalVariableInstanceQuery scopeId(String scopeId) {\n        if (StringUtils.isEmpty(scopeId)) {\n            throw new FlowableIllegalArgumentException(\"scopeId is empty\");","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/InternalVariableInstanceQueryImpl.java#L95-L131","documentation":"InternalVariableInstanceQueryImpl.executionIds(Collection<String>) throws FlowableIllegalArgumentException when the collection is null or empty. An empty IN-clause is invalid or meaningless, so the builder fails fast instead of executing a broken query. Pass at least one execution id.","triggerScenarios":"Calling executionIds(null), executionIds(Collections.emptyList()), or a collection derived from an empty stream/filter (e.g. child executions of a scope with no children).","commonSituations":"Bulk variable fetch where the execution-id list came from an earlier query returning no rows; batch jobs over empty datasets.","solutions":["Check for null/empty before calling and return an empty result instead","Ensure the execution-id collection is populated (or short-circuit) before query construction","Treat empty input as 'no variables' and skip the service call"],"exampleFix":"// before\nquery.executionIds(executionIds); // throws when empty\n// after\nif (executionIds == null || executionIds.isEmpty()) {\n    return Collections.emptyList();\n}\nquery.executionIds(executionIds);","handlingStrategy":"validation","validationCode":"if (executionIds == null || executionIds.isEmpty()) { return Collections.emptyList(); }","typeGuard":"boolean hasItems(Collection<?> c) { return c != null && !c.isEmpty(); }","tryCatchPattern":"try { query.executionIds(ids); } catch (FlowableIllegalArgumentException e) { log.warn(\"executionIds empty; skipping variable lookup\", e); return Collections.emptyList(); }","preventionTips":["Guard bulk lookups against empty input collections","Handle empty result sets from prior queries before reusing their ids","Prefer Optional/stream checks at collection construction time"],"tags":["flowable","query-builder","empty-collection","argument-validation"],"backgroundTag":"empty-required-field","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"}