Execute Workflows Asynchronously
- Last UpdatedJun 10, 2024
- 2 minute read
-
Execute(object UserId,string Data)
The workflow can be executed by passing the UseridString and the XML data to the Execute method.
Example:
string xmlcontent = "<Expense><Amount>2000</Amount></Expense>";
Client objClient = new Client("MyRep", "MyWF");
int ExecutionID =objClient.Execute("activedirectory::Bob ",xmlcontent);
objClient.Close();
-
Execute(int version, object UserId,string Data)
The version of the workflow can be specified in this method along with the UseridString and the XML data.
-
Execute(object UserId,string Data,VariablesCollection variable)
The variables used in the workflow can be assigned values using this method. The values are passed using the variables collection object.
Example:
string xmlcontent = "<Expense><Amount>2000</Amount></Expense>";
VariablesCollection varCol = new VariablesCollection();
varCol.Add("varPrice", "Number",1);
varCol.Add("varTotal", "Number",2);
Client objClient = new Client("MyRep", "MyWF");int ExecutionID = objClient.Execute("activedirectory::Bob ", xmlcontent,varCol);
objClient.Close();
-
Execute(string versionStamp, object UserId,string Data)
The specified version of the workflow can be executed by passing the version of the workflow that is already existing. The version can be created by right clicking on the work flow in the workflowlist (in the enterprise Console) and select save as option.
Example:
string xmlcontent = "<Expense><Amount>2000</Amount></Expense>";
VariablesCollection varCol = new VariablesCollection();
varCol.Add("varPrice", "Number",1);
varCol.Add("varPrice", "Number",2);
Client objClient = new Client("MyRep", "MyWF");
int ExecutionID = objClient.Execute("2","activedirectory::Bob ", xmlcontent);
objClient.Close();
-
Execute(int version,object UserId,string Data,VariablesCollection variable)
The variables used in the workflow can be assigned values using this method.
-
Execute(string versionStamp, int version,object UserId,string Data,VariablesCollection variable)
The variables used in the workflow can be assigned values using this method. The values are passed using the variables collection object. VersionStamp parameter is the version of the workflow that is already created. Version of the workflow can be created by right clicking on the work flow in the workflowlist and select save as option.
Example:
string xmlcontent = "<Expense><Amount>2000</Amount></Expense>";
VariablesCollection varCol = new VariablesCollection();
varCol.Add("varPrice", "Number",1);
varCol.Add("varPrice", "Number",2);
Client objClient = new Client("MyRep", "MyWF");
int ExecutionID = objClient.Execute("2","activedirectory::Bob ", xmlcontent, varCol);
objClient.Close();