{"record":{"id":"fda57b0da620de93","repo":"flowable/flowable-engine","slug":"availableafter-is-null","errorCode":null,"errorMessage":"availableAfter is null","messagePattern":"availableAfter 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":376,"sourceCode":"    }\n\n    @Override\n    public PlanItemInstanceQuery planItemInstanceLastAvailableBefore(Date availableBefore) {\n        if (availableBefore == null) {\n            throw new FlowableIllegalArgumentException(\"availableBefore is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.lastAvailableBefore = availableBefore;\n        } else {\n            this.lastAvailableBefore = availableBefore;\n        }\n        return this;\n    }\n\n    @Override\n    public PlanItemInstanceQuery planItemInstanceLastAvailableAfter(Date availableAfter) {\n        if (availableAfter == null) {\n            throw new FlowableIllegalArgumentException(\"availableAfter is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.lastAvailableAfter = availableAfter;\n        } else {\n            this.lastAvailableAfter = availableAfter;\n        }\n        return this;\n    }\n\n    @Override\n    public PlanItemInstanceQuery planItemInstanceLastUnavailableBefore(Date unavailableBefore) {\n        if (unavailableBefore == null) {\n            throw new FlowableIllegalArgumentException(\"unavailableBefore is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.lastUnavailableBefore = unavailableBefore;\n        } else {\n            this.lastUnavailableBefore = unavailableBefore;","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/PlanItemInstanceQueryImpl.java#L358-L394","documentation":"Thrown by PlanItemInstanceQueryImpl.planItemInstanceLastAvailableAfter when the availableAfter Date is null. Like other date filters, a null lower bound is rejected at query-construction time to keep the generated SQL well-defined.","triggerScenarios":"Calling planItemInstanceLastAvailableAfter(null), usually from an absent 'from' timestamp or a failed date parse.","commonSituations":"Reporting windows with optional start dates; deserialization of a missing JSON date field into null.","solutions":["Pass a valid java.util.Date for the bound.","Guard with a null check and omit the filter when absent.","Ensure the date deserializer/parser returns an error instead of null for malformed input."],"exampleFix":"// before\nquery.planItemInstanceLastAvailableAfter(from); // from may be null\n// after\nif (from != null) {\n    query.planItemInstanceLastAvailableAfter(from);\n}","handlingStrategy":"validation","validationCode":"if (availableAfter != null) {\n    planItemInstanceQuery.planItemInstanceLastAvailableAfter(availableAfter);\n}","typeGuard":"boolean isPresent(Date d) {\n    return d != null;\n}","tryCatchPattern":"try {\n    query.planItemInstanceLastAvailableAfter(availableAfter);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().contains(\"availableAfter is null\")) {\n        // rebuild the query without this bound\n    } else {\n        throw e;\n    }\n}","preventionTips":["Only apply date filters when the bound is present","Validate 'from'/'to' parameters at the controller layer","Use strict date parsing to avoid silent nulls"],"tags":["cmmn","query","null-argument","date","flowable"],"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"}