Home Applications CSV Interoperability Transformation

CSV Interoperability Transformation

This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
5
1 reviews
0
Awards
219
Views
3
IPM installs
3
0
Details
Releases
Reviews  (1)
Issues
Articles  (1)
This app has a demo View
An example of CSV data transformation via IRIS Interoperability

What's new in this version

Improved docker start (because of Robert Cemper advice)
Fixed /in /out folders
Added *.csv filter
Added dc article

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

Made with
Install
zpm install esh-i14y-csv download archive
Version
1.0.212 Feb, 2023
ObjectScript quality test
Category
Technology Example
Works with
InterSystems IRIS
First published
08 Feb, 2023
Last checked by moderator
27 Jun, 2023Works