17. Test the Document Review and Approval Application
In this step, you will test the two workflows: Document Review Workflow and Document Approval Workflow. You will upload documents to the Documents to Review and Approve library, then manually start the workflows.
To test this application, you will upload documents to the SharePoint library. Consider creating at least two test documents using any editor (Word or NotePad) and save them to your desktop.
Upload two documents and start the Document Review Workflow
-
Upload a new document to the Documents to Review and Approve library. You can use any document you like. Set the properties of the document as follows:
Property |
Value |
Notes |
Name |
Keep the default value. |
This field should be set to the file name of the document you uploaded. |
Title |
Test One Doc Review and Approval
|
Specify a title for the document for testing purposes. |
Reviewers |
Enter one user here. You can use your own account or another user’s account. |
This will be the reviewer(s) for the document. |
Review Status |
(leave blank) |
The workflow updates this field. |
Approvers |
Enter one user here. You can use your own account or another user’s account. |
This will be the approver(s) for the document. |
Approval Status |
(leave blank) |
The workflow updates this field. |
- Upload a new document to the Documents to Review and Approve library. You can use any document you like. Set the properties of the document as follows:
Property |
Value |
Notes |
Name |
Keep the default. |
This field should be set to the file name of the document you uploaded. |
Title |
Test Two Doc Review and Approval
|
Specify a title for the document for testing purposes. |
Reviewers |
Enter one user here. You can use your own account or another user’s account. |
This will be the reviewer(s) for the document. |
Review Status |
(leave blank) |
The workflow updates this field. |
Approvers |
Enter one user here. You can use your own account or another user’s account. |
This will be the approver(s) for the document. |
Approval Status |
(leave blank) |
The workflow updates this field. |
- Check in both documents.
- Start the Document Review Workflow for both of the documents you uploaded. Use the context menu (ellipses) to access the menu. In some versions of SharePoint, the K2 Workflows option appears in the Advanced context menu.
- Browse to the Documents to Review and Approve library and click the New link to upload a new document.
- Upload any document you like and configure the properties for the document using the table below as a guide. Click Check In to save the document.
Property | Value | Notes |
---|
Name |
Keep the default. |
This value is the file name of the document you uploaded. |
Title | Test One Doc Review and Approval |
Specify a title for the document for testing purposes. |
Reviewers |
Enter one user here. You can use your own account or another user’s account. |
This will be the reviewer(s) for the document. In the image below, Administrator has been entered as the reviewer for the document. |
Review Status
|
(leave blank) |
The workflow updates this field. |
Approvers |
Enter one user here. You can use your own account or another user’s account. | This will be the approver(s) for the document. In the image below, Administrator has been entered as the reviewer for the document. |
Approval Status |
(leave blank) |
The workflow updates this field. |
- Upload another document and configure the properties for the second document using the table below as a guide. Click Check In to save the document.
Property | Value | Notes |
---|
Name | Keep the default. |
This value is the file name of the document you uploaded. |
Title | Test Two Doc Review and Approval |
Specify a title for the document for testing purposes. |
Reviewers |
Enter one user here. You can use your own account or another user’s account. |
This will be the reviewer(s) for the document. In the image below, Codi has been entered as the document reviewer. |
Review Status |
(leave blank) |
The workflow updates this field. |
Approvers |
Enter one user here. You can use your own account or another user’s account. |
This will be the approver(s) for the document. In the image below, Bob has been entered as the document approver. |
Approval Status |
(leave blank) | The workflow updates this field. |
- Use the ellipses for both documents and check them in.
You are now ready to start the first workflow, Document Review Workflow.
Submit the first document to the Document Review Workflow.
- Click the settings ellipsis for the first document, then K2 Workflows option from the context menu. (The K2 option may be in the Advanced menu.)
- From the K2 Workflows page, select the Document Review Workflow, then click the Start button.
You are returned to the Documents to Review and Approve library. You should see that the Review Status column has been set to Pending Review (if not, wait a few seconds, then refresh the page).
- Click the K2 Workflows context menu for the first document again.
- Locate the Workflow History heading. The first test workflow now appears in the Workflow Instances list. If time allows, open the View Flow report to verify that the workflow is waiting for the reviewer to action their task.
- Return to the document library and launch K2 Workflows from the second test document's context menu.
- Start the Document Review Workflow for the second document.
Review the documents
-
Open the first document reviewer’s email and locate the task notification email. (If you just added yourself alone as the reviewer, open your email client.) Open the attached document, then reply to the email with Reviewed and Accepted.
- Verify that the first document's review status is set to Reviews Accepted, then open the K2 Workflows page for the first document. Verify that the Document Review Workflow completed.
- Review the second document and send the document back for rework.
If you selected another user as the reviewer for the submitted documents, that user will need to perform these steps. Otherwise, if you just selected yourself, you can action the workflows.
- In the first step of this tutorial, you added the K2 app to your SharePoint site collection, then added the app to your document libraries. You also added a K2 Worklist web part to the site collection. You can view tasks assigned to you from the K2 Worklist web part.
Access the SharePoint site collection logged in with a reviewer's account. (This could very well be you, if you added yourself as the reviewer.) Navigate to the K2 Worklist web part. You should see the Review Document activity task for your workflow. (There may be two list items, if you added yourself as both document reviewers.)
- Open the reviewer’s e-mail client. You should see a task notification email from the K2 Service account. Notice the document attached to the email. You can open the document directly from the email.
To open Administrator's email on a K2-provided VM, open a new browser tab, then click the OWA link found in the Favorites bar. Sign in as Administrator.
Username: Denallix\Administrator
Password: K2 pass!
- Reply to the email with
Reviewed and Accepted
After a few seconds, you should get a confirmation from the K2 server that the task was completed.
- Return to the Documents to Review and Approve library, and verify that the first document’s status displays Reviewed and Accepted.
- Open the K2 Workflows context menu for the first document. The workflow history now displays Completed.
- Return to your email. Confirm you have a notification saying the reviewers accepted the document. (You may need to refresh your email.) You have now completed testing for the first document.
- Now, you will take action for the second test document. Using the K2 Worklist web part, open the Review Document task form for the second document.
- The Display Document form opens, along with the K2-generated Workflow view. K2 adds this view when using the form to action a task. Notice you cannot change the values on the display form. (Recall that you configured the Review Document step to use the display form and not the edit form.) Select the Rework Required action and Submit the form. Click OK when you see the success dialog. Close the browser window for the form.
- Returning to the Documents to Review and Approve list, confirm the second document status reflects Rework required.
Resubmit the document for review
-
As the originator of the Document Review Workflow, open your email client, then locate the task notification email for the rework task. Click the worklist item link to launch the rework form. (Optional: you can open the document and make changes to the document, just be sure to save the updated document back to the SharePoint library and check the document in before resubmitting the document for review.) Resubmit the document for review.
- Open the email client for the originator who submitted the document for review (this is again, your email client - it may already be open). Locate the task notification email for the rework task. Notice that your only option is to open the task form from the email. This is because you changed the message body so that the user cannot action the task via SmartActions (by replying to the email). (If a document requires rework, you would assume that the submitter needs to rework the document rather than just replying to the email.) Click the worklist item link to launch the form.
- On the task form, select the Resubmit action. Click OK for the confirmation dialog, then close the browser window.
- In the Documents to Review and Approve library, confirm the document review status for the second document now displays Rework Resubmitted.
Process the second document reviewer user task
-
Open the email client for the second document's reviewer (if it is not you - otherwise, return to your email). Review the document, then reply to the email with the Reviewed and Accepted decision.
- On the Documents to Review and Approve library, confirm the Review Status displays
Reviewed and Accepted for the second document.
- Open the email client for the second document's reviewer (if it is not you - otherwise, return to your email). Review the document, then reply to the email with the
Reviewed and Accepted
decision. - Return to the Documents to Review and Approve library and confirm the review status now reflects Reviewed and Accepted.
Submit the first document to the Document Approval Workflow, then reject the document
-
From the K2 Workflows page, submit the first document to the Document Approval Workflow.
- Ask the document approver to review the task notification email, then reply to the email to reject the document.
- Confirm the document Approval Status displays Rejected.
- Review the workflow history for the first document. You should see two workflows listed, one for the Document Review Workflow and the other for the Document Approval Workflow. Use the View Flow reports to investigate the history for each of the workflows.
- In the Documents to Review and Approve library, use the context menu to open the K2 Workflows page for the first document that you uploaded.
- Start the Document Approval Workflow.
- Return to the document library and confirm the document Approval Status displays Pending Approval.
- Ask the document approver (it could be you) to open their email client and review the document approval task. Ask them to reply to the email with
Rejected.
- Verify that the document’s Approval Status displays Rejected.
- Open the Approved Documents library. Confirm the first document is not displayed, because it was not approved.
- Open the K2 Workflows page for the first document.
- Two different workflows appear in the Workflow History list, because you submitted the first document to two different workflows. If time allows, open the View Flow report for each of the workflows.
Submit the second document to the document approval workflow, then approve the document
-
From the K2 Workflows page, submit the second document to the Document Approval Workflow.
- Ask the document approver to approve the document by replying to the task notification email.
- Confirm the first document moved to the Approved Documents library.
- In the Documents to Review and Approve library, use the context menu to open the K2 Workflows page for the second document that you uploaded.
- Start the Document Approval Workflow.
- Ask the document approver (it could be you) to open their email client, then reply to the task notification email with
Approved.
- Open the Approved Documents library. Confirm K2 moved the first document to the new library. (It may take a minute or so - refresh the page if necessary.)
Review
In this step, you tested two workflows that integrate with SharePoint libraries. Some of the more interesting concepts include:
- Working with documents
- Building workflows with rework loops
- Including documents as email attachments
- Starting workflows on-demand for library items (manually)
By now, you have the basics for working with K2 for SharePoint applications. In the next step, you have a brief introduction to the K2 Designer, where you will edit several views.