T24 Java Training Internal - 20191022
T24 Java Training Internal - 20191022
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
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
12 © 2019 Cognizant
Collections in Java
• A Collection is a group of individual objects represented as a single unit.
• 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
•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
© 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
• 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
20 © 2019 Cognizant
T types in T24 - TStructure
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)
if(strRiskExpoType.equals("410")){
fldRiskExpoType.setError("Not Allowed");
}
return rec.getValidationResponse();
}
22 © 2019 Cognizant
T types in T24 - TValidationResponse
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
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
27 © 2019 Cognizant
T24 Extensibility in Java
© 2019 Cognizant
Create JAVA Project
Live Demo
29 © 2019 Cognizant
T24 Extensibility in Java
© 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
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