0% found this document useful (0 votes)
18 views11 pages

How To Trigger Two Activities From One End Point

This document provides a step-by-step guide on how to trigger two activities from one endpoint using the DEPOSITS API. It includes detailed instructions on obtaining the necessary artefacts, editing service configurations, and deploying the solution. The end result is the successful orchestration of two activities through a single API call.

Uploaded by

anaschwarz232
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views11 pages

How To Trigger Two Activities From One End Point

This document provides a step-by-step guide on how to trigger two activities from one endpoint using the DEPOSITS API. It includes detailed instructions on obtaining the necessary artefacts, editing service configurations, and deploying the solution. The end result is the successful orchestration of two activities through a single API call.

Uploaded by

anaschwarz232
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

How To Trigger Two Activities

From One End Point

Information in this document is subject to change without notice.

No part of this document may be reproduced or transmitted in any form or by any means,
for any purpose, without the express written permission of TEMENOS HEADQUARTERS SA.

© 2021 Temenos Headquarters SA - all rights reserved.


How-To Document-TSR- 500847

Table of Contents

1. How to Trigger Two Activities From One End Point ………………………………..……………………4


2. Detailed steps.......................................................................................................................................
3. Meta Data Track...................................................................................................................................

V2.0/May-21 Quality Assurance Internal Use


To view template history, please click here*
2
How-To Document-TSR- 500847

Document History

Author Version Date

Vinodha Murugan 0.1 21-Feb-2022

Paulpandi Pandidurai 1.0 21-Feb-2022

Comments:

NA

V2.0/May-21 Quality Assurance Internal Use


To view template history, please click here*
3
How-To Document-TSR- 500847

1.How To Trigger Two Activities From One End


Point
The following steps show How to Trigger Two Activities from One End Point. For this illustration,
we are using the DEPOSITS API and two activities are - DEPOSITS-ADJUST.BALANCE-
BALANCE.MAINTENANCE, DEPOSITS-REDEEM-ARRANGEMENT

2.Detailed steps

STEP 1: Obtain the artefact from the IRIS workbench. For this illustration, we are using the
DEPOSITS API and two activities are - DEPOSITS-ADJUST.BALANCE-BALANCE.MAINTENANCE,
DEPOSITS-REDEEM-ARRANGEMENT

V2.0/May-21 Quality Assurance Internal Use


To view template history, please click here*
4
How-To Document-TSR- 500847

Step 2: Enter the required details and click Next, the Review tab would appear, click Next so that the
Download tab will appear and select the Download option. The artefact will be downloaded to the local
device as a .zip file (archive) format. Import the artefact in the service project.

Step 3: Edit the service.xml of DEPOSITS-ADJUST.BALANCE-BALANCE.MAINTENANCE activity


such that it will call the DEPOSITS-REDEEM-ARRANGEMENT activity when the DEPOSITS-
ADJUST.BALANCE-BALANCE.MAINTENANCE is successful.

<?xml version="1.0" encoding="UTF-8"?>


<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">
<camelContext xmlns="http://camel.apache.org/schema/spring" id="party-
products-getTermDeposits.service.v1.0.0">
<onException>
<exception>java.lang.Exception</exception>
<handled>
<constant>true</constant>
</handled>
<process ref="exceptionHandler"/>
</onException>
<restConfiguration component="servlet"
producerApiDoc="getTermDeposits-v1.0.0-swagger.json" bindingMode="auto"
enableCORS="true"/>
<rest path="/v1.0.0/party/products" produces="application/json"
id="party-products.service.restlet">
<post uri="/getTerm/Deposits" id="getTermDeposits">
<to uri="direct-vm:party-products.v1.0.0.getTermDeposits"/>

V2.0/May-21 Quality Assurance Internal Use


To view template history, please click here*
5
How-To Document-TSR- 500847

</post>
</rest>
<route id="direct-vm.party-products.v1.0.0.getTermDeposits">
<from uri="direct-vm:party-products.v1.0.0.getTermDeposits"/>
<setProperty propertyName="operationSecurity">
<constant>Public</constant>
</setProperty>
<setProperty propertyName="isBulk">
<constant>false</constant>
</setProperty>
<setProperty propertyName="extensibility">
<constant>true</constant>
</setProperty>
<setProperty propertyName="response_verbosity">
<constant>Minimal</constant>
</setProperty>
<setProperty propertyName="function">
<constant>input</constant>
</setProperty>
<setProperty propertyName="validate_only">
<header>validate_only</header>
</setProperty>
<setProperty propertyName="activity">
<constant>DEPOSITS-ADJUST.BALANCE-
BALANCE.MAINTENANCE</constant>
</setProperty>
<setProperty propertyName="activityVersion">
<constant>AA.API.NEW.1.0.0</constant>
</setProperty>
<setProperty propertyName="product">
<constant>DEPOSIT.SHORT</constant>
</setProperty>
<setProperty propertyName="mapping">
<constant>dynamic_model</constant>
</setProperty>
<process ref="t24VersionProcessor"/>
<choice>
<when>
<simple>${headers.CamelHttpResponseCode} == 200</simple>
<to uri="direct-vm:party-
products.v1.0.0.getRedeemTermDeposits" />
</when>
</choice>
</route>
<route id="direct.mockResponder">
<from uri="direct:mockResponder"/>
<process ref="mockResponder"/>
</route>
</camelContext>

</beans>

STEP 4: Create a java file under any package present in your IRISR18 war file with the below logic.
Note: The java class shown here is of the name CustomOrchestrationRequestMapper and is
created under the package temenos.com.arrangement.

V2.0/May-21 Quality Assurance Internal Use


To view template history, please click here*
6
How-To Document-TSR- 500847

package temenos.com.arrangement;

import java.math.BigDecimal;
import java.util.Map;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.json.JSONArray;
import org.json.JSONObject;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.jayway.jsonpath.Configuration;
import com.jayway.jsonpath.DocumentContext;
import com.jayway.jsonpath.JsonPath;
import com.jayway.jsonpath.Option;
import com.temenos.irf.integration.json.JSONHelper;
/**
* TODO: Document me!
*
* @author ntejaswi
*
*/
import com.temenos.irf.logging.Logger;
import com.temenos.irf.logging.LoggerFactory;

public class CustomOrchestrationRequestMapper implements Processor{


private final Logger logger =
LoggerFactory.getLogger(CustomOrchestrationRequestMapper.class);
@Override
public void process(Exchange exchange) throws Exception {
//Map the fields from response body

final Object oBody = exchange.getIn().getBody();


DocumentContext jsonContext = null;
if (oBody instanceof Map) {
jsonContext = JsonPath.parse(oBody);
}
if (oBody instanceof ObjectNode) {
jsonContext = JsonPath.parse(oBody.toString());
}
if (oBody instanceof String) {
jsonContext = JsonPath.parse(oBody.toString());
}
JSONObject camelResponse = new
JSONObject(jsonContext.jsonString());
logger.info("get camelResponse : "+camelResponse);
JSONObject body = (JSONObject)camelResponse.get("body");
body=body.getJSONObject("arrangementActivity");
String paramValue = body.getString("arrangmentId");
final ObjectMapper om = JSONHelper.createObjectMapper();
Gson gson = new GsonBuilder().setPrettyPrinting().create();

V2.0/May-21 Quality Assurance Internal Use


To view template history, please click here*
7
How-To Document-TSR- 500847

String gjsonStr = "{ \"header\": {}, \"body\":


{ \"arrangmentId\": \""+paramValue+"\"}}";
logger.info("gson json string : "+gjsonStr);
JsonNode actualObj =om.readTree(gjsonStr);
exchange.getIn().setBody(actualObj);
}
}

Step 5: Edit the applicationContext.xml present in the IRISR18 war file by adding t24FilterProcessor
bean as shown below.

<bean id="t24FilterProcessor"
class="temenos.com.arrangement.CustomOrchestrationRequestMapper">
</bean>

Step 6: Edit the service.xml of DEPOSITS-REDEEM-ARRANGEMENT activity as shown below. The


t24FilterProcessor must be included before the t24VersionProcessor of the redirected API (which will
have the body information as part of the response received from the previous API).

<?xml version="1.0" encoding="UTF-8"?>


<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">
<camelContext xmlns="http://camel.apache.org/schema/spring" id="party-
products-getRedeemTermDeposits.service.v1.0.0">
<onException>
<exception>java.lang.Exception</exception>
<handled>
<constant>true</constant>
</handled>
<process ref="exceptionHandler"/>
</onException>
<restConfiguration component="servlet"
producerApiDoc="getRedeemTermDeposits-v1.0.0-swagger.json"
bindingMode="auto" enableCORS="true"/>
<rest path="/v1.0.0/party/products" produces="application/json"
id="party-products.service.restlet">
<post uri="/getRedeemTerm/Deposits" id="getRedeemTermDeposits">
<to uri="direct-vm:party-
products.v1.0.0.getRedeemTermDeposits"/>
</post>
</rest>
<route id="direct-vm.party-products.v1.0.0.getRedeemTermDeposits">
<from uri="direct-vm:party-products.v1.0.0.getRedeemTermDeposits"/>

V2.0/May-21 Quality Assurance Internal Use


To view template history, please click here*
8
How-To Document-TSR- 500847

<setProperty propertyName="operationSecurity">
<constant>Public</constant>
</setProperty>
<setProperty propertyName="isBulk">
<constant>false</constant>
</setProperty>
<setProperty propertyName="extensibility">
<constant>true</constant>
</setProperty>
<setProperty propertyName="response_verbosity">
<constant>Minimal</constant>
</setProperty>
<setProperty propertyName="function">
<constant>input</constant>
</setProperty>
<setProperty propertyName="validate_only">
<header>validate_only</header>
</setProperty>
<setProperty propertyName="activity">
<constant>DEPOSITS-REDEEM-ARRANGEMENT</constant>
</setProperty>
<setProperty propertyName="activityVersion">
<constant>AA.API.NEW.1.0.0</constant>
</setProperty>
<setProperty propertyName="product">
<constant>DEPOSIT.SHORT</constant>
</setProperty>
<setProperty propertyName="mapping">
<constant>dynamic_model</constant>
</setProperty>
<process ref="t24FilterProcessor"/>
<process ref="t24VersionProcessor"/>
</route>
<route id="direct.mockResponder">
<from uri="direct:mockResponder"/>
<process ref="mockResponder"/>
</route>
</camelContext>

</beans>

Step 7: Create and Deploy the file, Send the URL via postman and check the output.

V2.0/May-21 Quality Assurance Internal Use


To view template history, please click here*
9
How-To Document-TSR- 500847

Two Activities are triggered from One End Point and the result of the orchestrated APIs are successful.

3.Meta Data Track

Meta Data Track

Description of document * How to Trigger Two Activities from One End Point

Product * IRIS

From T24 Release * R22

V2.0/May-21 Quality Assurance Internal Use


To view template history, please click here*
10
How-To Document-TSR- 500847

To T24 Release *
If the functionality is relevant till
R9, choose the value ‘Current’

Content Classification

Bank Unit * None

TAG 1 *(keyword) Activities Enter relevant tag, if not found in the


drop-down list.

TAG 2(keyword) Orchestration Enter relevant tag, if not found in the


drop-down list.

TAG 3(keyword) Enter relevant tag, if not found in the


drop-down list.

Document Administrative Details

Owner: Vinodha Murugan Email ID: N/A

Approver: Email ID:

Expiry Date: Click here to enter a date. JIRA Reference: TSR- 500847

V2.0/May-21 Quality Assurance Internal Use


To view template history, please click here*
11

You might also like