{"record":{"id":"30a199daabf246d3","repo":"flowable/flowable-engine","slug":"completedby-is-null","errorCode":null,"errorMessage":"completedBy is null","messagePattern":"completedBy is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/PlanItemInstanceQueryImpl.java","lineNumber":742,"sourceCode":"    }\n\n    @Override\n    public PlanItemInstanceQuery planItemInstanceAssignee(String assignee) {\n        if (assignee == null) {\n            throw new FlowableIllegalArgumentException(\"assignee is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.assignee = assignee;\n        } else {\n            this.assignee = assignee;\n        }\n        return this;\n    }\n\n    @Override\n    public PlanItemInstanceQuery planItemInstanceCompletedBy(String completedBy) {\n        if (completedBy == null) {\n            throw new FlowableIllegalArgumentException(\"completedBy is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.completedBy = completedBy;\n        } else {\n            this.completedBy = completedBy;\n        }\n        return this;\n    }\n\n    @Override\n    public PlanItemInstanceQuery planItemInstanceReferenceId(String referenceId) {\n        if (inOrStatement) {\n            this.currentOrQueryObject.referenceId = referenceId;\n        } else {\n            this.referenceId = referenceId;\n        }\n        return this;\n    }","sourceCodeStart":724,"sourceCodeEnd":760,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/PlanItemInstanceQueryImpl.java#L724-L760","documentation":"PlanItemInstanceQueryImpl.planItemInstanceCompletedBy(String) throws FlowableIllegalArgumentException with message \"completedBy is null\" when the completedBy argument is null. Flowable's query setters fail fast on null since a null criterion cannot be expressed in the generated where-clause.","triggerScenarios":"Calling planItemInstanceCompletedBy(null), typically when the completing user is unknown (plan item not yet completed) or comes from a nullable source.","commonSituations":"Reporting screens that read completedBy from active (never-completed) plan item instances; copying a field from one entity to a query without a null check; deserialized JSON payloads with a missing completedBy key.","solutions":["Null-check the completedBy value and add the criterion only when present","Restrict the query to completed instances before filtering by completedBy if completeness is expected","Handle missing JSON/DTO fields with defaults or explicit validation upstream","Catch FlowableIllegalArgumentException around dynamic query construction"],"exampleFix":"// before\nquery.planItemInstanceCompletedBy(completedBy); // throws when null\n// after\nif (completedBy != null) {\n    query.planItemInstanceCompletedBy(completedBy);\n}","handlingStrategy":"validation","validationCode":"if (completedBy != null) {\n    query.planItemInstanceCompletedBy(completedBy);\n}","typeGuard":"boolean hasCompleter = completedBy != null;","tryCatchPattern":"try {\n    query.planItemInstanceCompletedBy(completedBy);\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"completedBy was null, filter skipped\");\n}","preventionTips":["Remember active plan items have no completedBy; never copy it into queries unconditionally","Handle missing fields in DTOs/JSON before mapping into query criteria","Only query by completedBy on completed instances"],"tags":["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-18T11:17:12.947Z"}