flowable/flowable-engine · error · FlowableException

Plan item instance for {eventSubscription} can not be found

Error message

Plan item instance for {eventSubscription} can not be found with empty sub scope id value

What it means

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.

Source

Thrown at modules/flowable-cmmn-engine-configurator/src/main/java/org/flowable/cmmn/engine/configurator/impl/cmmn/DefaultCaseInstanceService.java:94

            caseInstanceBuilder.variable(target, inParametersMap.get(target));
        }

        if (businessKey != null) {
            caseInstanceBuilder.businessKey(businessKey);
        }

        if (caseInstanceName != null) {
            caseInstanceBuilder.name(caseInstanceName);
        }

        CaseInstance caseInstance = caseInstanceBuilder.start();
        return caseInstance.getId();
    }

    @Override
    public void handleSignalEvent(EventSubscriptionEntity eventSubscription, Map<String, Object> variables) {
        if (StringUtils.isEmpty(eventSubscription.getSubScopeId())) {
            throw new FlowableException("Plan item instance for " + eventSubscription + " can not be found with empty sub scope id value");
        }
        
        CmmnRuntimeService cmmnRuntimeService = cmmnEngineConfiguration.getCmmnRuntimeService();
        PlanItemInstance planItemInstance = cmmnRuntimeService.createPlanItemInstanceQuery()
                        .planItemInstanceId(eventSubscription.getSubScopeId())
                        .singleResult();
        
        if (planItemInstance == null) {
            throw new FlowableException("Plan item instance for " + eventSubscription + " can not be found with sub scope id " + eventSubscription.getSubScopeId());
        }

        cmmnRuntimeService.createPlanItemInstanceTransitionBuilder(planItemInstance.getId())
            .variables(variables)
            .trigger();
    }

    @Override
    public void deleteCaseInstance(String caseInstanceId) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Ensure the event subscription is created with a subScopeId pointing at the target plan item instance.
  2. Inspect the event subscription record (ACT_RU_EVENT_SUBSCR.SUB_SCOPE_ID_) and correct/recreate it.
  3. If creating subscriptions manually, call setSubScopeId(planItemInstanceId) before storing.
  4. Check for migration scripts from older Flowable versions and backfill empty SUB_SCOPE_ID_ values.

Example fix

// before
EventSubscriptionEntity sub = eventSubscriptionService.createEventSubscription();
sub.setEventType("signal");
// after
EventSubscriptionEntity sub = eventSubscriptionService.createEventSubscription();
sub.setEventType("signal");
sub.setSubScopeId(planItemInstance.getId());
Defensive patterns

Strategy: validation

Validate before calling

public static boolean isSignalable(EventSubscriptionEntity sub) {
    return sub != null && org.apache.commons.lang3.StringUtils.isNotEmpty(sub.getSubScopeId());
}
// before signaling:
if (!isSignalable(sub)) { throw new IllegalArgumentException("Event subscription missing subScopeId"); }

Try / catch

try {
    defaultCaseInstanceService.handleSignalEvent(subscription, variables);
} catch (FlowableException e) {
    if (e.getMessage().contains("empty sub scope id")) {
        logger.error("Event subscription {} has no subScopeId; recreate the subscription", subscription.getId(), e);
    }
    throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/6739a2c1a8eda27f. Report an issue: GitHub.