Skip to content

evshvarov/i14y-csv

Repository files navigation

Gitter Quality Gate Status Reliability Rating

iris-interoperability-csv-example

This is a simplest example to transform one CSV to another (using Record Mapper)

What The Sample Does

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:

  1. 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.

  2. 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.

  3. 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.

  4. After transfomration every record is being written one-by-one into the file with the same name in /out folder.

Prerequisites

Make sure you have git and Docker desktop installed.

Installation: ZPM

Open IRIS Namespace with Interoperability Enabled. Open Terminal and call: USER>zpm "install esh-i14y-csv"

Installation: Docker

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
  1. Run the IRIS container with your project:
$ docker-compose up -d

How to Run the Sample

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.

Additional information

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: Screenshot 2020-10-29 at 20 15 56

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published