{"record":{"id":"d10478b38ce351b7","repo":"flowable/flowable-engine","slug":"cannot-migrate-case-es-not-enough-information","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/CaseInstanceMigrationBatchCmd.java","lineNumber":76,"sourceCode":"            throw new FlowableException(\"Must specify a case instance migration document to migrate\");\n        }\n        this.caseDefinitionKey = caseDefinitionKey;\n        this.caseDefinitionVersion = caseDefinitionVersion;\n        this.caseDefinitionTenantId = caseDefinitionTenantId;\n        this.caseInstanceMigrationDocument = caseInstanceMigrationDocument;\n        this.cmmnEngineConfiguration = cmmnEngineConfiguration;\n    }\n\n    @Override\n    public Batch execute(CommandContext commandContext) {\n        CaseInstanceMigrationManager migrationManager = cmmnEngineConfiguration.getCaseInstanceMigrationManager();\n\n        if (caseDefinitionId != null) {\n            return migrationManager.batchMigrateCaseInstancesOfCaseDefinition(caseDefinitionId, caseInstanceMigrationDocument, commandContext);\n        } else if (caseDefinitionKey != null && caseDefinitionVersion >= 0) {\n            return migrationManager.batchMigrateCaseInstancesOfCaseDefinition(caseDefinitionKey, caseDefinitionVersion, caseDefinitionTenantId, caseInstanceMigrationDocument, commandContext);\n        } else {\n            throw new FlowableException(\"Cannot migrate case(es), not enough information\");\n        }\n    }\n}\n","sourceCodeStart":58,"sourceCodeEnd":80,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/CaseInstanceMigrationBatchCmd.java#L58-L80","documentation":"CaseInstanceMigrationBatchCmd.execute dispatches to the migration manager based on how the command was constructed: by definition id, or by key+version(+tenant). If neither identification path is available it cannot determine which instances to migrate and throws this message.","triggerScenarios":"The command object was built such that caseDefinitionId == null and (caseDefinitionKey == null || caseDefinitionVersion < 0), then execute(commandContext) is run — possible when subclasses or reflective construction skip all constructor validations.","commonSituations":"CaseInstanceMigrationBuilder misconfiguration where neither id nor key/version was set before calling batchMigrateCaseInstances; reflection/deserialization bypassing constructor checks.","solutions":["Construct the command through CaseInstanceMigrationBuilder and call withTargetCaseDefinitionId(...) or withTargetCaseDefinitionKey/Version before migrating","Verify caseDefinitionVersion is set to a non-negative value when using key-based construction","If you have the id, prefer the id-based constructor so execute's first branch is taken"],"exampleFix":"// before\ncmmnEngineConfig.getCommandExecutor().execute(new CaseInstanceMigrationBatchCmd()); // no identifiers set\n// after\ncmmnEngineConfig.getCaseInstanceMigrationService().createCaseInstanceMigrationBuilder()\n    .withTargetCaseDefinitionId(definitionId)\n    .batchMigrateCaseInstances(document);","handlingStrategy":"validation","validationCode":"if (caseDefinitionId == null && (caseDefinitionKey == null || caseDefinitionVersion < 0)) {\n    throw new IllegalArgumentException(\"Provide target case definition id or key+version for batch migration\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    command.execute(commandContext);\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"not enough information\")) {\n        // rebuild the command with a target definition id or key+version\n    }\n    throw e;\n}","preventionTips":["Always construct the command via CaseInstanceMigrationBuilder which enforces target selection","Never construct or reflectively instantiate the command without an identifier path","Verify version is a non-negative integer when using key-based construction"],"tags":["cmmn","migration","unconfigured-command","missing-identifier"],"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"}