Merge Process Instances

API Type

REST

HTTP Method

POST

Description

Merges 2 or more process instances into one process instance.

These process instances should be based on the same process definition.

URL Format (On Premises)

https://[domain]:[port]/AgilePointServer/Workflow/MergeProcInsts

URL Format (AgilePoint for Azure)

https://[domain]:[port]/AgilePointService/Workflow/MergeProcInsts

Request Parameters

Name Description
None Not Applicable

Request Body Properties

Name Description

instruction

Definition:
Specifies the instructions for merging two process instances.
Type
WFProcessMergingInstruction
Allowed Values:
A WFProcessMergingInstruction object.

JavaScript Code Example

$("#btnMergeProcInsts").click(function () {
                 
  var JSONObject =  {
    MergedProcessInstance:{
    CustomAttributes:[{
    Name:"/pd:myFields/pd:username",
    Value:"Administrator"
    },
    {
    Name:"/pd:myFields/pd:dept",
    Value:"IT Admin"
    } 
    ],
    ProcessInstanceID:"008493358D1A419EA7094B7A3A58929D",
    ProcessInstanceName:"ProcessMapApproval-008493358D1A419EA7094B7A3A58929D",
    WorkObjectID:"00777ED0FE3E4AB49C44E7E5EDAA9656",
    WorkObjectInfo:"00777ED0FE3E4AB49C44E7E5EDAA9656t"
    },
    MergingProcessInstanceIDs:["060404057EC543A48C16FEC3F7FF8374","061761ADBEA2450A8F70538C495D9773"]
    };                 
  $.ajax({
    url: "https://mydomain:9011/AgilePointServer/Workflow/MergeProcInsts",
    data: JSON.stringify(JSONObject),
                      
});

});

Java Code Example

public String MergeProcInsts(){
  String URI = "https://mydomain:9011/AgilePointServer/Workflow/MergeProcInsts";
  HTTPOperations ops = new HTTPOperations(domain, userName, 
                       password, appID, locale);
		
  JSONObject postData = new JSONObject();
  
			
    JSONObject customAttribute1 = new JSONObject();
    customAttribute1.put("Name", "/pd:myFields/pd:username");
    customAttribute1.put("Value", "Administrator");
    JSONObject customAttribute2 = new JSONObject();
    customAttribute2.put("Name", "/pd:myFields/pd:dept");
    customAttribute2.put("Value", "IT Admin");
			
    JSONArray customAttributes = new JSONArray();
    customAttributes.put(customAttribute1);
			
    JSONObject newProcInstanceInfo = new JSONObject();
    newProcInstanceInfo.put("CustomAttributes", customAttributes);
    newProcInstanceInfo.put("ProcessInstanceName", 
      "ProcessMapApproval-008493358D1A419EA7094B7A3A58929D");
    newProcInstanceInfo.put("WorkObjectID", "00777ED0FE3E4AB49C44E7E5EDAA9656");
    newProcInstanceInfo.put("WorkObjectInfo", "00777ED0FE3E4AB49C44E7E5EDAA9656");
			
    JSONArray mergingProcessInstanceIDs = new JSONArray();
    mergingProcessInstanceIDs.put("060404057EC543A48C16FEC3F7FF8374");
    mergingProcessInstanceIDs.put("078404057EC543A48C16FEC3F7FF8374");
			
    postData.put("MergedProcessInstance", newProcInstanceInfo);
    postData.put("MergingProcessInstanceIDs", mergingProcessInstanceIDs);

    return ops.POSTMethod(URI, postData.toString());
  return "";
}

C# Code Example

public string MergeProcInsts() 
  {
    string URL = "https://mydomain:9011/AgilePointServer/Workflow/MergeProcInsts";

    string jsonRequestData = "{
      \"SplitProcessInstances\":[{
      \"CustomAttributes\":[{
      \"Name\":\"\\/pd:myFields\\/pd:username\",
      \"Value\":\"Administrator\"},
      {\"Name\":\"\\/pd:myFields\\/pd:dept\",
      \"Value\":\"IT Admin\"}],
      \"ProcessInstanceID\":\"ACD73A72D75B4746955679AF8563B2E8\",
      \"ProcessInstanceName\":\"Bond007-70B8B94C7FBE425D8FC1721FEB65785A\",
      \"WorkObjectID\":\"886BA093DBFE4FE6B1F16328DEBB921F\",
      \"WorkObjectInfo\":\""+ null+"}],
      \"MergingProcessInstanceIDs\":[
      \"A586141903874C6EB0B5E45CF65B8F44\",
      \"ACD73A72D75B4746955679AF8563B2E8\"]}";

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

    return ops.POSTMethod(URL, jsonRequestData );
  }

Output

The process instance ID of the merged process instance.

JSON Response Body Example

"String content"

Supported Versions

AgilePoint BPMS v5.0 R2 and higher