Show contents 

Web Service > Web Service Operations > Working with Processes > AddBpmElement

AddBpmElement

Syntax

AddBpmElementResult AddBpmElement(BpmProcessId tBpmProcess, AddBpmElementArg tArg)

Parameters

tBpmProcess. Moniker of opened process.

tArg. Parameters for adding element to process.

Description

The AddBpmElement operation creates a new element in process.

Comments

The operation creates a new stage, step, gateway, or start event in a process. To execute the operation, in the tBpmProcess field specify moniker of opened process, and in the tArg field specify element creation parameters. The moniker can be obtained after executing the OpenBpmProcess operation.

The operation results in the information about created element.

Example

Below is the example of creating a new stage in the process. The request contains moniker of opened process and stage and creation parameters. The response contains information about the created stage.

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">
<AddBpmElement xmlns="http://www.fsight.ru/PP.SOM.Som">
<tBpmProcess xmlns="">
  <id>COAOPGKGCJKEGOAEIHPPEJNABOOGNDGENKOKNINMLFLJFBMK!M!S!BPHLNJFALGCJKEGOAEJPJLLKGPHKELIFIECLCHAGEBCDNFMELP</id>
  </tBpmProcess>
<tArg xmlns="">
  <elType>Stage</elType>
<stgInf>
  <name>Final stage</name>
  </stgInf>
  <ind>1</ind>
  </tArg>
  </AddBpmElement>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<AddBpmElementResult 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">
  <guid xmlns="">{94C3E46B-1BBC-4FFF-9600-49C6B5D344D7}</guid>
  <ind xmlns="">1</ind>
  <childGuid xmlns="">{433124F8-1861-4CA6-BFDE-B94C54F91652}</childGuid>
  </AddBpmElementResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"AddBpmElement" :
{
"tBpmProcess" :
{
"id" : "COAOPGKGCJKEGOAEIHPPEJNABOOGNDGENKOKNINMLFLJFBMK!M!S!BPHLNJFALGCJKEGOAEJPJLLKGPHKELIFIECLCHAGEBCDNFMELP"
},
"tArg" :
{
"elType" : "Stage",
"stgInf" :
{
"name" : "Final stage"
},
"ind" : "1"
}
}
}

JSON response:

{
"AddBpmElementResult" :
{
"guid" : "{94C3E46B-1BBC-4FFF-9600-49C6B5D344D7}",
"ind" : "1",
"childGuid" : "{433124F8-1861-4CA6-BFDE-B94C54F91652}"
}
}
public static AddBpmElementResult AddBpmElement(string moniker, string stageName)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tAdd = new AddBpmElement()
{
// Create object moniker
tBpmProcess = new BpmProcessId() { id = moniker },
tArg = new AddBpmElementArg()
{
elType = BpmElementType.Stage,
stgInf = new BpmStageNewInfo()
{
name = stageName
},
ind = 1
}
};
// Create a new stage
var result = somClient.AddBpmElement(tAdd);
return result;
}

See also:

Working with Processes