Save

 

Dovico.TrackITAPI.CWorkflow.Save(System.String,Dovico.TrackITAPI.CStateInfo)

 

 

Function Overview:

Saves workflow information specified in the format workflow.xsd. When specifying order for workflowmanagers to approve in, the order is one-based (the first approving managers order is 1). Also note that workflows can be regular workflows, matrix workflows, or templates of matrix workflows. A template of a matrix workflow should have a TEMPLATE id of 0 and a PROJECT id of 0. If its a template workflow that has limited access then the EMPLOYEE attribute should be set to the user creating and managing the template, otherwise (matrix approval or not) this should always be 0. If it is a regular matrix approval workflow then the PROJECT should be set to the project the approval is for, and TEMPLATE should be -1 if not connected to a template, otherwise it should contain the template ID. If this is a regular workflow then PROJECT should be 0, TEMPLATE should be -1 and EMPLOYEE should be 0.

 

 

 

Parameter List:

sXml - string - string of xml workflow information in the format workflow.xsd

siState - CStateInfo - State information needed to process the transaction

 

Returns

A string of xml containing the IDs of inserted and updated items.

 

Example:

// build up a matrix approval workflow for project ID 100

// that is not connected to a template and has public access to all Track-IT managers

// Take note that both employees assigned to the workflow, as well as their approving

// managers are embedded via xml within each WORKFLOW element.

string sXml = "<Workflow:WORKFLOWS xmlns:Workflow=\"http://www.dovico.com/schemas/workflow.xsd\">";

sXml += "<WORKFLOW ID=\"-1\" PROJECT=\"100\" TEMPLATE=\"-1\" EMPLOYEE=\"0\" NAME=\"Example\" ";

sXml += "TYPE=\"T\" DESC=\"Example description\" ARCHIVE=\"F\" OUTSIDE=\"\" HIDE=\"F\">";

sXml += "<WORKFLOWEMPLOYEES><WORKFLOWEMPLOYEE EMPLOYEE=\"100\"/></WORKFLOWEMPLOYEES>";

sXml += "<WORKFLOWMANAGERS><WORKFLOWMANAGER EMPLOYEE=\"100\" ORDER=\"1\"/></WORKFLOWMANAGERS>";

sXml += "</WORKFLOW>";

sXml += "</Workflow:WORKFLOWS>";

// call the method to save the matrix approval workflow

wsapi.MethodInvoke("WorkflowSave", sXml, stToken);