다음을 통해 공유


A Sample SharePoint 2013 Approval Workflow Which can be Recalled by the Initiator

Hi, I am JongHwa Lim, a Program Manager for SharePoint Designer 2013 (aka. SPD 2013 or SPD). Today, I’d like to share a simple workflow which reflects a real world scenario and also gives you some hints on what jonghwal's piccan be done with the new SPD workflow designer, based on the WF4 platform.

There are many real world process examples that require an initiator to recall a process when s/he finds that there is something wrong with the item or information s/he already submitted. As such, I’d like to build a simple workflow that leverages the parallel step construct and two task actions available in the WF4 platform.

This is the basic workflow skeleton. Please note that parallel step is used to run two silos(sub steps) in parallel – the normal approval process and the recall process.

clip_image001

From now on, I will explain how this works and show the runtime behaviors as well.

In WF4, the parallel step provides an optional short-cut feature. If you right-click the parallel step and click ‘Advanced Properties’, you will see the following dialog where you can choose to use the short-cut feature. You will need a Boolean variable to use this feature which is why we used the ‘IsShortCut’ variable in the above logic.

clip_image002

As soon as any of the silos is finished executing, the other silo will be automatically cancelled and the parallel step will be finished. As you can see, one silo contains the normal approval process and the other silo contains the recall process. When the workflow execution enters the parallel step, the tasks for the normal approval process and the task for the recall process will be created in parallel. (In this sample workflow, ‘Anne Weiler’ is the submitter.)

clip_image003

If the normal approval process is completed, then we will no longer need to recall the workflow so the recall process will be automatically cancelled as the execution reaches the end of the first silo. The task created for the recall process will also be deleted from the task list. Likewise, if the recall process is completed by completing the recall task, the normal approval process is automatically cancelled.

Again, this workflow is just a skeleton example. To make it more realistic, you may need to add additional logic to make decisions based on the task outcome and you may need to use a custom task content type if you wish to use different outcomes, other than ‘Approved’ and ‘Rejected’.

A more completed workflow might look like this.

image

This is a very simple yet very powerful example of a workflow. Hope you enjoyed this article and found some insight/hint on what you plan to do with SPD workflows.

Thanks,

JongHwa

Comments

  • Anonymous
    April 14, 2015
    Useful, thanks