{"record":{"id":"26e341a5f709ee5d","repo":"flowable/flowable-engine","slug":"provided-activity-id-is-null","errorCode":null,"errorMessage":"Provided activity id is null","messagePattern":"Provided activity id is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-eventsubscription-service/src/main/java/org/flowable/eventsubscription/service/impl/EventSubscriptionQueryImpl.java","lineNumber":201,"sourceCode":"\n        return this;\n    }\n    \n    @Override\n    public EventSubscriptionQueryImpl withoutProcessDefinitionId() {\n        if (inOrStatement) {\n            this.currentOrQueryObject.withoutProcessDefinitionId = true;\n        } else {\n            this.withoutProcessDefinitionId = true;\n        }\n\n        return this;\n    }\n\n    @Override\n    public EventSubscriptionQueryImpl activityId(String activityId) {\n        if (activityId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided activity id is null\");\n        }\n\n        if (inOrStatement) {\n            this.currentOrQueryObject.activityId = activityId;\n        } else {\n            this.activityId = activityId;\n        }\n\n        return this;\n    }\n    \n    @Override\n    public EventSubscriptionQueryImpl caseInstanceId(String caseInstanceId) {\n        if (caseInstanceId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided case instance id is null\");\n        }\n\n        if (inOrStatement) {","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-eventsubscription-service/src/main/java/org/flowable/eventsubscription/service/impl/EventSubscriptionQueryImpl.java#L183-L219","documentation":"Flowable throws FlowableIllegalArgumentException from EventSubscriptionQueryImpl.activityId when activityId() is called with a null argument. The query validates every id parameter because a null would make the filter meaningless. Provide the BPMN activity (boundary event / intermediate catch event) id you are targeting, or drop the filter.","triggerScenarios":"Calling .activityId(null) when building an EventSubscriptionQuery, e.g. the activity id comes from an unset XML attribute, a missing flow element, or a null field in the calling service.","commonSituations":"Looking for event subscriptions on an activity whose id was never configured in the BPMN model; parsing activity ids from external input that omitted them; refactoring where the constant holding the activity id was removed.","solutions":["Check the activity id for null before applying the filter","Confirm the target activity actually exists in the deployed process model and its id attribute is set","Use processDefinitionId + activityId together only when both are known","Omit the filter when the activity id is unknown"],"exampleFix":"// before\nList<EventSubscription> subs = query.activityId(activityId).list();\n\n// after\nList<EventSubscription> subs = (activityId != null)\n    ? query.activityId(activityId).list()\n    : query.list();","handlingStrategy":"validation","validationCode":"if (activityId == null) {\n    throw new IllegalStateException(\"activityId required\");\n}\nquery.activityId(activityId);","typeGuard":"if (id instanceof String && !((String) id).isEmpty()) { /* safe to filter */ }","tryCatchPattern":"try {\n    query.activityId(actId).list();\n} catch (FlowableIllegalArgumentException e) {\n    // treat as missing filter input\n}","preventionTips":["Ensure BPMN activity ids are set in the model","Null-check activity ids sourced from XML or request data","Conditionally build filters only for known values"],"tags":["flowable","null-check","query-builder","bpmn"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}