Web Service > Web Service Operations > Working with Processes > MoveBpmElement
MoveBpmElementResult MoveBpmElement(BpmProcessId tBpmProcess, MoveBpmElementArg tArg)
tBpmProcess. Moniker of opened process.
tArg. Parameters for moving element in process tree.
The MoveBpmElement operation moves element in process structure.
To execute the operation, in the tBpmProcess field specify moniker of opened process, and in the tArg.elGuids field specify GUID of moved element, and in the tArg.dest field specify the place where the element is moved. The moniker can be obtained after executing the OpenBpmProcess operation.
The operation results in the updated process structure if the tBpmProcess.needTree field was defined.
Below is the example of moving step in the process stage. The request contains moniker of opened process, step GUID, and index of the position, to which the step is moved. The response contains process updated structure.
{
"MoveBpmElement" :
{
"tBpmProcess" :
{
"id" : "COAOPGKGCJKEGOAEIHPPEJNABOOGNDGENKOKNINMLFLJFBMK!M!S!BPHLNJFALGCJKEGOAEJPJLLKGPHKELIFIECLCHAGEBCDNFMELP"
},
"tArg" :
{
"elType" : "Step",
"elGuids" :
{
"it" : "{F6158579-0B43-4DEC-9C8B-7AE2E70F15AA}"
},
"needTree" : "true",
"dest" :
{
"guid" : "{433124F8-1861-4CA6-BFDE-B94C54F91652}",
"index" : "1"
}
}
}
}
{
"MoveBpmElementResult" :
{
"res" : "1",
"procTree" :
{
"name" : "Process",
"stages" :
{
"it" :
[
{
"stage" :
{
"name" : "Stage 1",
"index" : "0",
"guid" : "{0E3D2664-1DB4-42B9-A43F-B63CA721B186}"
},
"gtwType" : "No_gateway",
"isCondActive" : "0",
"stGroups" :
{
"it" :
{
"stGroup" :
{
"index" : "0",
"guid" : "{D5F25EB4-CD78-451E-8308-2AC031D2B2C1}"
},
"steps" : "",
"isDefaultFlow" : "0"
}
}
},
{
"stage" :
{
"name" : "Additional stage",
"index" : "1",
"guid" : "{94C3E46B-1BBC-4FFF-9600-49C6B5D344D7}"
},
"gtwType" : "No_gateway",
"isCondActive" : "0",
"stGroups" :
{
"it" :
{
"stGroup" :
{
"index" : "0",
"guid" : "{433124F8-1861-4CA6-BFDE-B94C54F91652}"
},
"steps" :
{
"it" :
[
{
"isEnabled" : "1",
"isValid" : "0",
"name" : "Approve",
"type" : "Approval",
"index" : "0",
"guid" : "{CC5B8608-26E7-4B24-ADE9-E4ECD917AED7}",
"descr" : "",
"maxDur" :
{
"periodType" : "Day",
"amount" : "1"
},
"minDeadline" : "18:00",
"checkDeadline" : "0",
"data" :
{
"writeAccess" : "0",
"authObjKey" : "0"
}
},
{
"isEnabled" : "1",
"isValid" : "0",
"name" : "Execute method",
"type" : "ForeMethod",
"index" : "1",
"guid" : "{F6158579-0B43-4DEC-9C8B-7AE2E70F15AA}",
"descr" : "",
"roleId" : "PS-1-1",
"roleName" : "ADMIN",
"maxDur" :
{
"periodType" : "Day",
"amount" : "1"
},
"minDeadline" : "18:00",
"checkDeadline" : "0",
"fore" : ""
}
]
},
"isDefaultFlow" : "0"
}
}
}
]
}
}
}
}
public static MoveBpmElementResult MoveBpmElement(string moniker, string elGUIDSource, string elGUIDDest, uint moveTo)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tMove = new MoveBpmElement()
{
// Create object moniker
tBpmProcess = new BpmProcessId() { id = moniker },
tArg = new MoveBpmElementArg()
{
elGuids = new string[1] { elGUIDSource },
dest = new MoveBpmElementDestination() { guid = elGUIDDest, index = moveTo},
needTree = true,
elType = BpmElementType.Step
}
};
// Move process element
var result = somClient.MoveBpmElement(tMove);
return result;
}
See also: