SAP Cloud Platform Workflow Management has workflow capability, enable customers to automate processes. Complex workflow applications require modularization of workflows to enable reuse and better maintenance. Referenced Subflow simplify workflow models and make it more intuitive to both developers and process owners.
SAP Cloud Platform Workflow management has released Referenced Subflow feature. You can include a workflow as a referenced subflow from another workflow. The parent workflow waits until the referenced subflow has completed the execution.
A workflow can be consumed as referenced subflow from a parent workflow. In the below screen shot a parent workflow (Investment Approval) is using the referenced workflow artifact and using a child workflow (Cost Center Owner Approval). The same workflow is also used in Group Head Approval step.
Add Workflow as Referenced Subflow
In the Referenced Subflow properties, add workflow definition Id of the child / referenced workflow.
Enabling principal propagation will use the credentials of a user while invoking the referenced subflow.
Workflow Context Mapping
A referenced subflow requires context mapping to exchange workflow context as input and output.
Workflow context from the parent workflow is mapped to the child workflow. This is used as the start payload of the child workflow. You can include multiple workflow context elements as input mapping.
Source context path – Parent workflow context path.
Target Context Path – .Workflow context from Referenced Subflow.
In this scenario both parent and child workflow are using the same JSON elements as workflow context. It is possible to have different elements as source and target context path.
Referenced Subflow or Child workflow context is mapped back to the parent workflow as response.
Source context path – Workflow context from Referenced Subflow.
Target Context Path – Parent workflow context path.
In the above screen shot, decision from approver is mapped to parent workflow. Comments are appended to the existing comments in parent workflow context element.
At the end of the Referenced Subflow execution, workflow context is mapped to the parent. The parent workflow context element is overwritten.
Interested to do a hands on using Referenced Subflow and other interesting Workflow Management features. Please join SAP TechEd 2020 – DEV 264 Deep dive into SAP Cloud Platform Workflow Management.
Refer SAP Cloud Platform Workflow help for more details.