Sample Application for Collaboration in SAP Cloud Platform Workflow with SAP Jam
This sample workflow application shipped as part of SAP Web IDE, helps you to experience collaboration feature in SAP Cloud Platform Workflow using SAP Jam.
Steve is the head of business accounting in ITeLo (an imaginary company) and is responsible for the audit reports of financial statements. For his job, Steve is in contact with people from all over the world to get things done. But Steve has a problem right now – audit documents are reviewed manually. The manual processing of documents leads to an inefficient global collaboration due to duplication of data and limits the information on its current status.
Steve now has SAP Cloud Platform Workflow to orchestrates the entire audit review process and SAP Jam to manage the document involved in the audit review process and also for collaboration.
My previous blog has detailed information about the complete problem statement, solution architecture and also gives an idea about what you can achieve with the sample application.
Before you proceed with creating a workflow from the sample application, there are some pre-requisites required to:
- Get access to SAP Cloud Platform and Enable Workflow Service.
- Enable SAP Jam Service.
- Setup trust between SAP Cloud Platform and SAP Jam.
- Setup SAP Jam Group for uploading the documents.
- Identify SAP Jam Endpoint URLs & folder IDs.
Import and Configure Sample Application
Import Sample Application to SAP Web IDE Full-Stack
- Log in to Cloud Platform Cockpit and open SAP Web IDE Full-Stack. For more information, see Opening SAP Web IDE.
- Enable Workflow Service feature if you are using workflow service for the first time in your account. Refer to the help document to enable Workflow Service in SAP Web IDE Full-Stack..
- Download the source code from the workflow samples git repository.
- Import the source code into SAP WebIDE and name the project as sample.collaboration
- The sample.collaboration application should be imported into the workspace and should look like as shown in the screenshot below:
- Expand the application project sample.collaboration. The workflow model DocumentAuditProcess.workflow is found under the workflows folder.
There are three major phases of the document audit process – Review, Approval & Final Sign-Off.
During the review, four parallel tasks will be created for reviewers from different departments. Once all of them have completed their review, two parallel approval user tasks are created for the head of the departments. Once both the approvers have approved the document, a user task is created for a final sign-off. If any of the reviewers or approvers rejects the document, then a task is created for the requestor to update missing information as requested.
Configure Sample Application
- Expand the project the sample.collaboration and open the configuration file located in the folder appstartui -> configuration -> configuration.json.
Note: This JSON file will contain all the information required to connect to the Jam endpoint to load the document feed widget and the details about reviewers and approvers. Ideally, a business rule should determine the reviewers and approvers, but the sample application will get that information from the configuration file for simplicity.
- Under the SAPJamConfigurations node, enter your Jam base URL, feed bootstrap URL, account feed endpoint, group id and the folder IDs copied during the pre-requisite.
- In the Requestor and Approvers node, enter the userIDs in upper case (your SAP Cloud Platform userID in Trial accounts) who should get the tasks in My Inbox application. This user should have access to My Inbox application in SAP Cloud Platform, and also part of the ‘Document Approvals’ group created as part of pre-requisite step.
- Save configuration.json file.
Deploy Sample Application
- Under the workflows folder, right-click DocumentAuditProcess.workflow and choose Deploy -> Deploy to SAP Cloud Platform Workflow.
- Right-click the project sample.collaboration and choose Deploy -> Deploy to SAP Cloud Platform.
Execute Sample Application
Follow the steps below to execute the Document Audit Review sample application which has been deployed:
Start Document Audit Workflow
The SAPUI5 application to initiate the workflow is available as part of the sample application which you have deployed. Follow these steps to access the SAPUI5 application:
- Right-click on the sample application project, and choose Deploy -> Application Status.
- In the Application Status pop-up, click on the application URL to access the SAPUI5 application to start the workflow.
- Enter the details as shown in the screen below. Use the drop-down wherever it is available.
- Click on Browse button to choose a document (with extensions like .doc, .docx, .xls, .xlsx, .pdf, .jpg) from your local file system.
- Enter Comments for Reviewers and click the button Send for Review.
- A pop-up should give a confirmation that the document should be uploaded in SAP Jam and a workflow instance should be created for the review process. If you are getting any error, please make sure you have completed the pre-requisites.
- Click the hyperlink Link to Document to access the document uploaded in SAP Jam.
- Observe that the document is uploaded to the folder Documents for Approval in SAP Jam. The comment added in the SAPUI5 application should also be available in SAP Jam as document feed.
- Go to SAP Cloud Platform Cockpit, select Services and search Workflow service.
- Click on Workflow tile and navigate to Workflow Service overview page.
- Click the hyperlink Fiori Launchpad (Default Site).
- Once logged in to Fiori Launchpad you should see a Fiori tile called My Inbox. If that tile is not available, then click on the user icon and then App Finder icon.
- Select workflow catalog and pin My Inbox, Monitor Workflows -> Workflow Definitions and Monitor Workflows -> Workflow Instances applications to the group My Home. If you do not see any apps, then you are missing the appropriate roles of Portal service (example, TENANT_ADMIN). Follow this help document to assign the role for yourself.
- Once you are out of the edit mode, you should have the three Fiori apps available in your Fiori Launchpad, and you should see four tasks available in My Inbox application. Click the My Inbox tile.
Note: In a production scenario, the tasks are assigned to different users and could be based on a business rule. Since SAP Cloud Platform trial supports 1 user only, we are assigning all the task to the same users. If you already have an SAP Jam in factory landscape, you could correspondingly modify the configuration.json file to assign tasks to different users or set up business rules to determine approvers and reviewers based on the document properties.
- Click on the first task in the list, and you should see all the details about the document which is in the review. There are three sections in the custom task UI –
- Information: This section contains the information which was provided while starting the workflow like document type, project name, etc. You also will find a link to the document available in SAP Jam.
- Reviewers: This section lists all the reviewers as chosen while starting the workflow and the review status.
- Comments: This section has an embedded SAP Jam document feed widget. All the comments available for the specific document in SAP Jam will be shown here. You can also add new comments, reply/like to existing comments, bookmark, share or delete your comments, etc.
- As a reviewer, you can access the document from SAP Jam add your contributions or upload a new version of the document in SAP Jam. You could also provide your comments (either a new comment or reply to an existing comment) in the Comments section and Approve the task. You could also invite contributors to the document using the @mentions. Refer to the SAP Jam collaboration guide to know more about collaboration using the document feed.
Note: To add additional contributors to the document who are not part of the audit review process, you could use the @ mentions. These users will get notifications in SAP Jam (can also configure to receive email notifications) and can provide their contributions directly in SAP Jam. Keep in mind that these users should be part of the SAP Jam tenant and have access to the SAP Jam group where the document is uploaded into.
- Click Approve button to complete the assigned task.
- Similarly, complete all the ‘review’ tasks assigned by clicking the Approve button.
- Once all the review tasks have been completed, click on the refresh icon in My Inbox task list and you should see two new approval tasks in your Inbox.
- Click the first task in the list.
- As an approver, you can access the document in SAP Jam through the hyperlink available in the Information Once you have verified that the document is acceptable, click Approve button to accept the document.
Note: The document feed is available for approval tasks as well under the Comments section. The feed widget will contain all the comments provided by the requestor, reviewers, and contributors (if any)
- After verifying the document click Approve button to complete the approval task.
- Similarly, complete the other approval task as well.
- Once the document is approved by both external auditor head & head of group reporting, another task is created for a final sign-off.
- Click Confirm button to complete the final sign-off.
- With this task, the document audit workflow is complete, and the document is marked as ‘final.’ You can observe that the document in SAP Jam is moved from Documents for Approval folder to the Approved Documents as shown below.