bool ExecuteBpmOperation(BpmProcessId tBpmProcess, ExecuteBpmOperationArg tArg)
tBpmProcess. Moniker of opened process.
tArg. Operation execution parameters.
The ExecuteBpmOperation operation executes various operations with running process instances.
To execute the operation, in the tBpmProcess field specify moniker of opened process. The moniker can be obtained after executing the OpenBpmProcess operation. In the tArg.oper field specify executed operation. If the operation is executed for process instances, define the tArg.instIds field. Process instance identifiers can be obtained using the GetProcessInstances operation. If the operation is executed for a step, define the tArg.guid field. Step GUIDs can be obtained using the GetBpmMonitoringWorkspace operation. If required, one can define other optional fields.
The operation results in the logical true if the operation is executed successfully.
Below is the example of stopping running process instance. The request contains moniker of opened process and identifier of running process instance, and the running operation. The response contains whether process instance is set successfully.
{
"ExecuteBpmOperation" :
{
"tBpmProcess" :
{
"id" : "NPHEOHFBGPCDGOAEFHEOFIIANCEEIDGECLDJGGBNCPACAJOB!M!S!BPJKLPJNFBGPCDGOAEEGOFJMAOEDKBLKDEALEJKADCFIEOHNAC"
},
"tArg" :
{
"oper" : "ProcessStop",
"instIds" :
{
"it" : "97976"
},
"comment" : ""
}
}
}
{
"ExecuteBpmOperationResult" : "1"
}
public static bool ExecuteBpmOperation(string moniker, int instId, BProcessMonitoringExecuteOperation operation, string operComment = "")
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tExec = new ExecuteBpmOperation()
{
// Create object moniker
tBpmProcess = new BpmProcessId() { id = moniker },
tArg = new ExecuteBpmOperationArg()
{
instIds = new int[1] { instId },
oper = operation,
comment = operComment
}
};
// Execute operation with running process instance
var result = somClient.ExecuteBpmOperation(tExec);
return result;
}
See also: