Workflow tasks
In SharePoint 2013, workflow tasks are a key component of workflows, allowing workflows to interact with users to track and satisfy the requirements of a business process. Nintex Workflow 2013 extends the functionality of workflow tasks, by providing several workflow actions that can be incorporated into Nintex workflows to generate various types of workflow tasks. For more information about workflow tasks in Nintex, see the Nintex Workflow 2013 product documentation.
Task types
Nintex Workflow supports several task types, all derived from the NintexTask class in the Nintex.Workflow.HumanApproval namespace:
Workflow approval tasks
Workflow approval tasks are created when a Nintex workflow containing a Request approval action is run. Workflow approval tasks are represented by the ApprovalTask class, in the Nintex.Workflow.HumanApproval namespace.
Workflow review tasks
Workflow review tasks are created when a Nintex workflow containing a Request review action is run. Workflow review tasks are represented by the ReviewTask class, in the Nintex.Workflow.HumanApproval namespace.
Workflow data tasks
Workflow data tasks are created when a Nintex workflow containing a Request data action is run. Workflow data tasks are represented by the CollectDataFromUserTask class, in the Nintex.Workflow.HumanApproval namespace.
Workflow to-do tasks
Workflow to-do tasks are created when a Nintex workflow containing an Assign to-do task action is run. Workflow to-do tasks are represented by the TodoTask class, in the Nintex.Workflow.HumanApproval namespace.
Flexi task tasks
Flexi task tasks, also known as multi-outcome tasks, are created when a Nintex workflow containing an Assign Flexi task action is run. Flexi task tasks are represented by the MultiOutcomeTask class, in the Nintex.Workflow.HumanApproval namespace.
Getting running workflow tasks
Before you can interact with workflow tasks that are assigned to users, you must first retrieve information about those running workflow tasks. You can use the following web service operations to retrieve information about running workflow tasks:
-
Retrieve all running workflow tasks associated with the specified file in a SharePoint document library.
-
GetRunningWorkflowTasksCollection
Retrieve running workflow tasks associated with the specified user, SharePoint site, and SharePoint list.
-
GetRunningWorkflowTasksForCurrentUser
Retrieve running workflow tasks for the current user, for either the current SharePoint site or a specified file in a SharePoint document library.
-
GetRunningWorkflowTasksForCurrentUserForListItem
Retrieve running workflow tasks for the current user, for the specified SharePoint list item.
-
GetRunningWorkflowTasksForListItem
Retrieve all running workflow tasks for the specified SharePoint list item.
Processing responses for workflow tasks
You can use one of the following service operations to process responses for workflow tasks, depending on the task type:
-
Workflow approval and review tasks
You can use the ProcessTaskResponse3 service operation to process task responses for workflow approval and review tasks.
-
Workflow data and to-do tasks
You can use the UpdateListItems service operation, provided by SharePoint, to process task responses for workflow data or to-do tasks.
-
Flexi task tasks
You can use the GetOutcomesForFlexiTask and ProcessFlexiTaskResponse2 service operations, provided by Nintex Workflow 2013, to process Flexi task tasks.
For more information, see Processing workflow task responses.
Delegating tasks
The task user or an administrator can delegate tasks either interactively, using the Delegate page provided by Nintex Workflow 2013, or programmatically, using one of the following web service operations:
-
This operation delegates all tasks from one specified user to another specified user.
-
This operation delegates a single specified task from the current user to another specified user, for the specified task and task list.
In addition, a workflow can delegate a task by invoking the Delegate workflow task workflow action, allowing workflows to process information and delegate tasks as needed. For more information about using the workflow action, see the Nintex Workflow 2013 product documentation.
Allowing delegation
Tasks cannot be delegated unless the workflow action that creates the task allows delegation. If the task does not allow delegation, only the task owner or an administrator has the rights to approve the task; otherwise, either the task owner or an administrator can delegate the task to another user. To allow delegation, ensure that Allow delegation is selected in the configuration page of the workflow action that generates the task, or set the value of the AllowDelegation property to true for the appropriate workflow action adapter of that workflow action.
Task tokens
A task token is an encoded string that uniquely identifies the combination of an approver, a task item, and the Nintex content database that contains information about the task item. When LazyApproval is enabled, the task token serves as the identification code used in notification emails and OCS/Lync conversations.
The task token is represented by the following string format, where <EncodedValue> represents the variable-length encoded string for the task token:
[#<EncodedValue>#]
Caution: Do not tamper or alter the encoded string in the task token; otherwise, unpredictable results or errors may occur.
You can programmatically obtain task tokens for running workflow tasks by retrieving the value of the TaskToken property from a TaskStub object, returned from either an instantiated TaskStubCollection object in the Nintex.Workflow.Reports namespace, or the results of the GetTaskStubsForCurrentUser service operation.
If you have a task token, you can use the ProcessTaskResponseUsingToken method to process task responses for workflow tasks. For more information about processing task responses, see Processing workflow task responses.