{"record":{"id":"6d1f8745bf286718","repo":"flowable/flowable-engine","slug":"execution-id-is-null-6d1f87","errorCode":null,"errorMessage":"Execution id is null","messagePattern":"Execution id is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ExecutionQueryImpl.java","lineNumber":184,"sourceCode":"            this.businessKey = processInstanceBusinessKey;\n            this.includeChildExecutionsWithBusinessKeyQuery = includeChildExecutions;\n            return this;\n        }\n    }\n\n    @Override\n    public ExecutionQuery processDefinitionKeys(Set<String> processDefinitionKeys) {\n        if (processDefinitionKeys == null) {\n            throw new ActivitiIllegalArgumentException(\"Process definition keys is null\");\n        }\n        this.processDefinitionKeys = processDefinitionKeys;\n        return this;\n    }\n\n    @Override\n    public ExecutionQueryImpl executionId(String executionId) {\n        if (executionId == null) {\n            throw new ActivitiIllegalArgumentException(\"Execution id is null\");\n        }\n        this.executionId = executionId;\n        return this;\n    }\n\n    @Override\n    public ExecutionQueryImpl activityId(String activityId) {\n        this.activityId = activityId;\n\n        if (activityId != null) {\n            isActive = true;\n        }\n        return this;\n    }\n\n    @Override\n    public ExecutionQueryImpl parentId(String parentId) {\n        if (parentId == null) {","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ExecutionQueryImpl.java#L166-L202","documentation":"ExecutionQueryImpl.executionId throws ActivitiIllegalArgumentException when the executionId argument is null. The query builder validates each criterion eagerly, so a null id fails immediately at query-construction time rather than at database execution time.","triggerScenarios":"Calling query.executionId(id) with a null id, usually a variable that was supposed to hold a resolved execution identifier from a prior API result.","commonSituations":"Chaining service calls where an earlier task/execution lookup returned null; message correlation handlers that receive no execution id; refactors introducing a nullable id field.","solutions":["Resolve a valid execution id before constructing the query","Skip the executionId criterion if filtering by it is not intended","Return a clearer domain error at the call site when the id is required but missing"],"exampleFix":"// before\nExecution e = runtimeService.createExecutionQuery().executionId(execId).singleResult();\n// after\nObjects.requireNonNull(execId, \"execId is required\");\nExecution e = runtimeService.createExecutionQuery().executionId(execId).singleResult();","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(executionId, \"executionId required\");","typeGuard":"boolean hasExecId = executionId != null && !executionId.isEmpty();","tryCatchPattern":"try { q.executionId(execId); } catch (ActivitiIllegalArgumentException e) { throw new BadRequestException(e.getMessage(), e); }","preventionTips":["Chain lookups defensively: check the previous result before using its id","Fail at entry points with descriptive messages rather than deep in query building","Prefer Optional<Execution> flows so null ids are handled explicitly"],"tags":["java","activiti","query-builder","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"}