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:
- Ensure that you have the necessary roles and authorizations as mentioned in Prerequisites.
- You have enabled the Workflow Editor in SAP Web IDE. For more information, see Enable the Workflow Editor in SAP Web IDE.
- You have created a new workflow project. For more information, see Create a New Workflow Project.
- You are on-boarded to the tenant/account. For more information, see this.
- You have an existing status network associated to collaboration type. For more information, see Configure Collaboration.
- You are aware of the status codes. For more information, see Creating a Status Profile.
- You are have an existing Collaboration, which you can view in My Collaboration app.
- 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.