Click or drag to resize
RuntimeServiceCreateProcess Method
Creates a process into WorkflowGen. Can create a new version of the process if it already exists. Intended for web use only.

Namespace: Advantys.Workflow.Web.Services.Processes.Runtime
Assembly: Advantys.Workflow.Web.Services.Processes.Runtime (in Advantys.Workflow.Web.Services.Processes.Runtime.dll) Version: 6.6.0.0 (6.6.0.0)
Syntax
public int CreateProcess(
	string processDefinition,
	string folderName,
	string processStatus
)

Parameters

processDefinition
Type: SystemString
Definition of the process as an XML string. Element names are case sensitive.
folderName
Type: SystemString
Name of the folder. Can be empty if FolderId is specified. Optional parameter. By default if there are no folderName or folderId, the imported process uses the same folder as its previous version.
processStatus
Type: SystemString
Status of the new version of the process to be imported. If ACTIVE is selected, any other previous ACTIVE versions will be archived. - Default = TEST - Accepted values: string.Empty, "DEV", "TEST", "ACTIVE"

Return Value

Type: Int32
Returns the created process ID.
Remarks
Available since WorkflowGen version: 6.2.0

Optional Parameters.

These parameters can be used in the query string or as parameters of the Headers object in the RuntimeService class instance. See example below.

ProcessName (string)Specifies a process name for the creation of the new process or version. If this parameter is not used, we will take the name from the process definition.
FolderId (int)Specifies the folder ID. Supercedes the Folder name.
AddNewParticipantsAsGlobal (bool)Specifies whether or not to import process participants as global participants. Can only be used users who have an Administrator profile. Default = false.
AddGlobalParticipantAssociations (bool)Specifies whether or not to import global participant associations. Can only be used users who have an Administrator profile or process managers when the web config parameter AdministrationRestrictManagerToModifyGlobalParticipant is set to true. Default = false.
UseVersionNumber (bool)Specifies whether or not to import the process version number from the process definition. Default = false.
NewVersionsIfExists (bool)Specifies whether or not to create a new version of the process if it already exists. Default = true.
Sample code:
RuntimeServiceWebService.RuntimeService myRuntimeService = new RuntimeServiceWebService.RuntimeService();
RuntimeServiceWebService.CreateProcessHeader myCreateProcessHeader = new RuntimeServiceWebService.CreateProcessHeader();
myRuntimeService.CreateProcessHeaderValue = myCreateProcessHeader;

myCreateProcessHeader.FolderId = folderId;
myCreateProcessHeader.AddGlobalParticipantAssociations = addGlobalParticipantAssociations;
myCreateProcessHeader.AddNewParticipantsAsGlobal = addNewParticipantsAsGlobal;
myCreateProcessHeader.UseVersionNumber = useVersionNumber;
myCreateProcessHeader.ProcessName = processName;
myCreateProcessHeader.NewVersionIfExists = newVersionIfExists;

int createdProcessId = myRuntimeService.CreateProcess(processDefinition, folderName, processStatus);


See Also