Web Service > Web Service Operations > Working with Processes > AddBpmElement
AddBpmElementResult AddBpmElement(BpmProcessId tBpmProcess, AddBpmElementArg tArg)
tBpmProcess. Moniker of opened process.
tArg. Parameters for adding element to process.
The AddBpmElement operation creates a new element in process.
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.
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.
{
"AddBpmElement" :
{
"tBpmProcess" :
{
"id" : "COAOPGKGCJKEGOAEIHPPEJNABOOGNDGENKOKNINMLFLJFBMK!M!S!BPHLNJFALGCJKEGOAEJPJLLKGPHKELIFIECLCHAGEBCDNFMELP"
},
"tArg" :
{
"elType" : "Stage",
"stgInf" :
{
"name" : "Final stage"
},
"ind" : "1"
}
}
}
{
"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: