Migrate Process Instance

API Type

REST

HTTP Method

POST

Description

Migrates process instances from one version to another version (called process migration).

Good to Know

  • It is required to provide Migration instruction with details of a list of activities.
  • It is required to suspend a process instance before migrating.
  • To call this method, the API account user must have the access right, Cancel a Process.
  • Once the migration is successful, it is required to call the method Suspend and Resume a Process, so that the process instance resumes with the newer version.
  • This method is provided for reference for very advanced users — mainly internal AgilePoint teams. If you need help with this method, contact AgilePoint Professional Services.

URL Format (OnPremises, Private Cloud)

https://[domain]:[port]/AgilePointServer/Workflow/MigrateProcInst/[processInstanceID]/[reserved]​

URL Format (OnDemand)

https://[domain]:[port]/AgilePointService/Workflow/MigrateProcInst/[processInstanceID]/[reserved]​

Request Parameters

NameDescription

processInstanceID

Function:
Specifies the unique ID of a process instance.
Type
string
Accepted Values:
A valid process instance ID

reserved

Function:
Reserved for future use.
Type
string
Accepted Values:
The literal string null.

You must pass this as a literal string at this time. This field will be used for other purposes in a later release.

Request Body Properties

NameDescription

instruction

Function:
Specifies the instructions for migrating a process to a new version.
Type
WFProcessMigrationInstruction
Accepted Values:
A WFProcessMigrationInstruction object.

IncludeXmlData

Function:
Specifies whether a migration includes XML data.
Type
bool
Accepted Values:
  • True - The migration includes an XML data.
  • False - The migration does not include an XML data.

Action

Function:
Specifies the migration action.
Type
MigrationAction
Accepted Values:
A valid migration action.

MatchingActivityDefinition

Function:
Specifies information for activity migration.
Type
class
Accepted Values:
A valid class.

SourceProcessDefinitionID

Function:
The ID of the original, or source, process definition.
Type
string
Accepted Values:
A valid process definition ID.

TargetProcessDefinitionID

Function:
The ID of the target, or destination, process definition.
Type
string
Accepted Values:
A valid process definition ID.

JavaScript Code Example

$("#btnMigrateProcInst").click(function () {
  
 var JSONData = {"Action":"0",
    "IncludeXmlData":true,
    "MatchingActivityDefinitions":[{"CurrentActivated":true,
    "SourceName":"Manual.17",
    "TargetName":"Manual.17"},					       
    {"CurrentActivated":false,
    "SourceName":"MultipleCondition.26",
    "TargetName":"MultipleCondition.26"},
    {"CurrentActivated":false,
    "SourceName":"Manual.31",
    "TargetName":"Manual.31"},
    {"CurrentActivated":false,
    "SourceName":"Manual.63",
    "TargetName":"Manual.63"},							       
    {"CurrentActivated":false,
    "SourceName":"Email.72",
    "TargetName":"Email.72"}],
    "SourceProcessDefinitionID":"ABCCD0E07357412499AD79D58D596397",
    "TargetProcessDefinitionID":"CA204B2F3C894F058E3AEC22CA46F605"};
 
  $.ajax({
    url: 'https://mydomain:9011/AgilePointServer/Workflow/
                        MigrateProcInst/524DFF231F0547198D1D48C5EF25EF4A/null',
    dataType: "text",
    data: JSON.stringify(JSONData)
  });

});

Java Code Example

public void MigrateProcInst(){
  String URI = "https://mydomain:9011/AgilePointServer/Workflow/MigrateProcInst";
  HTTPOperations ops = new HTTPOperations(domain, userName, 
                       password, appID, locale);
		
  JSONObject postData = new JSONObject();
  
			
    JSONObject activityDefinition1 = new JSONObject();
    activityDefinition1.put("CurrentActivated", "true");
    activityDefinition1.put("SourceName", "Manual.17");
    activityDefinition1.put("TargetName", "Manual.17");
    JSONObject activityDefinition2 = new JSONObject();
    activityDefinition2.put("CurrentActivated", "false");
    activityDefinition2.put("SourceName", "MultipleCondition.26");
    activityDefinition2.put("TargetName", "MultipleCondition.26");
    JSONObject activityDefinition3 = new JSONObject();
    activityDefinition3.put("CurrentActivated", "false");
    activityDefinition3.put("SourceName", "MultipleCondition.26");
    activityDefinition3.put("TargetName", "MultipleCondition.26");
    JSONObject activityDefinition4 = new JSONObject();
    activityDefinition4.put("CurrentActivated", "false");
    activityDefinition4.put("SourceName", "MultipleCondition.26");
    activityDefinition4.put("TargetName", "MultipleCondition.26");
    
    JSONArray activityDefinition = new JSONArray();
    activityDefinition.put(activityDefinition1);
    activityDefinition.put(activityDefinition2);
    activityDefinition.put(activityDefinition3);
    activityDefinition.put(activityDefinition4);
			
    postData.put("Action", "0");
    postData.put("IncludeXmlData","true");
    postData.put("MatchingActivityDefinitions", activityDefinition);
    postData.put("SourceProcessDefinitionID", "ABCCD0E07357412499AD79D58D596397");
    postData.put("TargetProcessDefinitionID", "CA204B2F3C894F058E3AEC22CA46F605");
			
    ops.POSTMethod(URI, postData.toString());
  
}

C# Code Example

public string MigrateProcInst()
  {
    string URL = "https://mydomain:9011/AgilePointServer/Workflow/
                  MigrateProcInst/524DFF231F0547198D1D48C5EF25EF4A/null";

    string jsonRequestdata = "{
      \"Action\":0,
      \"IncludeXmlData\":true,
      \"MatchingActivityDefinitions\":[{\"CurrentActivated\":true,
      \"SourceName\":\"Manual.17\",
      \"TargetName\":\"Manual.17\"}],
      \"SourceProcessDefinitionID\":\"ABCCD0E07357412499AD79D58D596397\",
      \"TargetProcessDefinitionID\":\"CA204B2F3C894F058E3AEC22CA46F605\"}";

    HTTPOperations ops = new HTTPOperations(domain, this.userName, 
                         password, appID, locale);

    return ops.POSTMethod(URL, jsonRequestdata);

  }

Output

None.

JSON Response Body Example

The response body is empty.

Supported Versions

AgilePoint v5.0 R2 and higher

Code Examples in the AgilePoint NX Documentation

The AgilePoint NX Product Documentation is intended as a basic reference to help you understand how to complete basic coding tasks, such as make API or JavaScript method calls. Code examples that show specific use cases, the solutions to specific business problems, or detailed implementation scenarios are outside the scope of the AgilePoint NX Product Documentation. For specific and/or advanced types of examples that may better meet your requirements, AgilePoint provides several resources:

  • AgilePoint Community Forums - A free, AgilePoint-moderated, crowd-sourcing user forum where you can ask questions about specific techniques, the solutions to use cases, workarounds, or other topics that may not be covered in the Product Documentation.
  • Professional Services - If you can not find the information you need for your specific business problem, mentoring is available through AgilePoint Professional Services.
  • Personalized Training - AgilePoint can provide personalized training for your organization. To request personalized training, contact AgilePoint Sales.