Methods / Methods for Process Instances |
Creates a process instance that can have additional input arguments added to the function.
Name | Type | Description |
---|---|---|
PID | string | The process definition ID for a released process definition. |
PIID | string | A 32 character unique process instance ID for the process instance you are creating. If you set this value to null, the AgilePoint Server generates the ID. |
PIName | string | A unique process name that is associated with the process definition. The maximum length of process instance name is 1024 characters. |
workObjectID | string | A 256-character ID for an object, such as a document, that is associated with the process instance. (Even though the field size is 256 characters, in common practice, this will usually return a 32-character GUID.) |
superPIID | string | A 32-character unique process instance ID that acts as a parent process instance of the process instance that is intended to create. In other words, this is the ID of the process instance on which you want to base your new process instance. |
customID | string | A work object ID as identified in the process instance. This method allows only one custom ID (work object ID). |
attributes | NameValue | Name-value pairs associated with a custom ID. |
startImmediately | bool | An obsolete, legacy parameter that must be true. |
WFEvent object that provides the status of the transaction. Possible statuses are Success, Failed, and Sent.
IWFWorkflowService svc = GetWorkflowService(); string processDefinitionName = "EmployeeOnboardProcess"; // get UUID of released process definition string processDefinitionID = svc.GetReleasedPID(processDefinitionName); // assign UUID of process instance string processInstanceID = UUID.GetID(); // process instance name that has to be unique within process definition ID string processInstanceName = string.Format("{0}-{1}", processDefinitionName DateTime.Now.Ticks ); // work object ID string workObjectID = UUID.GetID(); //parent process instance ID is required if this is to create a sub process. If not, just provide null string parentProcessInstanceID = .. // for example, "09315f0ae769429bbfb243f888bcb09f" or null List<NameValue> ds = new List<NameValue>(); ds.Add(new NameValue("CustomAttrKey1", "CustomAttrValue1")); ds.Add(new NameValue("CustomAttrKey2", true)); ds.Add(new NameValue("CustomAttrKey3", 12345)); WFEvent evt = svc.CreateProcInstEx( processDefinitionID, processInstanceID, processInstanceName, workObjectID, parentProcessInstanceID, workObjectID, ds.ToArray(), true);