Improved docker start (because of Robert Cemper advice)
Fixed /in /out folders
Added *.csv filter
Added dc article
This is a simplest example to transform one CSV to another (using Record Mapper)
To make the production run copy data/data.csv and paste into /in folder. the transformed data.csv should appear in /out.
It is an example of using IRIS interoperability to transform data in CSV using Data Transformation class.
What this interoperability does:
It transforms csv with Farenheit temperature data observations and results into csv with temperature in Celsius.
it expects csv files in the /in folder with the structure of two columnns: 1-day of obser (integer), 2 - temperature in Farenheight (integer). Here is an example.
Every record of the incoming csv is being send as an interoperability message to transformation rule. I used RecordMapper to generate the message object class and to use record mapper class to parse incoming csv and to write csv in a resulting file.
Interoperability production waits for csv in /in folder and then takes every record from csv as a message to a routing rule, which uses Data Transfomration for all the records.
After transfomration every record is being written one-by-one into the file with the same name in /out folder.
Make sure you have git and Docker desktop installed.
Open IRIS Namespace with Interoperability Enabled.
Open Terminal and call:
USER>zpm “install esh-i14y-csv”
Clone/git pull the repo into any local directory
$ git clone https://github.com/evshvarov/i14y-csv.git
Open the terminal in this directory and run:
$ docker-compose build
$ docker-compose up -d
Open the production and start it.
It will start gathering news from reddit.com/new/ and filter it on cats and dogs into /output/Dog.txt or /output/Cat.txt files.
You can alter the business rule to add any different logic. initialy all the messages follow one transformation.
You can also check how the transformation works. Here you can see the simple logic of changing Farenheit data to Celcius.
This repository is ready to code in VSCode with the ObjectScript plugin.
Install VSCode, Docker and ObjectScript plugin and open the folder in VSCode.
Use the handy VSCode menu to access the production and business rule editor and run a terminal: