Execute Migration Plan Async (Batch)

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 and asynchronous execution of a migration plan, please refer to the related section 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.
instructions A list of migration instructions which map equal activities. Each migration instruction is a JSON object with the following properties:
Name Type 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.
variables A map of variables which will be set into the process instances' scope. Each key is a variable name and each value a JSON variable value object with the following properties:

Name Description
value The variable's value. For variables of type Object, the serialized value has to be submitted as a String value.

For variables of type File the value has to be submitted as Base64 encoded string.

type The value type of the variable.
valueInfo A JSON object containing additional, value-type-dependent properties.

For serialized variables of type Object, the following properties can be provided:

  • objectTypeName: A string representation of the object's type name.
  • serializationDataFormat: The serialization format used to store the variable.

For serialized variables of type File, the following properties can be provided:

  • filename: The name of the file. This is not the variable name but the name that will be used when downloading the file again.
  • mimetype: The MIME type of the file that is being uploaded.
  • encoding: The encoding of the file that is being uploaded.

Result

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

Name Type Description
id String The id of the batch.
type String The type of the batch. See the User Guide for more information about batch types.
totalJobs Number The total jobs of a batch is the number of batch execution jobs required to complete the batch.
jobsCreated Number The number of batch execution jobs already created by the seed job.
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.
suspended Boolean Indicates whether this batch is suspended or not.
tenantId String The tenant id of the batch.
createUserId String The id of the user that created the batch.
startTime String The time the batch was started. Default format* yyyy-MM-dd'T'HH:mm:ss.SSSZ.
executionStartTime String The time the batch execution was started, i.e., at least one batch job has been executed. Default format* yyyy-MM-dd'T'HH:mm:ss.SSSZ.
* For further information, please see the documentation.

Response codes

Code Media type Description
200 application/json Request successful.
400 application/json Invalid variable value, for example if the value could not be parsed to an Integer value or the passed variable type is not supported. See the Introduction for the error response format.
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:

{
  "migrationPlan": {
    "sourceProcessDefinitionId": "aProcessDefinitionId1",
    "targetProcessDefinitionId": "aProcessDefinitionId2",
    "instructions": [
      {
        "sourceActivityIds": ["aUserTask"],
        "targetActivityIds": ["aUserTask"]
      },
      {
        "sourceActivityIds": ["anEvent"],
        "targetActivityIds": ["anotherEvent"],
        "updateEventTrigger": true
      }
    ],
    "variables": {
      "foo": {
        "type": "Object",
        "value": "[5,9]",
        "valueInfo": {
          "objectTypeName": "java.util.ArrayList",
          "serializationDataFormat": "application/json"
        }
      }
    }
  },
  "processInstanceIds": [
    "aProcessInstance",
    "anotherProcessInstance"
  ],
  "processInstanceQuery": {
    "processDefinitionId": "aProcessDefinitionId1"
  },
  "skipCustomListeners": true
}

Response

Status 200.

{
  "id": "aBatchId",
  "type": "aBatchType",
  "totalJobs": 10,
  "batchJobsPerSeed": 100,
  "invocationsPerBatchJob": 1,
  "seedJobDefinitionId": "aSeedJobDefinitionId",
  "monitorJobDefinitionId": "aMonitorJobDefinitionId",
  "batchJobDefinitionId": "aBatchJobDefinitionId",
  "tenantId": "aTenantId"
}

On this Page: