{"record":{"id":"2e9603d32fe73de8","repo":"flowable/flowable-engine","slug":"cannot-migrate-process-es-not-enough-information","errorCode":null,"errorMessage":"Cannot migrate process(es), not enough information","messagePattern":"Cannot migrate process\\(es\\), not enough information","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/ProcessInstanceMigrationCmd.java","lineNumber":84,"sourceCode":"\n        this.processDefinitionKey = processDefinitionKey;\n        this.processDefinitionVersion = processDefinitionVersion;\n        this.processDefinitionTenantId = processDefinitionTenantId;\n        this.processInstanceMigrationDocument = processInstanceMigrationDocument;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        ProcessInstanceMigrationManager migrationManager = CommandContextUtil.getProcessEngineConfiguration(commandContext).getProcessInstanceMigrationManager();\n\n        if (processInstanceId != null) {\n            migrationManager.migrateProcessInstance(processInstanceId, processInstanceMigrationDocument, commandContext);\n        } else if (processDefinitionId != null) {\n            migrationManager.migrateProcessInstancesOfProcessDefinition(processDefinitionId, processInstanceMigrationDocument, commandContext);\n        } else if (processDefinitionKey != null && processDefinitionVersion >= 0) {\n            migrationManager.migrateProcessInstancesOfProcessDefinition(processDefinitionKey, processDefinitionVersion, processDefinitionTenantId, processInstanceMigrationDocument, commandContext);\n        } else {\n            throw new FlowableException(\"Cannot migrate process(es), not enough information\");\n        }\n        return null;\n    }\n\n}\n","sourceCodeStart":66,"sourceCodeEnd":90,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/ProcessInstanceMigrationCmd.java#L66-L90","documentation":"In ProcessInstanceMigrationCmd.execute, the command migrates either by process instance id, process definition id, or process definition key+version. If none of these selectors is set (all null or version < 0), there is no way to know which process instances to migrate, so the engine throws this exception. It indicates the migration command was constructed without any target selector populated.","triggerScenarios":"Executing a ProcessInstanceMigrationCmd whose processInstanceId, processDefinitionId, and (processDefinitionKey + processDefinitionVersion >= 0) are all unset — e.g. a constructor variant was called with nulls and no later selector was provided, or the document alone was supplied without identifying which instances to migrate.","commonSituations":"Using the internal command API directly and forgetting to set the target; building a custom migration path that only sets the document; key set but version left at its default -1 (key+version branch requires version >= 0); copy-pasted constructor arguments in wrong order.","solutions":["Set a migration target: pass a processInstanceId, or a processDefinitionId, or a processDefinitionKey together with processDefinitionVersion >= 0","Prefer the public API: managementService.createProcessInstanceMigrationBuilder().migrateToProcessDefinition(id) which sets the selector for you","If migrating by key, ensure the version field is a real version number (>= 0), not the default/unset -1"],"exampleFix":"// before\nProcessInstanceMigrationCmd cmd = new ProcessInstanceMigrationCmd(doc); // no selector\n// after\nProcessInstanceMigrationCmd cmd = new ProcessInstanceMigrationCmd(\n    processDefinitionId, doc); // or key + version, or instanceId","handlingStrategy":"validation","validationCode":"boolean hasTarget = processInstanceId != null\n    || processDefinitionId != null\n    || (processDefinitionKey != null && processDefinitionVersion >= 0);\nif (!hasTarget) throw new IllegalArgumentException(\"Set instanceId, definitionId, or key+version\");","typeGuard":"boolean migrationTargetSet(ProcessInstanceMigrationCmd cmd) { return cmd != null; }","tryCatchPattern":"try {\n    cmd.execute(commandContext);\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"not enough information\")) {\n        throw new IllegalStateException(\"Migration target selector missing\", e);\n    }\n    throw e;\n}","preventionTips":["Use the public migration builder API instead of instantiating commands directly","When migrating by key, always set an explicit version >= 0","Unit-test migration setup paths to assert a selector is present"],"tags":["flowable","process-migration","missing-target","configuration"],"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"}