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.
Follow this blog to complete the pre-requisite to setup the environment.
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.
Your blogs are very interesting and it has very clear steps on how to learn the new topics. Any idea when we can expect the custom tab addition in Instance details page for OPINT.(https://blogs.sap.com/2016/08/20/ui-extensions-in-opint-a-new-world-of-possibilities)
The blog is very helpful for the building the custom workflow process on cloud.
The document storage is one necessary part of the workflow.
How do you think the difference between the SCP document service and document storage of Jam service? any data authorization issue if use document service instead?
SCP Document Service is a CMIS-standard document management solution, while SAP Jam is a collaboration platform. If the purpose is to only persist documents that need to be accessed from a workflow user task, then you can go with either of the two services (my personal recommendation is SCP document service). But if you want multiple people to work collaboratively on the same document, then your only option will be SAP Jam.
There won't be any authorization issue when using SCP document service, assuming that Workflow and Document Services are enabled in the same SCP tenant. I will shortly write a blog on how to use SCP document service with SCP Workflow. But if you want a short-term answer then you can refer to the help document on how to consume document service from an external application. The idea is to persist any document and access the same from workflow task UI using the CMIS proxy URL, repo id, root id, and object id.
Thanks Sesh for your clear explanation. It is very helpful!!
I have also added a blog to explain how to use document service with SAP CP workflow.