….or how to ‘Map the Source XML Element NAME and VALUES to Targets’.
I thought that we’d share a tip regarding using the ‘Code’ facility in OIC to build more complex XSLT in mapper actions.
We had a requirement to create a scheduled OIC integration that would get some exchange rate values from an external provider using an API, and to transform those values into rows of data for a CSV input file which would then be loaded in Oracle ERP Cloud using the ‘Import and Calculate Daily Rates’ FDBI loader.
The API that we were using to obtain the exchange rates data created output XML data like this:
<response-wrapper xmlns="https://someAPI/exchangerates/types">
<success>true</success>
<timestamp>1661176743</timestamp>
<base>USD</base>
<date>2022-08-23</date>
<rates>
<EUR>1.002815</EUR>
<GBP>0.84892</GBP>
<AUD>1.452749</AUD>
<CAD>1.30383</CAD>
</rates>
</response-wrapper>
But we needed to create some CSV file input like this for the ‘Import and Calculate Daily Rates’ FDBI loader …
USD,EUR,2022/08/23,2022/08/23,Corporate,1.002815
USD,GBP,2022/08/23,2022/08/23,Corporate,0.84892
USD,AUD,2022/08/23,2022/08/23,Corporate,1.452749
USD,CAD,2022/08/23,2022/08/23,Corporate,1.30383
In this short video we look at the normal mapper, code page for the mapper and the test page that helped us work through the solution.
Until next time…