Integration Flows with Open Connectors on BTP Integration Suite (Email)
A key part of an SAP Cloud Integration project is to develop Integration Flows. An Integration Flow allows you to specify how SAP Cloud Integration is to process a message. SAP Cloud Integration provides a modeling environment that allows you to design the details of message processing (its senders and receivers as well as the individual processing steps) with a graphical user interface.
Prerequisites
An active subscription to the Integration Suite in SAP BTP
Assign the necessary capabilities to the Integration Suite.
Assign the correct user role for the activated capabilities.
A subscription to a Retarus cloud REST API product eg, SMS API, Email API, Cloud Fax API
Retrieve the necessary login ID credentials from Retarus.
A running instance of an Open Connector to the required Retarus service
Get the endpoint to call the Open Connector.
Get User, Organization and Element from the Open Connector instance to create an access key.
Creating an Integration Flow
1. Creating an integration package
→ Before designing any integration flow, create an integration package first and, within this integration package, create an integration flow.
Looking at the menu on the left, if something is missing istead to this picture, please check the assigned capabilities and roles.
2. Creating credentials
→ Create a set of credential so that the Integration Flow will be able to access the Open Connector.
To do this, go to Monitor - Integration and APIs:
On the landing page, click on Security Material in the Manage Security section:
3. Getting credentials
→ The next page shows the list of all the credentials created. Click on Create on the top right and then on User Credentials in the dropdown menu.
4. Defining settings
→ In the pop up box, select OpenConnectorsin the Type dropdown menu:
→ Fill in the mandatory data:
User, Organization and Element must be retrieved from the Open Connector instance which should be used in the Integration Flow (Check the point create instance in the Cloud Fax/SMS/Email Connector on BTP tutorials).
A different set of credentials for every Open Connector Instance (even within the same kind of connector) as the Element changes every time.
Once all the fields have been filled, click on Deploy and the new set of credentials will be displayed in the list mentioned in the previous step.
5. Building an integration package
Now, the Integration Flow can be created by building an integration package. Every integration package may contain multiple Integration Flows.
→ Go to Design - Integration and APIs:
6. Viewing integration packages
The list of Integration Packages will show up (It is empty when the first integratio flow is generated):
→ Select Createon the top right corner to create a new Integration package.
7. Filling in mandatory fields
→ Fill in the mandatory field in the Headertab:
→ Click on Savein the top right corner and then on the Artifacttab.
8. Adding the integration flow
→ Click on Addand select Integration Flow from the dropdown menu:
→ Fill in the required data and a description that may help in understanding what this flow does:
→ Once you filled the form, select the Add button.
9. Viewing the created integration flow
The Integration Flow has been created and it is added to the list of Artifacts of the actual integration package:
→ To edit, just click on anywhere on the line in the list.
The basic structure that has already been created is shown:
Now, depending on the method of the API implemented with the Open Connector, different settings are necessary.
Integration Flow - How to POST a Job
After completing the steps above, you are now ready to POST a job.
How to POST a job
1. Connecting to the Integration Flow
As a first step, connect the Sender to the Startof the Integration Flow. To do so, click on the arrow (Connectors) featured in the top menu bar.
By moving the mouse close to the Sender, a frame with connecting points will appear.
Click on the point of the right side or the one in the middle and draw a line until a similar connecting point at the center of the Startcircle is reached.
Once the two elements have been connected, a pop up window will show up. Select HTTPSfor the connection type.
2. Setting up the connection
It is now necessary to set up the connection. Click on this icon at the bottom right corner:
This will show up the property setup window, which will be used from now on to define all the parameters needed by the flow.
Different properties will be displayed in this window depending on the element selected on the graphical editor. Click anywhere in a blank space, the general flow properties will be displayed.
Click on the connecting arrow HTTPS to see its properties, then select the Connectiontab:
3. Disabling CSRF protection
Deselect CSRF Protected.
The Addressdepends on the type of Retarus service to be posted.
Now, when a message is received over HTTPS from the Integration Flow endpoint, the automation designed in the flow will be triggered for execution.
4. Configuring a send back element
The next step is to add an element capable of sending back to the sender the answer received by the called Retarus service (i.e. a message with the job ID).
From the top menu, select Call => External Call => Request Reply:
Then, hover the mouse pointer to the arrow connecting Start and End:
Click on it to add the Request Reply element:
5. Connecting the Request Reply element with the Receiver
Request Reply must now be connected to the Receiver.
Drag the Receiver element underneath Request Reply then click on this one to make its context menu appear and use the Connector Icon (the arrow) to draw a connection between Request Reply and Receiver(keep clicked and drag to the Receiver):
6. Configuring properties for OpenConnectors
Once the Receiver has been connected, a pop-up window appears in which the Adapter Type can be selected.
Scroll down until OpenConnectors and select it:
Now, look at the properties window and select the Connection tab:
Change Method to POST.
Push the Selectbutton near the Credential Name field.
Select the set of credentials for the Open Connector to call:
Enter the Base URI of the Open Connector endpoint in the proper field.
The Base URI you get from the Open Connector instance is something like "https://api.openconnectors.../elements/api-v2/{part depending on the service}". Here you have to enter everything from "https" to "api-v2". What follows "api-v2" must not be entered here.
7. Choosing resources
Click now on the Select button near the Resourcesfield to open a pop up window. Here select the proper resource from the Open Connector to POST the job.
Of course, depending on the called Open Connector, this list may completely change. Here is an example:
The Resourcesto choose depending on the service are:
Fax-for-Applications /{cuNo}/fax //Note: you can leave {cuNo} but it requires a dynamical replacement of the customer number at runtime, which is an advanced feature beyond the scope of this tutorial. If you don't know how to do //it, replace it with the chosen customer number to get something like /12345/fax
Transactional Email /rest/v2/jobs
SMS-for-Applications /rest/v1/jobs
8. Finishing the deployment
Once the Resourcehas been correctly selected, click on Save in the upper right corner and all the eventual errors that may still be highlighted should disappear (if everything is correct).
The Integration Flow is now completed and can be deployed, so click on Deploy, again in the top right corner of the editing area.
Click anywhere in a blank area of the design window, the properties window will show the general properties of the Integration Flow. Select the Deployment Stats tab to check when the deployment is finished and if it has been completed without errors:
Click on Navigate to Manage Integration Content to move to the page where you can find the endpoint to call this Integration Flow to send your jobs. for instance:
The part after "/http/" changes depending on the specified Resource.
To access this endpoint you will need to use a basic authentication method. The username and the password to log in are the Client Id and the Client Secret you have to get from the set of credentials associated to the Integration Flow Runtime instance of your sub-account. Check this tutorial for reference about how to create or find the credentials: SAP BTP - Creating Credentials for Services.
JavaScript errors detected
Please note, these errors can depend on your browser setup.
If this problem persists, please contact our support.