The so-called Task Reassign means that after a Task is assigned to a user, the user can allocate (forward) his Task to another user (reassigner ). This reassigner can perform exactly the same operations as the original user.
Many customers want to implement this business scenario. QuickFlow has provided excellent support for the internal task distribution mechanism.
The core Activity of QuickFlow is InnerTask. InnerTask combines three basic activities: CreateTask, OntaskChanged, and CompleteTask to implement the processing logic of a task, for example:
To support the reassign of a Task, the While and InnerTask activities are combined into a Task activity. After the InnerTask activity ends, if the user's action is ReAssign, The InnerTask is executed repeatedly, allocates reassinger tasks, for example:
Therefore, to use the Task activity of QuickFlow to allocate tasks, you only need to use the InfoPath form to input appropriate control data. QuickFlow requires that the following two fields be used to transmit ReAssign control data:
_ Action: approval Action. The following actions are supported:
ReAssign -- Task forwarding: this parameter is used to forward tasks to other users.
Save --- keep the form and do not end the task
Commit -- submit a form. The default value is Commit. If the _ Action field does not exist or the value is null
MoreApprove-requires more users to approve the application. After the approval is completed, the process is automatically transferred back to the original user (for further explanation ).
_ ReAssignUser: the user account of the forwarding task.
As you can see, you should know how to use the Reassign function of QuickFlow, as long as the _ Action field and _ ReAssignUser field of the InfoPath form are controlled as appropriate values.
MultiTask and GroupTask also use tasks for Task distribution. Therefore, this ReAssign mechanism is also supported.
The following is a simple example.
1) flowchart:
2) process the TaskCreating event of Task 1 and implement the task allocation logic and field assignment:
Private void taskdetailtaskcreating (object sender, TaskEventArgs e)
{
// If the value of AssignedTo is null, the task is assigned for the first time. Otherwise, the task is reassigned.
If (String. IsNullOrEmpty (e. TaskProperties. AssignedTo ))
{
E. TaskProperties. AssignedTo = "helloworld/user1 ";
E. TaskProperties. ExtendedProperties ["Comments"]
= "Please input approve comments in here .";
}
Else
{
E. TaskProperties. ExtendedProperties ["Comments"] =
"Task is reassigned to you ";
}
}
3) design the InfoPath form:
When the ReAssign check box is selected, the "Reassign this to" area on the right is displayed. The rules of the ReAssign button are as follows:
After the workflow is deployed, you can test the effect:
1) Start the Workflow
2) process the task for the first time and reassign it to other users.
3) Other users process tasks
4) task tracking
Download sample code:
Http://cid-7f5a25cdf47d03e6.office.live.com/self.aspx/QuickFlow/Examples/QuickFlowExample%5E_TaskReAssign.zip
After opening the project, you must add a reference to Microsoft. SharePoint. dll and Microsoft. SharePoint. WorkflowActions. dll.
In the directory C: \ Program Files \ Common Files \ Microsoft Shared \ web server extensions \ 12 \ ISAPI
Postscript:
This article describes how to use infopath to implement the Reassign task table. If aspx is used as a task form, you can directly put TaskReassignButton on the page.