Blog > CPI challenge from SAP Mentor – Eng Swee Yeoh

CPI challenge from SAP Mentor – Eng Swee Yeoh

CPI challenge Eng Swee Yeoh
Eng Swee Yeoh SAP Mentor
icon__calendar 2020-04-03

Introduction

In conjunction with Education & Sharing Day which falls on 5th April 2020 this year, In4 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 :).

Let the Games Begin!

Background

In our integration scenario, we are integrating with the public Northwind OData service. 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.

querying-mechanism-HTTP-OData

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.

OData processing CPI

The challenge

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. Below are some examples:-

Table query parameters and filter criteia

  • Handle dynamically the different fields available in the Orders entity set
  • Handle different field types, e.g. numbers, String.
  • Each parameter can contain only single values, and the parameters cannot be repeated.
  • Only equality operator for the OData filter criteria is required.

Submission

Following are the details for submission:

Email: academy@int4.com

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.

Eng Swee Yeoh SAP Mentor
Go-to expert in SAP integration currently focusing on Groovy and Camel, digging deep into SAP Cloud Platform Integration (CPI).

Contact us

If for any reason, the thought of reaching out to us has crossed your mind, then by all means do not hesitate to get in touch with us, as we are more than happy to put to rest all of your concerns.