Introduction:
As an Integration developer, sometimes you may use same sub-process or process multiple times and sometimes the same subprocess is required to use in another Integration process. For this kind of situations, we can handle via below approach. There may be multiple Integration processes in one single main Integration process (In one Artifact).
Motivation:
You have a scheduled flow and now you want to trigger it explicitly via an endpoint for adhoc or test
runs.
Solution:
Assume you have the following scheduled run that runs every day at 9am.
Now you also want to be able to trigger this flow through an endpoint.
Create a local sub-process and move all the above logic to it.
Now create 2 main integration flows:
1) Scheduled flow: will get triggered every day at 9am and pass the control to the sub process.
2) Externally triggerable flow: will receive the call and pass the control to the above sub-process.
Both will then receive the request and pass it to the common sub-process for processing.
Add an Exception Sub-process to the sub-process and end it with Error End Event so that the Exception.
state is sent back to the main process. Note that in monitoring, both the integration flow executions will have the same name.
You can move these into different integration flow artifacts and call each other through SOAP endpoints.
This however has a disadvantage. Every call to another integration flow (even if it is deployed on the
same tenant) shall be an out-of-the-tenant call. This will have performance implications on the process execution.
Note:
Please note that there is a development topic planned by SAP in future release that will solve this – so calls to other artifacts that are deployed on the same tenant shall be executed as in-process calls.
Conclusion –
Hope this document will help to beginners to understand CPI concept of Creating an endpoint and how to trigger a scheduled flow via endpoint. Happy Learning 🙂