Blog 5: Content Enricher Pattern in Integration Flows
Hello Integration Community !
In this blog, I shall explain the content-enricher pattern of SAP Cloud Platform Integration (f.k.a HCI) and how you can use it in your integration project.
What is the Content Enricher Pattern?
From the definition of Enterprise Integration Patterns, a content enricher accesses an external data source in order to augment a message with missing information.
Let’s take an example from the HR domain. In the SuccessFactors(SFSF) suite, we can obtain information on employee object entity.I get the job location code from the results. But, I want to send the complete job location and not just the job code and the job location is stored in a different entity. So, I enrich my data with the job location using a content enricher step.
Likewise, one system may provide us with a order ID, but the receiving system actually requires the associated customer ID associated with that order.
Content enricher is a very common integration pattern.
How to Use the Content Enricher?
In SAP Cloud Platform Integration, content enricher is available as a Service Task.
We shall take the following integration flow as an example:
The first call to SFSF shall return the compound employee data. This is how the data looks:
We are interested in enriching the job information. So, let us take an expanded look into it. In the expanded view, take a closer look at the location field. We are interested in enriching that particular field with the exact address details.
So, to achieve our purpose we shall use the Content Enricher step with the following configuration.
The Lookup message depends on the address location entity.The entity to which you are querying. So, the final output or the enriched output shall look like the one below.
Note: Content Enricher also has another option – Combine. That is a very simple logic of combing the two elements. Employee information and Job information query results are combined together into one entity. For fun, for the same objects we saw above – the result looks like this:
In the current version, the Content Enricher step works well with SuccessFactors system. For SOAP-based scenarios, the entire payload goes to the sending look-up system. If you do not want the entire data to go, you would have to employ the data store step and the content modifier step.