iris-ftp-sample

Downloads7
Subscribe
0
Bookmark
1
This application is not supported by InterSystems Corporation. Please be notified that you use it at your own responsibility.
Details
Releases
Reviews
Issues
Articles

What's new in this version

Initial Release

Gitter Quality Gate Status Reliability Rating

iris-ftp-sample

This is a sample how to use FTP Adapter (Inbound and Outbound).

What The Sample Does

This sample has an interoperability production for:

  1. Receive CSV data using FTP Inbound Adapter into a LoadCSVFTPBusinessService Business Service and send its content to a LoadCSVFTPBusinessOperation Business Operation to persist the content in a Persistent class using csvgen.
  2. Do CDC (Change Data Capture) on Payment table using SQL Inbound Adapter into a PaymentSQLBusinessService Business Operation and send table data (inside a JSON file) to a SendSQLDataToFTPBusinessOperation Business Operation for put the json file into FTP server.

Here you can see this production: FTP Sample Production

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 iris-ftp-sample"

Installation: Docker

Clone/git pull the repo into any local directory

$ git clone https://github.com/yurimarx/iris-ftp-sample.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

  1. Create the credentials to access the FTP server (Go to Interoperability > Configure > Credentials):
    • ID: FTPCredentials

    • User Name: irisuser

    • Password: sys

    • Here is likes look it:

Credentials for acessing the FTP server

  1. Open the production and start it. It is the production:

Credentials for acessing the FTP server

  1. Open a FTP client (I'm using Filezilla) and put the input/countries.csv file into the root FTP folder:
    • Host: localhost
    • User name: irisuser
    • Password: sys
    • Image showing how to put the file on FTP server root folder:

FTP Client

  1. Go to the System Explorer > SQL and type SELECT country, latitude, longitude, name FROM dc_irisftpsample.Country. See here likes look the csv data loaded into the sql table:

Select csv results

  1. Go to the System Explorer > SQL and type insert into dc_irisftpsample.Payment(amount payer, receiver, transactiondate) values(100.0,'Yuri','Fabiana', CURRENT_TIMESTAMP). See here likes look the JSON file into the FTP server with the data inserted:

Select csv results

How to work with this sample

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

IPM installation
zpm "install iris-ftp-sample"
Rating
5 (1)
ObjectScript quality test
Passed
Updated on 28 November 2023
ObjectScript quality report
Category
Technology Example
Works with
InterSystems IRIS
Tags
Info
Version
1.0.0
Last updated
2022-09-26
Repository
Open
Documentation
Open
License
Link