How I Created My Policies Approval Workflow

I had a requirement to create a document approval workflow with 2 main steps. First the directors (Name of director is chosen when document is uploaded and workflow sets approver to be the name entered) have to approve the document, then the policy publisher approves it before it is published.

Prerequisites

A custom content type called KWDDocuments with the following fields: Title, Description, Subject, Document Type, Document category, Document department, and Document approvers’ name, Link URL, as below:

Document library called Company Policies and assign content type to library:

 

In SharePoint Designer 2010:

  1. Open the site. From the ribbon click list workflow and select Company policies.
  2. Type in name and description, click ok and save workflow.
  3. Step 1 – Set Variables. Create a local variable called WFApprover of type string. Select action from menu to Set workflow approver and set it to current item: Document Approvers name.
  4. Select action from actions to ‘pause for 5 minutes’.
  5. Add Step 2: Select from actions to ‘start an approval process’. Call this process Director Approval Process, set it on current item and assign to variable; WF Approver. Click Save.
  6. Click ‘Document Approval Process‘ to edit the process.
  7. Set workflow to only allow recipients and process owners to read and edit Workflow tasks, click to allow re-assignment and change requests as above.
  8. Click Change completion conditions for this task process and set up as follows and save after, then return to workflow:

    Variable: Completion reason should be set to [Task Process: Process Name on [Task Process: Item Title] has successfully completed. All participants have completed their tasks.

  9. Click ‘Change behaviour of a single task’ and in the area where task is pending set up the following:

    If the current task is empty, log task created for [Current task: Assigned to] due by [Current Task: Due Date] to the Workflow history List. Then send email of task notification to the [Current task: Assigned to] as below:

  10. Set Up the else condition as follows: Else Log task created for [current task: Assigned to] on behalf of [workflow context: external participant] to history list and then email task notification as follows:
  11. Set up actions for ‘when a task expires‘: Email notification to be created as follows:

  12. Set up actions for when a task is deleted:

    Use log to history list as follows: Task assigned to [Current task: Assigned to] was deleted by [Current Task: Modified By]

    Then log to history list as follows: Task assigned to [Current task: Assigned to] was automatically rejected because it deleted by [Current Task: Modified By]

    Then set up email as Follows:

  13. Set Up Actions for When a task completes:

    If task is approved log [Current Task: Assigned to] was approved by [Current Task: modified By] Comments [Current Task: Comments]

    Create a local Boolean variable: Director Approval and then set it to yes

    Else if rejected

    Log to history list Current Task: Assigned to] was approved by [Current Task: modified By] Comments [Current Task: Comments]

    Then set Director Approval to No

    If cancellonrejection variable is yes

    Set variable completion reason to [Task Process: Process name] on [Task Process: Item title] has ended because [Current Task: Modified By] rejected the document

    End Task process

  14. Go Back and then click on ‘change the behaviour of the overall task process’.

    Set up actions for When the task process starts as above.

    Email to workflow Initiator is as follows:

    And right after the log to history list is as follows [Task Process: Process Name] was started. Participants are as follows [Task Process: Participant List]

    Then If [Task Process: item URL] is not empty

    Set variable: Internet Link to

    Then set variable completion mail title to [Task Process: Process Name] has completed on [Task Process: Item Title (unencoded)]

  15. Then Set Up the following actions for When the Task Process is running:

    If Item is deleted, Variable: Completion reason should be equal to [Task Process: Process Name] has ended because the item that the process approval is running on was deleted.

    If Item is changed, variable Completion reason should be equal to [Task Process: Process Name] has ended because the item that the process approval is running on was changed.

     

    Create Actions for When the Task Process is cancelled

    Email to workflow initiator is as follows:

    Log To history list is as follows: [Task Process: Process Name] on [Task Process: Item title (Unencoded)] has ended because [workflow context: Current user] has cancelled the workflow.

  16. Set Up actions for when Task Process completes:

    Log to history list is as follows [Task Process: Process Name] was completed

    First email to workflow initiator is as follows:

    Second email (After else statement) to workflow initiator is as follows:

  17. Save Workflow and that’s the director approval process finished and go back to the workflow editor screen
  18. Create Step 3 – Policy Publisher Approval.

    Add an ‘If any value equals value ‘condition: If variable: Director Approval equals yes start an approval process called Policy Publisher Approval on the current item with a SharePoint group called (Policy Publisher)

  19. Save workflow and click on the Policy Publisher Approval Process to edit it.
  20. Set Up the Policy Publisher approval process as follows:

  21. Click Change completion conditions for this task process and set up as follows and save after, then return to workflow:

     

     

    Variable: Completion reason should be set to [Task Process: Process Name on [Task Process: Item Title] has successfully completed. All participants have completed their tasks.

  22. Click ‘Change behaviour of a single task’ and in the area where task is pending set up the following:

    If the current task is empty, log task created for [Current task: Assigned to] due by [Current Task: Due Date] to the Workflow history List. Then send email of task notification to the [Current task: Assigned to] as below:

    Set Up the else condition as follows: Else Log task created for [current task: Assigned to] on behalf of [workflow context: external participant] to history list and then email task notification as follows:

  23. Set up actions for ‘when a task expires’: Email notification to be created as follows:

  24. Set up actions for when a task is deleted:

    Use log to history list as follows: Task assigned to [Current task: Assigned to] was deleted by [Current Task: Modified By]

    Then log to history list as follows: Task assigned to [Current task: Assigned to] was automatically rejected because it deleted by [Current Task: Modified By]

    Then set up email as Follows:

  25. Set Up Actions for When a task completes:

    If task is approved log [Current Task: Assigned to] was approved by [Current Task: modified By] Comments [Current Task: Comments]

    Create a local Boolean variable: Director Approval and then set it to yes

    Else if rejected

    Log to history list Current Task: Assigned to] was approved by [Current Task: modified By] Comments [Current Task: Comments]

    Then set Director Approval to No

    If cancellonrejection variable is yes

    Set variable completion reason to [Task Process: Process name] on [Task Process: Item title] has ended because [Current Task: Modified By] rejected the document

    End Task process

  26. Save Go Back and then click on ‘change the behaviour of the overall task process’.

    Set up actions for When the task process starts as above.

    Email to workflow Initiator is as follows:

    And right after the log to history list is as follows [Task Process: Process Name] was started. Participants are as follows [Task Process: Participant List]

    Then If [Task Process: item URL] is not empty

    Set variable: Internet Link to

    Then set variable completion mail title to [Task Process: Process Name] has completed on [Task Process: Item Title (unencoded)]

  27. Then Set Up the following actions for When the Task Process is running:

    If Item is deleted, Variable: Completion reason should be equal to [Task Process: Process Name] has ended because the item that the process approval is running on was deleted

    If Item is changed, variable Completion reason should be equal to [Task Process: Process Name] has ended because the item that the process approval is running on was changed

  28. Create Actions for When the Task Process is cancelled:

    Email to workflow initiator is as follows:

    Log To history list is as follows: [Task Process: Process Name] on [Task Process: Item title (Unencoded)] has ended because [workflow context: Current user] has cancelled the workflow

  29. Set Up actions for when Task Process completes:

    Log to history list is as follows [Task Process: Process Name] was completed

    First email to workflow initiator is as follows:

    Second email (After else statement) to workflow initiator is as follows:

Save workflow and publish and then test.

Advertisements

4 thoughts on “How I Created My Policies Approval Workflow

  1. Hello there,

    I’m trying to replicate your Policies Approval Workflow and I’m struggling to follow the screen shots dealing with step 26.

    ‘else Set Variable:Initial DueDate1 to [%Variable:DueDateforAllTasks1%] [%V…

    I’m not clear on what variable you have placed at the end of the line, help!

    Regards,

    • Hi There,

      Sorry for the late reply, the line of code says Set Variable:Initial DueDate1 to [%Variable:DueDateforAllTasks1%] [%Variable:DueDateforAllTasks1%].

      If you are trying to create an approval workflow most of this code will already be in there, you just need to check and make sure it is the coreect actions and conditions for your requirement. Should if you need more help. Good Luck

      Tenille

    • Hi, I’m sure you can accomplish this to approve a publishing page. If your pages are contained within a pages library then you can set up a workflow on that library to approve pages before they are published. Let me know how u get on and If i can be of further assistance.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s