Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
ayan_pandey
Advisor
Advisor
991

Solution Introduction:


SAP Intelligent Product Design offers an ultimate cloud-based solution that empowers you to design your digital products faster. The solution consists of the collaboration and engineering capabilities. Further read.

SAP Cloud Platform Workflow lets you build, run, and manage workflows, from simple approvals to end-to-end processes that span across organizations and apps. Further read.

How-to:


Wondering how could we change the status of the Collaboration automatically in SAP Intelligent Product Design!

It can easily be achieved via the workflows. Furthermore, just not status, but many other collaboration attributes can also be changed, through the same mechanism.

Before you start, some pre-requisites:



  1. Ensure that you have the necessary roles and authorizations as mentioned in Prerequisites.

  2. You have enabled the Workflow Editor in SAP Web IDE. For more information, see Enable the Workflow Editor in SAP Web IDE.

  3. You have created a new workflow project. For more information, see Create a New Workflow Project.

  4. You are on-boarded to the tenant/account. For more information, see this.

  5. You have an existing status network associated to collaboration type. For more information, see Configure Collaboration.

  6. You are aware of the status codes. For more information, see Creating a Status Profile.

  7. You are have an existing Collaboration, which you can view in My Collaboration app.

  8. You should have the cpdcWF destination configured in SAP Cloud Platform. For more information, refer configure destination.


All you need to know for modeling workflow, refer the Admin Guide.

Let's start:


The following illustration depicts the mechanism necessary for dynamically changing the collaboration status via the workflow tasks.


Change collaboration status via workflow


 

The following excerpt from the Workflow editor, shows the mechanism necessary for dynamically changing the collaboration status via the workflow tasks.


Change collaboration status via workflow in WebIDE


Step 1:

Sample User Task: Reset Collaboration Status


General tab



Details tab



User Interface tab


You should map the workflow property for the context sContributor in Workflow Property Mapping app. For more information, refer Mapping Workflow Property.

Step 2:

Sample Script Task: Prepare Collaboration


Script Task Properties




  • Sample script for PrepareCollaboration.js


$.context.UpdateCollaborationDest = "/odata/v1/CollaborationSet('" + $.context.reqBody.entityId + "')";

$.context.oCollaborationUpdateBody = {
Status: "INPRO" // reset status based on requirement
};


  • Assumption: Your next status ID for the Collaboration is INPRO. (To refer to Status Network code: Go to Configure Collaboration App > Status Profile > Select Status Profile > View the Statuses and corresponding Status IDs)

  • You can copy and paste the script into the js file PrepareCollaboration.js

  • Then associate the script file to script task.


Step 3:

Sample Service Task: Update Collaboration Status


General tab



Details tab


You should have the destination already set-up in SAP Cloud Platform. For more information, refer configure destination.

Step 3:

Save and deploy the workflow definition.

Happy reading. For any queries, please share your comments.

2 Comments