WorkItem¶
Represents a step of a workflow instance, such as a task assigned to a user.
Remarks¶
The work item of the current script is $WorkItem. Other work items are reached through WorkItem.Previous, WorkItem.NextItems, Instance.InitiatorWorkItem and $Domain.GetWorkItem.
WorkItem.State shows where the work item is in its life cycle, from Created and Waiting to Completed. In a prework script, properties such as WorkItem.Caption and WorkItem.DeadlineDate change how the task is shown to its owners. The data of another work item can be read through WorkItem.Data, but changes to it are not saved.
Examples¶
Read the decision of the previous step¶
1 2 3 4 5 | |
Capabilities¶
Metadata¶
- WorkItem.Caption: Gets or sets the caption of the work item to display in user interfaces.
- WorkItem.Id: Gets the globally unique identifier of the work item.
- WorkItem.Instructions: Gets or sets the instructions for the work item to display in user interfaces.
- WorkItem.Name: Gets the name of the work item.
- WorkItem.TaskId: Gets the task ID of the work item.
Properties¶
- WorkItem.CompletedBy: Gets the identity of the user who completed the work item.
- WorkItem.DeadlineDate: Gets or sets the deadline date and time of the work item.
- WorkItem.End: Gets the end date and time of the work item. The end date is set when the work item is completed with an action by a user or the system.
- WorkItem.NextReminder: Gets or sets the date and time of the next reminder to send.
- WorkItem.Previous: Gets the previous work item in the workflow.
- WorkItem.SelectedAction: Gets or sets the selected action for the work item.
Context¶
- WorkItem.Data: Gets the data of the work item.
- WorkItem.Instance: Gets the instance to which the work item belongs.
- WorkItem.NextItems: Gets an array of the next work item instances.
Lifecycle¶
- WorkItem.IsDeadlined: Gets a boolean value that specifies whether the current work item is deadlined.
- WorkItem.Start: Gets the start date and time of the work item.
- WorkItem.State: Gets the current state of the work item.
Actions¶
- WorkItem.Forward: Forwards the work item to another user.
- WorkItem.Initiate: Initiates a new instance using the specified arguments.
- WorkItem.Process: Processes the current WorkItem with the specified parameters.
- WorkItem.ProcessWorkItem: Processes the specified WorkItem with the selected action.
- WorkItem.Terminate: Terminates the current instance to which the work item belongs.
- WorkItem.Trigger: Triggers the specified event with input data and returns the IDs of triggered listener work items.
Retrieval and Ownership¶
- WorkItem.Get: Gets a WorkItem instance by its ID.
- WorkItem.GetOwners: Returns an array of identities to which the work item is assigned.
- WorkItem.GetOwnerUsers: Returns an array of users to whom the work item is assigned.