Navigation

Blog

Back

Start with Prospect IRIS & Integration Events

18 March 2016 by

Introduction


Prospect-IRIS is sample project for develop banking APIs. This project using IRIS and works with Temenos T24.

 

Prerequisite


 

Fork Github Repository


Goto https://github.com/temenostech/Prospect-IRIS and create a fork of Prospect-IRIS project

github_fork

After creating fork this project will available in your Github account

 

github_repo

git clone Prospect-IRIS into your development environment


Use any git scm tools to clone Prospect-iris into your development environment.

command to clone:

>git clone https://github.com/<github_userid>/Prospect-IRIS

or you can use any GUI tool to clone

tortoise_git

 

Once you clone, this project is available on hard drive

prospect-iris

Import Prospect-IRIS in to Design Studio


Double click on the DesignStudioT24.exe to launch Design Studio – Follow Setting up the Design Studio environment section in this guide https://temenostech.temenos.com/getting-started/getting-started-guide-for-an-iris-data-service/

Enter workspace name
Creating an IRIS template project 1

 

A default workspace will create. Now goto File -> Imports -> Existing Maven project

import_maven_project

 

Select the path where you cloned the Prospect-IRIS project

import_maven_project_list

After click on the Finish button you will see Prospect-IRIS in your workspace

prospect-iris-workspace

Build Prospect-IRIS in to Design Studio workspace


Follow below steps to build Prospect-iris in Design Studio

  1. Expand Prospect-iris-parent project
  2. Right click on Package.launch
  3. Click on Run As –> Package

prospect-iris-build

After click on Package project will start to build and you’ll see following message in console Window.

[INFO] ————————————————————————
[INFO] Reactor Summary:
[INFO]
[INFO] prospect-addressvalidation ………….SUCCESS [  4.656 s]
[INFO] Prospect-models …………………………SUCCESS [ 20.086 s]
[INFO] Prospect-iris-parent ……………………SUCCESS [  0.110 s]
[INFO] Prospect-models-gen ………………….SUCCESS [24:39 min]
[INFO] Prospect-iris ………………………………SUCCESS [ 29.627 s]
[INFO] ————————————————————————

 

Import Version/Enquiry from T24


There is small tutorial for import Enquiry/Version from T24 to inside your workspace. All the instruction available on the Import Enquiry section of this link https://temenostech.temenos.com/getting-started/getting-started-guide-for-an-iris-data-service/

 

Create Flow and Events in T24


To create a Flow in T24 Follow this 30 Minutes guide https://temenostech.temenos.com/getting-started/integration-events-30-minutes-guide/

In this guide you’ll create a Flow, associate a T24 Version or Application and publish to T24

 

GET Published Flow


Temenos Sandbox contains necessary API to get the published flow in POSTMAN. API /enqIntegrationFlowCatalogs() will fetch all the available flow in T24 but we want to GET the published flow according to FlowName.

Example: Below GET request will fetch the published Flow where FlowName=MarketPlaceDemo-FTMarketPlaceDemo

http://127.0.0.1:8080/MarketPlaceDemo-iris/MarketPlaceDemo.svc/GB0010001/enqIntegrationFlowCatalogs()?$filter=FlowName eq ‘MarketPlaceDemo-FTMarketPlaceDemo’

This will also give you the name of the fields on which events will generate

e.g.

<d:enqIntegrationFlowCatalog_FieldDefnMvGroup m:type=”Bag(MarketPlaceDemo-modelsModel.enqIntegrationFlowCatalog_FieldDefnMvGroup)”>
<d:element>
<d:FieldDefn>AMOUNT.CREDITED</d:FieldDefn>
</d:element>
<d:element>
<d:FieldDefn>AMOUNT.DEBITED</d:FieldDefn>
</d:element>
<d:element>
<d:FieldDefn>BASE.CURRENCY</d:FieldDefn>
</d:element>
<d:element>
<d:FieldDefn>BC.BANK.SORT.CODE</d:FieldDefn>
</d:element>
<d:element>
<d:FieldDefn>BEN.ACCT.NO</d:FieldDefn>
</d:element>
<d:element>
<d:FieldDefn>BEN.ACCT.NAME</d:FieldDefn>
</d:element>
<d:element>
<d:FieldDefn>BEN.BANK</d:FieldDefn>
</d:element>
<d:element>
<d:FieldDefn>CREDIT.ACCT.NO</d:FieldDefn>
</d:element>
<d:element>
<d:FieldDefn>CREDIT.AMOUNT</d:FieldDefn>
</d:element>
<d:element>
<d:FieldDefn>CREDIT.CURRENCY</d:FieldDefn>
</d:element>
<d:element>
<d:FieldDefn>DEBIT.ACCT.NO</d:FieldDefn>
</d:element>
<d:element>
<d:FieldDefn>DEBIT.AMOUNT</d:FieldDefn>
</d:element>
<d:element>
<d:FieldDefn>FT1</d:FieldDefn>
</d:element>
<d:element>
<d:FieldDefn>REF.NO</d:FieldDefn>
</d:element>
<d:element>
<d:FieldDefn>TREASURY.RATE</d:FieldDefn>
</d:element>
</d:enqIntegrationFlowCatalog_FieldDefnMvGroup>

 

Generate the Event


To generate the event you have to do some transaction in T24, use the same T24 Version or T24 Application you have created in above steps.

Follow this guide to Initiate a transaction https://temenostech.temenos.com/getting-started/temenos-t24-3-minutes-guide/

 

 

GET Generated Event


API /enqIntegrationEventss() will return you all the processed and unprocessed events from events queue.

Example: Below URI will return all available events data where EventType=MarketPlaceDemo-FTMarketPlaceDemo

http://127.0.0.1:8080/MarketPlaceDemo-iris/MarketPlaceDemo.svc/GB0010001/enqIntegrationEventss()?$filter=EventType eq ‘MarketPlaceDemo-FTMarketPlaceDemo’

 

 

Get Generated Events in Java Program


Here we are using Prospect-IRIS project, all source and example available in the project.

for this example we are using unirest client library feel free change something you prefer

maven dependency for this class

<dependency>
<groupId>com.mashape.unirest</groupId>
<artifactId>unirest-java</artifactId>
<version>1.3.0</version>
</dependency>

Configuration class

public class Configuration {
public static String DATA_SERVICE_URL = “http://127.0.0.1:8080/MarketPlaceDemo-iris/MarketPlaceDemo.svc/GB0010001/”;

public static String INPUTTER_USER_NAME = “INPUTT”;
public static String INPUTTER_PASSWORD = “123456”;

public static String AUTHORISER_USER_NAME = “SSOUSER1”;
public static String AUTHORISER_PASSWORD = “123456”;
}

Print Integration event on the console

public void printIntegrationEvent() throws UnirestException, IOException {
String url = Configuration.DATA_SERVICE_URL + “enqIntegrationEventss()?$filter=substringof(‘MarketPlace’, EventType)”;
Unirest.setDefaultHeader(“Accept”, “application/atom+xml”);
HttpResponse<InputStream> response = Unirest.get(url).basicAuth(Configuration.INPUTTER_USER_NAME,
Configuration.INPUTTER_PASSWORD).asBinary();
System.out.println(IOUtils.toString(response.getBody()));
}

Note: You need to add import from respective classes, this sample is available as a Integration Test in GitHub project.

 

GET Generated events since …


You can specify the filter to fetch the events

// set the date you want to fetch the events since
Date sd = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss.SSS”).parse(“2016-03-23 20:38:32.522”);
long time = sd.getTime();
// format the time stamp so T24 understand
String t24Date = String.valueOf(time).substring(0, 10) + “.” + String.valueOf(time).substring(10);

String filter = “?$filter=substringof(‘MarketPlace’, EventType)&$filter=CreationTime gt ‘” + t24Date + “‘”;
String url = Configuration.DATA_SERVICE_URL + resourceName + filter;
Unirest.setDefaultHeader(“Accept”, “application/atom+xml”);
HttpResponse<InputStream> response = Unirest.get(url)
.basicAuth(Configuration.INPUTTER_USER_NAME, Configuration.INPUTTER_PASSWORD).asBinary();
System.out.println(IOUtils.toString(response.getBody()));

In this example you’ll get all the events after 23-March-2016 20:30:32

 

GET generated events for one hour Time interval


You can specify the time range to fetch the events

// set the date you want to fetch the events since – keep one hour gap
Date sd1 = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss.SSS”).parse(“2016-03-23 19:38:32.522”);
Date sd2 = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss.SSS”).parse(“2016-03-23 20:38:32.522”);
long time1 = sd1.getTime();
long time2 = sd2.getTime();

// format the time stamp so T24 understand
String t24Date1 = String.valueOf(time1).substring(0, 10) + “.” + String.valueOf(time1).substring(10);
String t24Date2 = String.valueOf(time2).substring(0, 10) + “.” + String.valueOf(time2).substring(10);

//create filter string
String filter = “?$filter=substringof(‘MarketPlace’, EventType)&$filter=CreationTime gt ‘” + t24Date1
+ “‘ and CreationTime lt ‘” + t24Date2 + “‘”;

String url = Configuration.DATA_SERVICE_URL + resourceName + filter;
Unirest.setDefaultHeader(“Accept”, “application/atom+xml”);
HttpResponse<InputStream> response = Unirest.get(url)
.basicAuth(Configuration.INPUTTER_USER_NAME, Configuration.INPUTTER_PASSWORD).asBinary();
System.out.println(IOUtils.toString(response.getBody()));

You get all the events in between the 2016-03-23 19:38:32.522 and 2016-03-23 20:38:32.522

 

Comments are closed.