{"record":{"id":"b2850dcb36b82026","repo":"flowable/flowable-engine","slug":"the-case-definition-must-be-provided-using-the-exa-b2850d","errorCode":null,"errorMessage":"The case definition must be provided using the exact id of the version the subscription was registered for.","messagePattern":"The case definition must be provided using the exact id of the version the subscription was registered for\\.","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceStartEventSubscriptionModificationBuilderImpl.java","lineNumber":101,"sourceCode":"        return correlationParameterValues;\n    }\n\n    @Override\n    public void migrateToLatestCaseDefinition() {\n        checkValidInformation();\n        cmmnRuntimeService.migrateCaseInstanceStartEventSubscriptionsToCaseDefinitionVersion(this);\n    }\n\n    @Override\n    public void migrateToCaseDefinition(String caseDefinitionId) {\n        this.newCaseDefinitionId = caseDefinitionId;\n        checkValidInformation();\n        cmmnRuntimeService.migrateCaseInstanceStartEventSubscriptionsToCaseDefinitionVersion(this);\n    }\n\n    protected void checkValidInformation() {\n        if (StringUtils.isEmpty(caseDefinitionId)) {\n            throw new FlowableIllegalArgumentException(\"The case definition must be provided using the exact id of the version the subscription was registered for.\");\n        }\n    }\n}\n","sourceCodeStart":83,"sourceCodeEnd":105,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceStartEventSubscriptionModificationBuilderImpl.java#L83-L105","documentation":"CaseInstanceStartEventSubscriptionModificationBuilderImpl.checkValidInformation() requires a caseDefinitionId before migrating subscriptions (migrateToLatestCaseDefinition or migrateToCaseDefinition). Migration targets a concrete definition version, identified by its exact id; a null/empty id throws FlowableIllegalArgumentException.","triggerScenarios":"Calling migrateToLatestCaseDefinition() or migrateToCaseDefinition() on the modification builder without having called caseDefinitionId(String), or with an empty string.","commonSituations":"Setting the key instead of the id (registration builder uses key, modification builder needs id); id lookup returning null because the definition was undeployed; upgrading Flowable versions and copying old builder code incorrectly.","solutions":["Call caseDefinitionId(...) with the exact deployed definition id before migrating","Resolve the id from the repository service (caseDefinitionQuery by key/latestVersion) and null-check it","Confirm the definition is deployed and its id is the full id (key:version:guid), not just the key"],"exampleFix":"// before\nruntimeService.createCaseInstanceStartEventSubscriptionModificationBuilder()\n    .migrateToLatestCaseDefinition(); // caseDefinitionId never set\n// after\nString id = repositoryService.createCaseDefinitionQuery()\n    .caseDefinitionKey(\"myCase\").latestVersion().singleResult().getId();\nruntimeService.createCaseInstanceStartEventSubscriptionModificationBuilder()\n    .caseDefinitionId(id)\n    .migrateToLatestCaseDefinition();","handlingStrategy":"validation","validationCode":"String id = repo.createCaseDefinitionQuery().caseDefinitionKey(key).latestVersion().singleResult().getId(); if (id == null) throw new IllegalStateException(\"id unresolved\");","typeGuard":"boolean hasText(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try { modificationBuilder.migrateToLatestCaseDefinition(); } catch (FlowableIllegalArgumentException e) { log.error(\"caseDefinitionId required: {}\", e.getMessage()); }","preventionTips":["Always call caseDefinitionId before migrateToLatestCaseDefinition/migrateToCaseDefinition","Cache definition ids per key/version to avoid repeated lookups","Re-resolve ids after redeployments since ids change per version"],"tags":["flowable","cmmn","event-subscription","migration","validation"],"backgroundTag":"missing-required-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"}