Migrating BPEL process instances in bulk to a new version of a process template

Use an administrative script to migrate running instances after deploying a new version of a process template, because new process instances are based on the new version, but existing instances based on the old template version continue running until they reach an end state.

Before you begin

The following conditions must be met:

About this task

Use the migrateProcessInstances.py script to migrate instances of a specific process template version to the latest version, or a specified version. Instances that are in an end state (finished, terminated, compensated, or failed) are not migrated. Only instances of the specified template with the same version as the specified "valid from" value are migrated. If you prefer to write a script to migrate instances, an MBean interface is available.

Procedure

  1. Change to the Business Process Choreographer subdirectory where the administrative script is located. This topic applies only to the z/OS platformEnter the following command: This topic applies only to the z/OS platform
    cd install_root/ProcessChoreographer/admin
    This topic applies only to the Distributed platformsFor Linux operating systemFor UNIX operating systemEnter the following command:
    cd install_root/ProcessChoreographer/admin
    This topic applies only to the Distributed platformsFor Windows operating systemEnter the following command:
    cd install_root\ProcessChoreographer\admin
  2. Migrate the instances of process templates that are no longer valid. This topic applies only to the z/OS platformEnter the following command: This topic applies only to the z/OS platform
    install_root/bin/wsadmin.sh -f migrateProcessInstances.py
           [([-node node_name] -server server_name ) | ( -cluster cluster_name )]
           ( -templateName template_name) 
           (-sourceValidFromUTC timestamp ) 
           [(-targetValidFromUTC timestamp )]
           [(-slice slice_size

    This topic applies only to the Distributed platformsFor Linux operating systemFor UNIX operating systemEnter the following command:

    This topic applies only to the Distributed platforms
    install_root/bin/wsadmin.sh -f migrateProcessInstances.py
           [([-node node_name] -server server_name ) | ( -cluster cluster_name )]
           ( -templateName template_name) 
           (-sourceValidFromUTC timestamp ) 
           [(-targetValidFromUTC timestamp )]
           [(-slice slice_size

    This topic applies only to the Distributed platformsFor Windows operating systemEnter the following command:

    This topic applies only to the Distributed platforms
    install_root\bin\wsadmin -f migrateProcessInstances.py
           [([-node node_name] -server server_name ) | ( -cluster cluster_name )]
           ( -templateName template_name) 
           (-sourceValidFromUTC timestamp ) 
           [(-targetValidFromUTC timestamp )]
           [(-slice slice_size

    Where:

    -node nodeName
    The name of the node where Business Process Choreographer is configured. This is optional when specifying the server name. The default is the local node.
    -server serverName
    The name of the server where Business Process Choreographer is configured. This is required if a cluster is not specified.
    -cluster clusterName
    The name of the cluster where Business Process Choreographer is configured. This is required if Business Process Choreographer is configured on a cluster.
    -templateName template_name
    The name of the process template to be migrated.
    -sourceValidFromUTC timestamp
    The timestamp specifies which version of the named template will have its instances migrated.

    The timestamp string specifies the date from which the template is valid, in Coordinated Universal Time (UTC), and must have the following format: 'yyyy-mm-ddThh:mm:ss' (year, month, day, T, hours, minutes, seconds). For example, 2009-01-31T13:40:50. In the administrative console this date is displayed in local time of the server, so make sure that you take the server time zone into account.

    -targetValidFromUTC timestamp
    This optionally specifies which version of the named process template the instances will be migrated to. If this parameter is not specified, the latest available version of the template will be used. The timestamp string has the same format as for the sourceValidFromUTC parameter.
    -slice slice_size
    This parameter is optional. The value slice_size specifies how many process instances are migrated in one transaction. The default value is 10.
  3. When the script runs, it outputs the name of the node and server where the migration is running. Check the SystemOut.log file on the server to see the progress information and whether the migration of any instances caused any exceptions. For example, because instances are not in a suitable state or because a problem occurred during migration.

Results

The instances have been migrated to the new template version.