{"record":{"id":"2cdcc53c586850ce","repo":"flowable/flowable-engine","slug":"activityid-is-null","errorCode":null,"errorMessage":"activityId is null","messagePattern":"activityId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/HistoricDecisionExecutionQueryImpl.java","lineNumber":126,"sourceCode":"            throw new FlowableIllegalArgumentException(\"instanceId is null\");\n        }\n        this.instanceId = instanceId;\n        return this;\n    }\n    \n    @Override\n    public DmnHistoricDecisionExecutionQuery executionId(String executionId) {\n        if (executionId == null) {\n            throw new FlowableIllegalArgumentException(\"executionId is null\");\n        }\n        this.executionId = executionId;\n        return this;\n    }\n    \n    @Override\n    public DmnHistoricDecisionExecutionQuery activityId(String activityId) {\n        if (activityId == null) {\n            throw new FlowableIllegalArgumentException(\"activityId is null\");\n        }\n        this.activityId = activityId;\n        return this;\n    }\n    \n    @Override\n    public DmnHistoricDecisionExecutionQuery scopeType(String scopeType) {\n        if (scopeType == null) {\n            throw new FlowableIllegalArgumentException(\"scopeType is null\");\n        }\n        this.scopeType = scopeType;\n        return this;\n    }\n    \n    @Override\n    public DmnHistoricDecisionExecutionQuery withoutScopeType() {\n        this.withoutScopeType = true;\n        return this;","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/HistoricDecisionExecutionQueryImpl.java#L108-L144","documentation":"HistoricDecisionExecutionQueryImpl.activityId(String) throws FlowableIllegalArgumentException when the activityId argument is null. The activity id (the BPMN element that invoked the decision) is used as a direct database filter, so the builder throws FlowableIllegalArgumentException for null input.","triggerScenarios":"Calling dmnHistoryService.createHistoricDecisionExecutionQuery().activityId(null), usually when the current flow element is resolved from an execution context that is empty or when the caller passes an optional activity filter that was never set.","commonSituations":"Per-activity decision audit reports where the invoking activity id is unknown (e.g. decision called via API, not from a BPMN activity); request-driven filters with absent parameters; process refactors that removed the calling activity.","solutions":["Pass the BPMN activity id that invokes the decision task, obtained from the delegate/execution context","Apply activityId(...) conditionally only when a valid id exists; otherwise filter by other criteria","Validate that the decision is actually invoked from a flow activity before using this filter"],"exampleFix":"// before\nquery.activityId(delegateExecution.getCurrentActivityId()); // may be null\n// after\nString activityId = delegateExecution != null\n    ? delegateExecution.getCurrentActivityId() : null;\nif (activityId != null) {\n    query.activityId(activityId);\n}","handlingStrategy":"validation","validationCode":"if (activityId == null) { throw new IllegalArgumentException(\"activityId must be resolved from the invoking BPMN element\"); }","typeGuard":"boolean hasActivityId(DelegateExecution ex) { return ex != null && ex.getCurrentActivityId() != null; }","tryCatchPattern":"try { query.activityId(actId); } catch (FlowableIllegalArgumentException e) { log.debug(\"activityId filter not applied (non-activity invocation)\"); }","preventionTips":["Only use the activityId filter for decisions invoked from BPMN activities, not standalone API calls","Null-check getCurrentActivityId()/getCurrentFlowElement() before using them as criteria"],"tags":["flowable","dmn","history","query","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-14T11:17:12.474Z"}