Task class

Parent Previous Next

The Task object represents a workflow task which is triggered usually by a BPMN User Task Activity. because it will be created by the workflow the task class does not have a public constructor. To access available tasks use the Tasks collection class.


Namespace:

IYOPRO.Api

Assembly:

IYOPRO.Api (in IYOPRO.Api.dll)


Syntax

       private class Task()


Members

ProcessInstanceFile AddFile(string name, string path)

Add a local file to the process instance of the task. Keep in mind that you should also assign the internal filename to a process instance variable to be able to access the file later.

void RemoveFile(string internalname)

Removes a file from the process instance. Remember to remove the file also from the referencing process instance variable

void Run(bool finished,object userdata = null)

Continue the process instance. Finished specifies, if the task has been finished or not. Userdata will be provided in the resulting ProcessContinuedEventArgs

void LoadAttributes(List<string> attributes,object userdata=null)

Loads process instance attributes by their name and assigns them to the Attributes collection

Guid GuId

Gets the unique identifier of the task.

Guid PiGuId

Gets the unique identifier of the process instance.

string PiName

Gets the name of the process instance.

int WfId

Gets the Id of the describing Workflow.

string Name

Gets the name of the task.

DateTime CreatedAt

Gets the timestamp when the task has been created

DateTime PlannedAt

Gets the timestamp when the task is planned

DateTime FinishedAt

Gets the timestamp when the task is finished

string FinishedBy

Gets the name who finished the task.

ProcessInstanceAttributes Attributes

Gets a collection of process instance attributes.



Sample


// Add the Pdf to our process instance

ProcessInstanceFile pif=Task.AddFile("My Documentation", "c:\\temp\\File.pdf");

// Add the Pdf to our process attribute, that contains the file list

List<object> files = Task.Attributes.Get("Files") as List<object>;

files.Add(pif.InternalName);

// Finish the task

Task.Run(true);