{"record":{"id":"801048865229cf5f","repo":"flowable/flowable-engine","slug":"executionid-is-empty","errorCode":null,"errorMessage":"executionId is empty","messagePattern":"executionId is 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":104,"sourceCode":"            throw new FlowableIllegalArgumentException(\"Cannot combine taskIds(Collection) with withoutTaskId() in the same query\");\n        }\n        this.taskIds = taskIds;\n        return this;\n    }\n\n    @Override\n    public InternalVariableInstanceQuery processInstanceId(String processInstanceId) {\n        if (StringUtils.isEmpty(processInstanceId)) {\n            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\");","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/InternalVariableInstanceQueryImpl.java#L86-L122","documentation":"InternalVariableInstanceQueryImpl.executionId(String) throws FlowableIllegalArgumentException when the given executionId is null or empty. Variable lookups by execution require a concrete id, so blank input is rejected at query-construction time before any database access.","triggerScenarios":"Calling executionId(null) or executionId(\"\") — e.g. using ExecutionEntity.getId() outside an active execution, an id from an empty message header, or an uninitialized variable.","commonSituations":"Code running outside execution context (no current execution id available); execution id taken from a delegate/variable that was never set; refactors leaving the id blank.","solutions":["Obtain the execution id from the correct context (e.g. DelegateExecution.getId()) before querying","Guard the call site and skip the query when the id is missing","Validate the id upstream in your service layer"],"exampleFix":"// before\nquery.executionId(executionId); // throws when null/empty\n// after\nif (executionId != null && !executionId.isEmpty()) {\n    query.executionId(executionId);\n} else {\n    return Collections.emptyList();\n}","handlingStrategy":"validation","validationCode":"if (executionId == null || executionId.isEmpty()) { throw new IllegalArgumentException(\"executionId required\"); }","typeGuard":"boolean hasExecutionId(String id) { return id != null && !id.isEmpty(); }","tryCatchPattern":"try { query.executionId(executionId); } catch (FlowableIllegalArgumentException e) { log.warn(\"Missing executionId for variable query\", e); return Collections.emptyList(); }","preventionTips":["Get execution ids from DelegateExecution inside delegates, not custom fields","Validate ids from message headers/variables before query construction","Return early (empty result) when execution context is absent"],"tags":["flowable","query-builder","argument-validation","null-argument"],"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"}