100% found this document useful (13 votes)
5K views

T24 Java Training Internal - 20191022

Uploaded by

cesar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (13 votes)
5K views

T24 Java Training Internal - 20191022

Uploaded by

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

T24 Extensibility in Java

OCT - 2019

© 2019 Cognizant
Agenda
• Java and Java features
• Design Studio
• T24 Java features
• Prerequisite for T24 Java development
• Java Project setup in Design Studio.
• Demo - Record Life Cycle (Input Routine, Check Record Routine)
• Demo – Enquiry (Build Routine, Nofile Routine)
• Demo - Debug

2 © 2019 Cognizant
What is Java?
• Java is a general-purpose, object-oriented, class-based programming language.
• What is a Class in Java context? : Classes are templates that are used to create
objects
• What does a Class contains? : Data Types/Variables and Functions/Methods
• What is an Object? Objects are created from templates known as classes.
An object has a state and behavior. The state of an object is stored in
fields/variables, while methods/functions display the object's behavior.
For Ex: Account is a class and account1, account2 are objects created by
Account class. Each object account1 and account2 represents state of 2 different
accounts account1 and account2
• What is a Package? Package in Java is a mechanism to encapsulate a group of
classes, sub packages and interfaces. Packages are used for: Preventing
naming conflicts
3 © 2019 Cognizant
Java OOPs Features

• Inheritance: One object acquires the properties and behaviors of the


parent object. It’s creating a parent-child relationship between two class
• Polymorphism: Polymorphism refers to the ability of a variable, object or
function to take on multiple forms
• Abstraction: An abstraction is an act of representing essential features
without including background details
• Encapsulation: Encapsulation is an OOP technique of wrapping the data
and code

4 © 2019 Cognizant
Few Java/OOPs Terminologies

• Constructor: Constructor is a block of code that initializes the newly created object. A
constructor resembles an instance method in java but it’s not a method as it doesn’t have
a return type.
• Super: The super keyword in java is a reference variable that is used to refer parent
class objects.
• Extends: Extends means that you are creating a subclass of the base class. So
subclass/child class inherits functionalities from base class/parent class
• Override: Allows a subclass or child class to provide a specific implementation of a
method that is already provided by one of its super-classes or parent classes.
• Overload: Method Overloading is a feature that allows a class to have more than one
method having the same name, if their argument lists are different.

5 © 2019 Cognizant
Example of Account Class

6 © 2019 Cognizant
Example of Base Class “BaseAccount”

7 © 2019 Cognizant
Example: Creating Objects from Class

8 © 2019 Cognizant
Example: Inheritance

9 © 2019 Cognizant
Example: Method Overriding

10 © 2019 Cognizant
Example: Method overloading

11 © 2019 Cognizant
Few Java/OOPs Terminologies
• Type Casting: Type casting is a process of converting one type, which could be a class or interface to another, But as per
rules of Java programming language, only classes or interfaces (collectively known as Type) from the same type hierarchy can
be cast or converted into each other.
• Need type casting to get access to fields and methods declared on target type or class

• ArrayList names = new ArrayList();


names.add(“Radhakrishna"); //adding String
names.add(1);   //adding Integer

String name = (String) names.get(0); //OK


name = names.get(1); // throw ClassCastException , you can not convert Integer to String

public TValidationResponse validateRecord(String application, String recordId, TStructure record,


TStructure lastLiveRecord) {
FundsTransferRecord fr = new FundsTransferRecord(record);
TField f1 = fr.getDebitCurrency();

12 © 2019 Cognizant
Collections in Java
• A Collection is a group of individual objects represented as a single unit.

• Used for store and manipulate the group of objects.

• For Ex:
List
We can store the ordered collection of objects. It can have duplicate values.
List interface is implemented by the classes ArrayList, LinkedList, Vector, and Stack.

HashMap:
HashMap is the implementation of Map interface contains values on the basis of key, i.e. key and value
pair.
Each key and value pair is known as an entry. A Map contains unique keys.

Refer: https://www.javatpoint.com/collections-in-java

13 © 2019 Cognizant
Exception Handling in Java

•What is an Exception in Java?


In Java, an exception is an event that disrupts the normal flow of the program.
It is an object which is thrown at runtime.
Dictionary Meaning: Exception is an abnormal condition.

•The Exception Handling in Java is one of the powerful mechanism to handle the runtime errors,
so that normal flow of the application can be maintained.

Ex:

try{   
//code that may throw an exception    
}catch(Exception_class_Name ref){}    

14 © 2019 Cognizant
Design Studio IDE for T24 Extensibility in Java
• DS is built on Eclipse
• Designing, Developing and Managing T24 programs/components
• Can write programs/source code using Jbasic and Java
• Different Designers available to develop T24 component
Ex;
Version Designer
Enquiry Designer etc
• Issue Tracking and Packaging
• Design Studio uses Maven for building and Managing project life cycle.

15 © 2019 Cognizant
T24 Extensibility in Java

Why and What it provides?


Aug - 2019

© 2019 Cognizant
T24 JAVA Introduction
• Why do we need T24 Extensibility in Java ?
• APIs and Hooks
• T-Types
• DataAccess

17 © 2019 Cognizant
Why do we need T24 Extensibility in Java ?
• Scalability and ownership

• There are more java developers than jBC developers


• Banks can use their own developers
• Simplify the T24 APIs

• The developer should not need to know about STORE.END.ERROR, R.NEW


or the different ways of storing an amount field in T24
• Governance

• We can use the framework to protect t24. for e.g. prevent a select on a large
table that can lead to performance issue for all users

18 © 2019 Cognizant
APIs and Hooks
• APIs are code Temenos has written that L3 developers can call
• Hooks are code L3 developers have written that T24 can call
• A developer can attach own logic to T24 to be called from core application exits
using HOOKS
• Each hook has been provided with methods to carry out the task
• For e..g the Java developer will use the validateField method defined in
com.temenos.t24.api.hook.system.RecordLifeCycle class for field validation
exits

19 © 2019 Cognizant
T types in T24

• Classes introduced by Temenos for Java developers in TAFJClient.jar


• TStructure
• TField
• TValidationResponse
• TString, TNumber, TBoolean, Tdate
• Etc…

20 © 2019 Cognizant
T types in T24 - TStructure

• The “TStructure” is a generic type containing a record object


• TStructure must be ‘cast’ to the correct record type
• Maps a jBC dynamic array to java object

public TValidationResponse validateRecord(String application, String


recordId, TStructure record, TStructure lastLiveRecord) {
SectorRecord rec = new SectorRecord(record);
TField fldRiskExpoType = rec.getRiskExpoType();
String strRiskExpoType = fldRiskExpoType.getValue();

if(strRiskExpoType.equals("410")){
fldRiskExpoType.setError("Not Allowed");
}
return rec.getValidationResponse();
}

21 © 2019 Cognizant
T types in T24 - TField

• TField offers getters and setters for Enrichment, Error, field values.
• Every field in a record is an internal type TField (not String by default)

public TValidationResponse validateRecord(String application, String


recordId, TStructure record, TStructure lastLiveRecord) {
SectorRecord rec = new SectorRecord(record);
TField fldRiskExpoType = rec.getRiskExpoType();
String strRiskExpoType = fldRiskExpoType.getValue();

if(strRiskExpoType.equals("410")){
fldRiskExpoType.setError("Not Allowed");
}
return rec.getValidationResponse();
}

22 © 2019 Cognizant
T types in T24 - TValidationResponse

• Record validation is a common mechanism in T24 to allow custom validation on


records.

public TValidationResponse validateRecord(String application, String


recordId, TStructure record, TStructure lastLiveRecord) {
SectorRecord rec = new SectorRecord(record);
TField fldRiskExpoType = rec.getRiskExpoType();
String strRiskExpoType = fldRiskExpoType.getValue();

if(strRiskExpoType.equals("410")){
fldRiskExpoType.setError("Not Allowed");
}
return rec.getValidationResponse();
}

23 © 2019 Cognizant
DataAccess

• The system.DataAccess class is a utility class to read, select and access data in
T24.
• The api.records package is used to hold records from T24 applications

DataAccess da = new DataAccess(this);


AccountRecord AccRec = new AccountRecord(da.getHistoryRecord(“ACCOUNT”,”123456”);

Tfield fldTitle = AccRec.getAccountTitle1(0);


Return fldTitle.toString();

24 © 2019 Cognizant
T24 Extensibility in Java

Pre-Requisite
Aug - 2019

© 2019 Cognizant
Pre-Requisite

Server
• T24 Release 19 or higher environment
• JD (Java Development) module
• Jboss with axis2
Local
• Design Studio
• T24 Libraries
• TAFJ
Note: There is also an option to run Jboss in local instead of server.

26 © 2019 Cognizant
Pre-Requisite

• JD Module

• SPF Field

Empty (none) – Supports both JBC and JAVA style of L3 coding


YES – Supports only JAVA style of L3 coding
NO – Supports only JBC style of L3 coding

27 © 2019 Cognizant
T24 Extensibility in Java

Create JAVA Project


Aug - 2019

© 2019 Cognizant
Create JAVA Project

Live Demo

29 © 2019 Cognizant
T24 Extensibility in Java

Demo - Record Life Cycle


Aug - 2019

© 2019 Cognizant
Template Routines

• .ID ID Routine
• .RECORD Check Record Routine
• .VALIDATE Input Routine
• .PROCESS After Unauth routine
• .AUTHORISE Authorisation routine

31 © 2019 Cognizant
Demo Scenario 1 - validateRecord

Whenever a Sector record is created or amended, with value 410 in the field
RISK.EXPO.TYPE then throw a field level error ‘Not Allowed’

This JBC world, this is a Validation routine and we used to write a .VALIDATE
routine for the template or attach a routine at version level

32 © 2019 Cognizant
Demo Scenario 2 - defaultFieldValues

Whenever an account record is opened for viewing or editing, if the numeric


currency code linked to that account is greater 830 then throw an error ‘Access
Restricted’

This JBC world, this is a Check Record routine and we used to write a .RECORD
routine for the template or attach a routine at version level

33 © 2019 Cognizant
T24 Extensibility in Java

Demo - Enquiry
Aug - 2019

© 2019 Cognizant
Demo Scenario 1 - setFilterCriteria

Create an ACCOUNT enquiry which always list only the records that belongs to the
CATEGORY 0 to 1999.

This JBC world, this is a build routine and attach at enquiry level

35 © 2019 Cognizant
Demo Scenario 1 - setIds

Create a NOFILE enquiry which accepts Cutomer id in selection criteria and list the
customer accounts balances group by currency.
For Ex. If customer 123456 got 2 USD accounts and 2 SGD accounts, then the
enquiry should contain 2 rows (per currency) and display the sum of balances for
that currency.

This JBC world, this is a NOFILE routine and attach at enquiry level

36 © 2019 Cognizant
T24 Extensibility in Java

Demo - Debugging
Aug - 2019

© 2019 Cognizant
Enquiry

Live Demo

38 © 2019 Cognizant
Thank you

You might also like