connecting-systems-services-integration-suite-codejam

Optional Exercise 04.2 - Add the America’s instance of the Business Partner Dependants service

In the previous exercise we set up the communication between our integration flow and the European instance of the Business Partner dependants service. In this exercise, we will extend our integration flow to also send requests to the Americas instance. We will repeat various of the steps carried out in exercise 04.1, helping us reinforce what we’ve learned, introduce a new component - local integration processes, and add some additional conditions to handle the new instance.

Connect the integration flow to the European instance of the BP Dependants service

Exercise - Data flow

Now that we are familiar with the basics of SAP Cloud Integration…..

Integration flow - End of Exercise

Integration Flow - End of Exercise

At the end of this exercise, you’ll have successfully added America’s instance of Business Partner service to the integration flow.

Design > Integrations

👉 Let’s start by making a copy of the integration flow we created in Exercise 04.1, add the - Exercise 04.2 suffix to the name and open it.

As stated in the previous exercise, you might want to add a suffix to the address in the HTTP Sender adapter, e.g. -ex42, so that the address /request-employee-dependants-ex42 doesn’t clash with the one configured for our previous integration flows.

In SAP Cloud Integration it is possible to define integration processes (smaller) within an integration process. This is called a local integration process. The idea behind fragmenting our integration process into smaller processes is to make our integration process more readable and easier to maintain.

Move EU components to a Local Integration Process

There is no need to redo our call to the EU instance, we can just move the components to a local integration process and rewire the components. The below instructions will show you step by step on how you can achieve this.

👉 Add the Process Call step in the main integration process and create a new local integration process.

Add process call and local integration process

Add process call and local integration process

👉 Remove the existing connections of the Groovy script and Request Reply steps and move them to the EU - Integration Process.

Remove connections and move elements

Remove connections and move elements

👉 Assign the EU - Integration Process in the Process Call step.

Assign local integration process

Assign local integration process

You can save and deploy the exercise 06 integration flow. If everything has been set up correctly… you can send a message to it and it should behave the same as the integration flow deployed in exercise 05. The difference is that we’ve encapsulated the call to the EU instance in a local integration process.

Create Local Integration Process for Americas instance

The Americas instance set up is very similar to the one we completed in the previous exercise for the European instance. Meaning that many of the configuration steps that we need to carry out are the same.

👉 Carry out the steps below:

If you are running the services used in this CodeJam locally 🐳 , checkout how you will need to configure the Receiver HTTP Adapter in the Configure HTTP adapter in Cloud Integration section of the optional exercise 01.

Once you’ve carried out all the steps above, your integration flow will look like the screenshots below.

Main integration process

Main integration process

European and Americas local integration processes

European and Americas local integration processes

Deploy

👉 Save and deploy the integration flow.

If the deployment process fails with an error similar to this: Failed to create route - HTTP address already registered, add a suffix to the address in the HTTP Sender adapter, e.g. -ex6, so that the address /request-employee-dependants-ex6 doesn’t clash with the one configured for our previous integration flow, and try deploying it again.

Our integration flow is now ready. Let’s send some messages to it using Postman.

👉 Open the Request Employee Dependants - Exercise 04.2 request under the cloud-integration folder in the Postman collection and test the following scenarios:

Summary

We’ve added a couple of local integration processes to our integration flow. This makes our integration flow more readable, when compared to having everything in a single integration flow.

Further reading


If you finish earlier than your fellow participants, you might like to ponder these questions. There isn’t always a single correct answer and there are no prizes - they’re just to give you something else to think about.

  1. Can you think of how this process would be different if one of the instances required OAuth 2.0 authentication? Where would we store the credentials? How will we get a new token?
  2. Given that the process carried out to call the instances is very similar, it is possible that we could create a single local integration process to handle it. How could we achieve that?

Next

Continue to 👉 Exercise 05 - Log requests in BigQuery