{"record":{"id":"6739a2c1a8eda27f","repo":"flowable/flowable-engine","slug":"plan-item-instance-for-eventsubscription-can-not","errorCode":null,"errorMessage":"Plan item instance for {eventSubscription} can not be found with empty sub scope id value","messagePattern":"Plan item instance for (.+?) can not be found with empty sub scope id value","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine-configurator/src/main/java/org/flowable/cmmn/engine/configurator/impl/cmmn/DefaultCaseInstanceService.java","lineNumber":94,"sourceCode":"            caseInstanceBuilder.variable(target, inParametersMap.get(target));\n        }\n\n        if (businessKey != null) {\n            caseInstanceBuilder.businessKey(businessKey);\n        }\n\n        if (caseInstanceName != null) {\n            caseInstanceBuilder.name(caseInstanceName);\n        }\n\n        CaseInstance caseInstance = caseInstanceBuilder.start();\n        return caseInstance.getId();\n    }\n\n    @Override\n    public void handleSignalEvent(EventSubscriptionEntity eventSubscription, Map<String, Object> variables) {\n        if (StringUtils.isEmpty(eventSubscription.getSubScopeId())) {\n            throw new FlowableException(\"Plan item instance for \" + eventSubscription + \" can not be found with empty sub scope id value\");\n        }\n        \n        CmmnRuntimeService cmmnRuntimeService = cmmnEngineConfiguration.getCmmnRuntimeService();\n        PlanItemInstance planItemInstance = cmmnRuntimeService.createPlanItemInstanceQuery()\n                        .planItemInstanceId(eventSubscription.getSubScopeId())\n                        .singleResult();\n        \n        if (planItemInstance == null) {\n            throw new FlowableException(\"Plan item instance for \" + eventSubscription + \" can not be found with sub scope id \" + eventSubscription.getSubScopeId());\n        }\n\n        cmmnRuntimeService.createPlanItemInstanceTransitionBuilder(planItemInstance.getId())\n            .variables(variables)\n            .trigger();\n    }\n\n    @Override\n    public void deleteCaseInstance(String caseInstanceId) {","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine-configurator/src/main/java/org/flowable/cmmn/engine/configurator/impl/cmmn/DefaultCaseInstanceService.java#L76-L112","documentation":"DefaultCaseInstanceService.handleSignalEvent looks up the plan item instance for an incoming event subscription using the subscription's subScopeId. If the subScopeId is empty, the lookup is impossible and Flowable throws this FlowableException instead of returning a wrong/empty result.","triggerScenarios":"Signaling a case (CmmnRuntimeService signal / runtime signal event delivery) with an EventSubscriptionEntity whose subScopeId was never populated — e.g. an event subscription created without linking a plan item instance scope.","commonSituations":"Custom event subscription creation code that skipped setSubScopeId; corrupted event subscription rows in ACT_RU_EVENT_SUBSCR; engine version migrations where subScopeId was newly required.","solutions":["Ensure the event subscription is created with a subScopeId pointing at the target plan item instance.","Inspect the event subscription record (ACT_RU_EVENT_SUBSCR.SUB_SCOPE_ID_) and correct/recreate it.","If creating subscriptions manually, call setSubScopeId(planItemInstanceId) before storing.","Check for migration scripts from older Flowable versions and backfill empty SUB_SCOPE_ID_ values."],"exampleFix":"// before\nEventSubscriptionEntity sub = eventSubscriptionService.createEventSubscription();\nsub.setEventType(\"signal\");\n// after\nEventSubscriptionEntity sub = eventSubscriptionService.createEventSubscription();\nsub.setEventType(\"signal\");\nsub.setSubScopeId(planItemInstance.getId());","handlingStrategy":"validation","validationCode":"public static boolean isSignalable(EventSubscriptionEntity sub) {\n    return sub != null && org.apache.commons.lang3.StringUtils.isNotEmpty(sub.getSubScopeId());\n}\n// before signaling:\nif (!isSignalable(sub)) { throw new IllegalArgumentException(\"Event subscription missing subScopeId\"); }","typeGuard":null,"tryCatchPattern":"try {\n    defaultCaseInstanceService.handleSignalEvent(subscription, variables);\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"empty sub scope id\")) {\n        logger.error(\"Event subscription {} has no subScopeId; recreate the subscription\", subscription.getId(), e);\n    }\n    throw e;\n}","preventionTips":["Always set subScopeId when creating event subscriptions targeting plan items","Monitor ACT_RU_EVENT_SUBSCR for rows with NULL/empty SUB_SCOPE_ID_","Run DB migration scripts when upgrading Flowable versions"],"tags":["cmmn","event-subscription","signal"],"backgroundTag":"empty-required-field","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"}