ExecuteBpmOperation

Syntax

bool ExecuteBpmOperation(BpmProcessId tBpmProcess, ExecuteBpmOperationArg tArg)

Parameters

tBpmProcess. Moniker of opened process.

tArg. Operation execution parameters.

Description

The ExecuteBpmOperation operation executes various operations with running process instances.

Comments

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.

Example

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ExecuteBpmOperation xmlns="http://www.fsight.ru/PP.SOM.Som">
<tBpmProcess xmlns="">
  <id>NPHEOHFBGPCDGOAEFHEOFIIANCEEIDGECLDJGGBNCPACAJOB!M!S!BPJKLPJNFBGPCDGOAEEGOFJMAOEDKBLKDEALEJKADCFIEOHNAC</id>
  </tBpmProcess>
<tArg xmlns="">
  <oper>ProcessStop</oper>
<instIds>
  <it>97976</it>
  </instIds>
  <comment />
  </tArg>
  </ExecuteBpmOperation>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
  <ExecuteBpmOperationResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">1</ExecuteBpmOperationResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"ExecuteBpmOperation" :
{
"tBpmProcess" :
{
"id" : "NPHEOHFBGPCDGOAEFHEOFIIANCEEIDGECLDJGGBNCPACAJOB!M!S!BPJKLPJNFBGPCDGOAEEGOFJMAOEDKBLKDEALEJKADCFIEOHNAC"
},
"tArg" :
{
"oper" : "ProcessStop",
"instIds" :
{
"it" : "97976"
},
"comment" : ""
}
}
}

JSON response:

{
"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:

Working with Processes