{"record":{"id":"9b6eae233567097b","repo":"flowable/flowable-engine","slug":"cannot-migrate-case-es-not-enough-information-9b6eae","errorCode":null,"errorMessage":"Cannot migrate case(es), not enough information","messagePattern":"Cannot migrate case\\(es\\), not enough information","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/HistoricCaseInstanceMigrationCmd.java","lineNumber":96,"sourceCode":"        this.caseDefinitionVersion = caseDefinitionVersion;\n        this.caseDefinitionTenantId = caseDefinitionTenantId;\n        this.historicCaseInstanceMigrationDocument = historicCaseInstanceMigrationDocument;\n        this.cmmnEngineConfiguration = cmmnEngineConfiguration;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        CaseInstanceMigrationManager migrationManager = cmmnEngineConfiguration.getCaseInstanceMigrationManager();\n\n        if (caseInstanceId != null) {\n            migrationManager.migrateHistoricCaseInstance(caseInstanceId, historicCaseInstanceMigrationDocument, commandContext);\n        } else if (caseDefinitionId != null) {\n            migrationManager.migrateHistoricCaseInstancesOfCaseDefinition(caseDefinitionId, historicCaseInstanceMigrationDocument, commandContext);\n        } else if (caseDefinitionKey != null && caseDefinitionVersion >= 0) {\n            migrationManager.migrateHistoricCaseInstancesOfCaseDefinition(caseDefinitionKey, caseDefinitionVersion, \n                    caseDefinitionTenantId, historicCaseInstanceMigrationDocument, commandContext);\n        } else {\n            throw new FlowableException(\"Cannot migrate case(es), not enough information\");\n        }\n        return null;\n    }\n}\n","sourceCodeStart":78,"sourceCodeEnd":101,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/HistoricCaseInstanceMigrationCmd.java#L78-L101","documentation":"HistoricCaseInstanceMigrationCmd.execute() dispatches the migration in three modes: by case definition id, or by key plus version (>=0), or otherwise fails. This FlowableException is thrown in the else branch when none of those combinations identify a source case definition, meaning the command was constructed without enough identifying information.","triggerScenarios":"Executing the migration command when caseDefinitionId is null AND (caseDefinitionKey is null OR caseDefinitionVersion < 0) — e.g. a key was set but version was left unset (stays -1), or only the tenant/document were provided.","commonSituations":"Builders where setToCaseDefinitionVersion() was never called so version remains -1; mixing migration modes and assuming the engine can default to the latest version; hand-constructed commands missing the id field.","solutions":["Set both the case definition key AND version (>=0) on the migration builder/command","Alternatively provide an explicit case definition id so the first dispatch branch is used","Log/inspect the builder state before execute() to confirm one of the valid identifier combinations is present"],"exampleFix":"// before\nbuilder.migrate(\"myCaseDef\"); // no version set -> version == -1\n// after\nbuilder.migrate(\"myCaseDef\", 2); // key + version\n","handlingStrategy":"validation","validationCode":"boolean enough = caseDefinitionId != null || (caseDefinitionKey != null && caseDefinitionVersion >= 0); if (!enough) throw new IllegalArgumentException(\"Provide case definition id, or key plus version\");","typeGuard":null,"tryCatchPattern":"try { cmmnMigrationService.migrate(...); } catch (FlowableException e) { if (e.getMessage().contains(\"not enough information\")) { /* complete builder params and retry */ } }","preventionTips":["Always set key AND version together when not using a definition id","Inspect builder state before execute() (assert one valid identifier combo)","Use HistoricCaseInstanceMigrationBuilder instead of raw commands so defaults are enforced"],"tags":["flowable","cmmn","missing-identifier","case-migration"],"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-18T11:17:12.947Z"}