Executes a migration plan asynchronously (batch) for multiple process instances.To execute a migration plan synchronously, use the Execute Migration Plan method.

For more information about the difference between synchronous andasynchronous execution of a migration plan, please refer to the relatedsection of the user guide.

Method

POST /migration/executeAsync

Parameters

Request Body

A JSON object with the following properties:

Name Description
migrationPlan The migration plan to execute. A JSON object corresponding to the migration plan interface in the engine as explained below.
processInstanceIds A list of process instance ids to migrate.
processInstanceQuery A process instance query like the request body described by POST /process-instance .
skipCustomListeners A boolean value to control whether execution listeners should be invoked during migration.
skipIoMappings A boolean value to control whether input/output mappings should be executed during migration.

The migration plan JSON object has the following properties:

Name Description
sourceProcessDefinitionId The id of the source process definition for the migration.
targetProcessDefinitionId The id of the target process definition for the migration.
Name Value Description
——-
instructions A list of migration instructions which map equal activities. Each migration instruction is a JSON object with the following properties:

NameValueDescription
sourceActivityIdsArrayThe activity ids from the source process definition being mapped.
targetActivityIdsArrayThe activity ids from the target process definition being mapped.
updateEventTriggerBoolean Configuration flag whether event triggers defined are going to be update during migration.

|sourceActivityIds|Array|The activity ids from the source process definition being mapped.|targetActivityIds|Array|The activity ids from the target process definition being mapped.|updateEventTrigger|Boolean| Configuration flag whether event triggers defined are going to be update during migration.
|Name|Value|Description
|——-
|sourceActivityIds|Array|The activity ids from the source process definition being mapped.
|targetActivityIds|Array|The activity ids from the target process definition being mapped.
|updateEventTrigger|Boolean| Configuration flag whether event triggers defined are going to be update during migration.

Result

A JSON object corresponding to the Batch interface in the engine. Itsproperties are as follows:

Name Value Description
id String The id of the created batch.
type String The type of the created batch.
totalJobs Number The total jobs of a batch is the number of batch execution jobs required to complete the batch.
batchJobsPerSeed Number The number of batch execution jobs created per seed job invocation. The batch seed job is invoked until it has created all batch execution jobs required by the batch (see totalJobs property).
invocationsPerBatchJob Number Every batch execution job invokes the command executed by the batch invocationsPerBatchJob times. E.g., for a process instance migration batch this specifies the number of process instances which are migrated per batch execution job.
seedJobDefinitionId String The job definition id for the seed jobs of this batch.
monitorJobDefinitionId String The job definition id for the monitor jobs of this batch.
batchJobDefinitionId String The job definition id for the batch execution jobs of this batch.
tenantId String The tenant id of the batch.

Response codes

Code Media type Description
200 application/json Request successful.
400 application/json The provided migration plan is not valid, so an exception of type MigrationPlanValidationException is returned. See the Introduction for the error response format.
400 application/json In case additional parameters of the request are unexpected, an exception of type InvalidRequestException is returned. See the Introduction for the error response format.

Example

Request

POST /migration/executeAsync

Request Body:

  1. {
  2. "migrationPlan": {
  3. "sourceProcessDefinitionId": "aProcessDefinitionId1",
  4. "targetProcessDefinitionId": "aProcessDefinitionId2",
  5. "instructions": [
  6. {
  7. "sourceActivityIds": ["aUserTask"],
  8. "targetActivityIds": ["aUserTask"]
  9. },
  10. {
  11. "sourceActivityIds": ["anEvent"],
  12. "targetActivityIds": ["anotherEvent"],
  13. "updateEventTrigger": true
  14. }
  15. ]
  16. },
  17. "processInstanceIds": [
  18. "aProcessInstance",
  19. "anotherProcessInstance"
  20. ],
  21. "processInstanceQuery": {
  22. "processDefinitionId": "aProcessDefinitionId1"
  23. },
  24. "skipCustomListeners": true
  25. }

Response

Status 200.

  1. {
  2. "id": "aBatchId",
  3. "type": "aBatchType",
  4. "totalJobs": 10,
  5. "batchJobsPerSeed": 100,
  6. "invocationsPerBatchJob": 1,
  7. "seedJobDefinitionId": "aSeedJobDefinitionId",
  8. "monitorJobDefinitionId": "aMonitorJobDefinitionId",
  9. "batchJobDefinitionId": "aBatchJobDefinitionId",
  10. "tenantId": "aTenantId"
  11. }

原文: https://docs.camunda.org/manual/7.9/reference/rest/migration/execute-migration-async/