Process definition 'test:4:334d06d6-f4b3-11e9-aa4f-507b9dc4ed46' does not match the source process definition of the migration plan 'test:2:b141bdfb-f499-11e9-aa4f-507b9dc4ed46'

I was getting below exception when i migrate process instances asynchronously.Why this exception occurs?

org.camunda.bpm.engine.ProcessEngineException: ENGINE-23002 Process instance '324df001-e112-11e9-8965-507b9dc4ed46' cannot be migrated. Its process definition 'test:4:334d06d6-f4b3-11e9-aa4f-507b9dc4ed46' does not match the source process definition of the migration plan 'test:2:b141bdfb-f499-11e9-aa4f-507b9dc4ed46'
	at org.camunda.bpm.engine.impl.migration.MigrationLogger.processDefinitionOfInstanceDoesNotMatchMigrationPlan(MigrationLogger.java:49)
	at org.camunda.bpm.engine.impl.migration.MigrateProcessInstanceCmd.ensureSameProcessDefinition(MigrateProcessInstanceCmd.java:327)
	at org.camunda.bpm.engine.impl.migration.MigrateProcessInstanceCmd.migrateProcessInstance(MigrateProcessInstanceCmd.java:132)

With a MigrationPlan, you specify the source and target definition. If you then supply a query or set of process instances that are not actually in the definition of the source of the MigrationPlan, this exception will happen. When you query for process instances to migrate, make sure to include the processdefinition id of the MigrationPlan’s source as a query param.

when i validate the migration plan, i got the below response.

{"instructionReports":[]}

When there’s no failures, it will look like above response?

As per docs,

{
  "instructionReports": [
    {
      "instruction": {
        "sourceActivityIds": [
          "aUserTask"
        ],
        "targetActivityIds": [
          "aUserTask"
        ],
        "updateEventTrigger": false
      },
      "failures": [
        "failure1",
        "failure2"
      ]
    },
    {
      "instruction": {
        "sourceActivityIds": [
          "anEvent"
        ],
        "targetActivityIds": [
          "anotherEvent"
        ],
        "updateEventTrigger": true
      },
      "failures": [
        "failure1",
        "failure2"
      ]
    }
  ]
}

This response is only when i have failures right?

The error you’re getting is, I believe, not a validation error on the plan itself. Validation of the plan is mainly to do with the instructions you provided, to see whether the mappings you created make functional sense.

When executing the plan against a set of process instances, you could get the error you have because you’re trying to migrate a process that actually runs against a different definition than the migration setup you have in your plan. In other words, from the engine’s point of view, the instructions you supplied in the plan don’t relate to the process definition of your instance, so they might not work and therefore result in an error.

That error i got because the source process definition doesn’t have any active process instances. I solved it. So if migration plan validation is success then the response is empty like below?

{"instructionReports":[]}

That’s what I would expect from the docs, yes: https://docs.camunda.org/manual/latest/reference/rest/migration/validate-migration-plan/#result

I don’t use the REST API much, but I believe that’s what you should expect.

Yeah thats correct. I missed the below line while reading.

A JSON object which contains a list of instruction reports if any errors are detected, other wise it is empty.

Thanks @tiesebarrell

1 Like

That’s the part I went by, too :slight_smile: HTH

1 Like