Merge Process Instances
API Type
REST
HTTP Method
POST
Description
Merges 2 or more process instances into one process instance.
Good to Know
- These process instances must be based on the same process model.
- If more than one process instance is intended to perform the same operation, instead of having more than one process instance, you can merge all the process instances into a single process instance.
- To call this method, the API account user must have the access right, Cancel a Process.
- 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/MergeProcInsts
URL Format (OnDemand)
https://[domain]:[port]/AgilePointService/Workflow/MergeProcInsts
Request Parameters
Name | Description |
---|---|
None | Not Applicable |
Request Body Properties
Name | Description |
---|---|
instruction |
|
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 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.