{"record":{"id":"3a5961b3a7dd7c00","repo":"flowable/flowable-engine","slug":"the-case-definition-with-id","errorCode":null,"errorMessage":"The case definition with id ","messagePattern":"The case definition with id ","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/RegisterCaseInstanceStartEventSubscriptionCmd.java","lineNumber":65,"sourceCode":"\n    @Override\n    public EventSubscription execute(CommandContext commandContext) {\n        CaseDefinition caseDefinition = getLatestCaseDefinitionByKey(builder.getCaseDefinitionKey(), builder.getTenantId(), commandContext);\n        Case caze = getCase(caseDefinition.getId(), commandContext);\n\n        EventSubscription eventSubscription = null;\n        String eventDefinitionKey = caze.getStartEventType();\n        String startCorrelationConfiguration = getStartCorrelationConfiguration(caseDefinition.getId(), commandContext);\n\n        if (eventDefinitionKey != null && Objects.equals(startCorrelationConfiguration, CmmnXmlConstants.START_EVENT_CORRELATION_MANUAL)) {\n            String correlationKey = generateCorrelationConfiguration(eventDefinitionKey, builder.getTenantId(), builder.getCorrelationParameterValues(), commandContext);\n\n            eventSubscription = insertEventRegistryEvent(eventDefinitionKey, builder.isDoNotUpdateToLatestVersionAutomatically(), caseDefinition,\n                correlationKey, commandContext);\n        }\n\n        if (eventSubscription == null) {\n            throw new FlowableIllegalArgumentException(\"The case definition with id '\" + caseDefinition.getId()\n                + \"' does not have an event-registry based start event with a manual subscription behavior.\");\n        }\n\n        return eventSubscription;\n    }\n\n    protected EventSubscription insertEventRegistryEvent(String eventDefinitionKey, boolean doNotUpdateToLatestVersionAutomatically,\n        CaseDefinition caseDefinition, String correlationKey, CommandContext commandContext) {\n        \n        CmmnEngineConfiguration caseEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);\n        EventSubscriptionService eventSubscriptionService = caseEngineConfiguration.getEventSubscriptionServiceConfiguration().getEventSubscriptionService();\n        EventSubscriptionBuilder eventSubscriptionBuilder = eventSubscriptionService.createEventSubscriptionBuilder()\n                .eventType(eventDefinitionKey)\n                .scopeDefinitionId(caseDefinition.getId())\n                .scopeType(ScopeTypes.CMMN)\n                .configuration(correlationKey);\n\n        if (caseDefinition.getTenantId() != null) {","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/RegisterCaseInstanceStartEventSubscriptionCmd.java#L47-L83","documentation":"Thrown as FlowableIllegalArgumentException when registering a start-event subscription for a case definition that has no event-registry based start event with 'manual' subscription behavior, so the resolved eventSubscription ends up null. The command requires an event-registry start event configured with EventSubscriptionServiceBehavior.MANUAL.","triggerScenarios":"Calling CmmnRuntimeService.createCaseInstanceStartEventSubscriptionBuilder(...) / registerCaseInstanceStartEventSubscription for a case definition whose start event either is not event-registry based or has a different (non-manual) subscription behavior.","commonSituations":"Misconfigured CMMN: start event missing the event-registry binding; subscription behavior set to automatic/default instead of manual; passing the wrong case definition that has no event start event at all.","solutions":["Confirm the case definition's start event is an event-registry start event with flowable:eventSubscriptionServiceBehavior=\"manual\" in the CMMN XML","Point the builder at the correct case definition id that actually contains the manual event start event","If automatic subscription is intended, rely on automatic subscription instead of the manual registration command"],"exampleFix":"// before\n<startEvent id=\"start\">\n  <extensionElements>\n    <flowable:eventRegistryEventDefinition eventDefinitionKey=\"orderArrived\" />\n  </extensionElements>\n</startEvent>\n// after\n<flowable:eventRegistryEventDefinition eventDefinitionKey=\"orderArrived\"\n    flowable:eventSubscriptionServiceBehavior=\"manual\" />","handlingStrategy":"validation","validationCode":"// ensure the start event is event-registry based with manual behavior in the CMMN XML\n// <flowable:eventRegistryEventDefinition eventDefinitionKey=\"...\" eventSubscriptionServiceBehavior=\"manual\"/>","typeGuard":null,"tryCatchPattern":"try { runtimeService.registerCaseInstanceStartEventSubscription(...); }\ncatch (FlowableIllegalArgumentException e) { /* case definition lacks manual event-registry start event */ }","preventionTips":["Configure the start event with eventSubscriptionServiceBehavior=manual when using manual subscriptions","Target the correct case definition id","Document that only event-registry start events support this API"],"tags":["cmmn","event-registry","subscription","configuration"],"backgroundTag":"invalid-config-value","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"}