{"record":{"id":"38417317d5ef3898","repo":"flowable/flowable-engine","slug":"activatedbefore-is-null","errorCode":null,"errorMessage":"activatedBefore is null","messagePattern":"activatedBefore 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":467,"sourceCode":"    }\n\n    @Override\n    public PlanItemInstanceQuery planItemInstanceLastDisabledAfter(Date disabledAfter) {\n        if (disabledAfter == null) {\n            throw new FlowableIllegalArgumentException(\"disabledAfter is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.lastDisabledAfter = disabledAfter;\n        } else {\n            this.lastDisabledAfter = disabledAfter;\n        }\n        return this;\n    }\n\n    @Override\n    public PlanItemInstanceQuery planItemInstanceLastStartedBefore(Date startedBefore) {\n        if (startedBefore == null) {\n            throw new FlowableIllegalArgumentException(\"activatedBefore is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.lastStartedBefore = startedBefore;\n        } else {\n            this.lastStartedBefore = startedBefore;\n        }\n        return this;\n    }\n\n    @Override\n    public PlanItemInstanceQuery planItemInstanceLastStartedAfter(Date startedAfter) {\n        if (startedAfter == null) {\n            throw new FlowableIllegalArgumentException(\"startedAfter is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.lastStartedAfter = startedAfter;\n        } else {\n            this.lastStartedAfter = startedAfter;","sourceCodeStart":449,"sourceCodeEnd":485,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/PlanItemInstanceQueryImpl.java#L449-L485","documentation":"planItemInstanceLastStartedBefore(Date) validates its startedBefore argument and throws FlowableIllegalArgumentException with message 'activatedBefore is null' when null is passed. Note the message predates a rename: the parameter is now startedBefore but the error text still says activatedBefore. Null filters are rejected in the builder so queries fail fast.","triggerScenarios":"Calling planItemInstanceLastStartedBefore(null) on a PlanItemInstanceQuery; also seen when code was migrated from the older activatedBefore-named API and the message text no longer matches the parameter.","commonSituations":"Migrations from older Flowable versions where the method was renamed from activated/started terminology; optional start-date filters left null by form handling; null from a scheduler's 'last run' lookup.","solutions":["Pass a non-null Date to planItemInstanceLastStartedBefore.","Skip the filter call when the date is absent.","Coalesce null to a default date before building the query.","If the message confuses you, confirm the actual parameter name (startedBefore) in the Flowable version you use, then apply a null check."],"exampleFix":"// before\nquery.planItemInstanceLastStartedBefore(null); // throws 'activatedBefore is null'\n// after\nif (startedBefore != null) {\n    query.planItemInstanceLastStartedBefore(startedBefore);\n}","handlingStrategy":"validation","validationCode":"if (startedBefore == null) {\n    throw new IllegalArgumentException(\"startedBefore must be a non-null Date (error message may still say activatedBefore)\");\n}\nquery.planItemInstanceLastStartedBefore(startedBefore);","typeGuard":"boolean hasBound(Date d) { return d != null; }","tryCatchPattern":"try {\n    query.planItemInstanceLastStartedBefore(startedBefore);\n} catch (FlowableIllegalArgumentException e) {\n    query = cmmnRuntimeService.createPlanItemInstanceQuery();\n}","preventionTips":["Remember the message text says 'activatedBefore' even though the parameter is startedBefore","Always null-check before calling date-filter builders","Update old activated/started naming during migrations","Verify filter parameters against the Flowable version's API docs"],"tags":["java","flowable","cmmn","query","null-argument","misleading-message"],"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"}