In conjunction with Education & Sharing Day which falls on 5th April 2020 this year, Int4 is running a programming challenge as part of our ongoing initiative, #Int4Education, to promote knowledge sharing and lifelong learning.
It is my pleasure to present to all you CPI enthusiasts the programming challenge we have for SAP CPI. The idea is simple – in this blog post I will describe the programming challenge related to CPI, participants submit their solution, and the most creative ones (voted by us internally) will receive a prize – an SAP Press book authored by our Int4 team member(s).
While there is a tinge of competition involved, remember that at the end of the day, the main goals of the challenge are to promote learning and fun 😉
In our integration scenario, we are integrating with the public Northwind OData service (https://services.odata.org/V2/Northwind/Northwind.svc/). We would like to provide a plain REST service to query the orders from the OData service.
Following is the CPI iFlow that is used in this scenario. A version of it can be downloaded here.
To achieve the querying mechanism, the HTTP query parameters from the sender needs to be converted into the corresponding OData filter criteria. The iFlow accepts dynamic key-value pairs used for querying which should be stored in the property filterCrit used in the OData receiver channel as shown below.
Develop a Groovy script to generate the OData filter criteria from the HTTP query parameters. Some of the key aspects of the script should be as follows:
- Extract HTTP query parameter from header CamelHTTPQuery, build the OData filter criteria and store it in property filterCrit. Example:- from ShipCountry=Sweden to ShipCountry eq ‘Sweden’
- Handle dynamically the different fields available in the Orders entity set
- Handle different field types, e.g. numbers, String.
Following are the details for submission:
Deadline: 30 April 2020 – all time zones 😉
The results of the challenge will be published by 15 May 2020 in a subsequent blog post, and we will contact the winners directly to arrange for delivery of their prize.