6. Add the Approve Document Task Step

In this step, you will add a Task step for the document approval decision. The Task step recipient (or person assigned the decision task) comes from the Approvers property you created in the SharePoint list. When you submit the document approval form for the first time, you will select one or more users to assign this task to. There are two decision actions to choose from: Approved or Rejected. You will configure outcome rules so that all approvers must approve the document or the workflow will follow the rejected outcome.

  1. Add a Task step to the workflow with the following configuration:
    • Instructions: Please review the attached document and indicate your approval decision.
    • Actions: Approved, Rejected
    • Form: SmartForm > Display Document
      • References: Keep default settings
      • Open Task: Help me configure it
      • Workflow View: Create a new State: Workflow Task
      • Open Task Rule Action: Keep default settings
      • After submit: Keep default settings
      • Summary: Save and Finish
    • Recipients: Context Browser > Documents to Review and Approve REFERENCES > Approvers
      • Use the drop-down for the Originator bar, then select Type/Construct my own. Delete the FQN value and add the Approvers reference.

      Use a Reference for a Recipient

      Use a Reference for a Recipient

    • Notification: Customize the notification to include Context Browser references. Attach the Document (File) reference to the email.
    • Adding Context Browser References

      Adding Context Browser References

      Adding Context Browser References

    • Outcome Rule: Change the rule to Consensus, with Rejected being the followed outcome if there is not a consensus.
    • Adding Context Browser References

    • General Properties: Rename the step: Approve Document
    • Connect the Approve Document step to the Set Status Pending Approval step.
    1. Now, you are ready to add and configure the Task step for the document approval decision. Expand the Toolbox by clicking the Toolbox slider. Click the Toolbox icon in the breadcrumb bar to return to the main menu.
      Toolbox Icon
    2. From the Toolbox > Basic node, drag a Task step below the Set Status Pending Approval step.
      Adding a Task Step
    3. Next, you will connect the two steps.

    4. Hover over the bottom border of the Set Status Pending Approval step to expose the outcome handle, then drag the handle down into the Task step. Click the design canvas to set the outcome. (If the handle doesn't appear when you hover over the boarder, click anywhere in the design canvas to refocus your mouse. Then hover.)
      Connecting Steps
    5. Select the Task step, then expand the Configuration Panel. Click the Task Detail tab to make it active, if it is not already. For the INSTRUCTIONS, enter
      Please review the attached document and indicate your approval decision.
      Task Step Instructions
    6. Click the Add (+) icon under the ACTIONS heading to add the task actions:
      Approved
      Rejected
    7. Click the Forms tab. You will select the display form for the task steps, as you do not want the recipient to make changes to the original form entries.
      Forms Tab
    8. For the FORM TYPE, select SmartForm. For the FORM, browse to and select the Display Document form. Your menu structure may be different than the image below, depending on subsites and other naming conventions. Click OK.
      Selecting a Task SmartForm
    9. The Open Task on a Form wizard launches.

    10. On the REFERENCES screen, notice that K2 has found the Documents to Review and Approve SmartObject reference. Click NEXT.
      Open Task on a Form - References
    11. On the OPEN TASK screen, select Help me configure it, then click NEXT.
      Open Task on a Form - Open Task
    12. On the WORKFLOW VIEW screen, confirm the option to Create a new State has the Workflow Task state. Click NEXT.
      Open Task on a Form - Workflow View
    13. There are no changes to the OPEN TASK RULE ACTION screen, click NEXT.
    14. There are no changes to the AFTER SUBMIT ACTION screen, click NEXT.
    15. On the Summary screen, review the settings, then click SAVE AND FINISH. When you see the green success check, click OK to close the wizard.
      Open Task on a Form - Summary
    16. Click the Recipients tab. (See the image below for tab location.)
    17. The default recipient is Originator. You want the Approvers property from the Documents to Review and Approve reference. At runtime, this property contains the value(s) entered by the workflow originator.

    18. Click the Originator bar. From the drop-down options, select Type/Construct my own.
      Type/Construction my own Recipient Value
    19. The recipient value changes to Originator's FQN. Expand the Context Browser. Expand the Documents to Review and Approve SmartObject under the REFERENCES heading. Drag the Approvers property into the Originator's FQN bar. This will add the Approvers property to the recipient bar.
      Adding Recipients
    20. Select the Originator's FQN reference, then click <DELETE> on your keyboard. This removes the default value, leaving the Approvers property as the sole recipient entry.
      Recipients - Reviewers Property
    21. Next, you will configure the task notification email using properties once again from the Context Browser.

    22. Click the Notification tab. CHECK the Customize Notification option. Notice that the SUBJECT and BODY fields are now editable. For the SUBJECT, enter
      Document submitted for your approval:
      then drag the Title from the Documents to Review and Approve reference and append it at the end of the line.
      Adding Context Browser Properties to an Email
    23. Next, you will attach your document to the email.

    24. Scroll down to the bottom of the Notification screen. You will see the ATTACHMENT box. Click the Add Attachment link. Drag the Document (File) reference into the ATTACHMENT box. You are adding a reference to the current document as an attachment to this email. At runtime, the current document is attached to the email.
      Add the Document Attachment
    25. Add additional content to the email BODY so the recipient knows what to do. For example:
      A document is waiting your approval. Please review the attached document and indicate your approval decision in one of the following ways:
      Customize Email Body
    26. Email variables explained:

      Worklist Item Link: This link opens the worklist item (user task). You can action (make a decision on) the item from the worklist item screen.

      Configured Actions: At runtime, K2 replaces this variable with the actions you configured for the task. For example, approved or rejected. You can reply to the email and enter one of the actions in the reply message body. K2 will read the action and move the workflow along according to the outcome rules. K2 refers to this technology as SmartActions.

      Standard Actions: Examples include: Redirect, Delegate and Sleep. Redirect sends the user task to another user and removes the task from the current user's worklist. Delegate sends the task to another user, but keeps the task open for the current user as well. Sleep pauses the worklist item. This is helpful if the user is going to be unable to action the task in the time allotted (if you specified a time allotment).

      Next you will configure the outcome rules for the Approve Document step. (You will name the step in a few minutes.) All approvers must approve the document to send the workflow along the approved outcome. If one or more approvers rejects the document, the workflow follows the rejected outcome.

    27. Click the Outcome Rule tab. Select the Consensus option under the TASK RESULT RULE, then change the non-consensus value to Rejected. This is saying that all recipients must approve the document, or it is rejected.
      Setting Consensus
    28. The last configuration is to rename the step. Click the General Properties tab. Change the name to
      Approve Document
      then collapse the Context Browser, then Configuration Panel.
      Setting a Step Name
  2. Add a Decision step and connect it to the Approve Document step. There are no other configurations necessary. The Decision step generates the outcomes for the Task step. There is outcome per action, so in this case two outcomes, Approved and Rejected.
    1. Decision steps generate outcomes and provide tools for setting rules on outcomes. In this case, there are no rules to configure, so you will just add the Decision step and connect it to the Task step.
      From the Toolbox > Logic node, drag a Decision step below the Approve Document step. Connect the two steps. Notice that the actions configured in the Task step are now generated as outcomes from the Decision step.
      Adding a Decision Step
    2. Your workflow should look like the image below at this point.
      Document Approval Workflow Partial One

Review

In this step, you added a Task step and configured it for the document approval decision. You assigned the task recipient to the Approvers (SmartObject) reference. At runtime, K2 creates a task for each approver selected (on the original submit form). Each approver must "approve" the document for the workflow to follow the Approved outcome. This is known as consensus. If one approver rejects the document, the workflow follows the Rejected outcome. You learned how to add a document as an attachment to an email and how to personalize the email using references from the Context Browser. In the next step, you will configure the steps for the Approved outcome. If approved, K2 moves the document to the Approved Documents library.

Next Step: 7. Complete the Approved Outcome Steps
Document Review and Approval