Service Routines in Java Customer How To Guide 1.0
Service Routines in Java Customer How To Guide 1.0
Contents
1 About this how-to guide ........................................................................... 3
1.1 Legal .............................................................................................................................................. 3
1.2 History ............................................................................................................................................ 4
2 Introduction .............................................................................................. 5
2.1 L3 tables layout .............................................................................................................................. 5
2.1.1 AAL.MORTGAGE.LINK .......................................................................................................... 5
2.1.2 AAL.MORT.MULTI.AC.LINK .................................................................................................. 6
2
Service Routines in Java Customer How-to Guide 1.0
Know how to configure and initiate a service in Transact (formerly known as T24).
1.1 Legal
© Copyright 2020 Temenos Headquarters SA. All rights reserved.
The information in this guide relates to TEMENOSTM information, products and services. It also
includes information, data and keys developed by other parties.
While all reasonable attempts have been made to ensure accuracy, currency and reliability of
the content in this guide, all information is provided "as is".
In no event will TEMENOS be liable to you or anyone else for any decision made or action
taken in reliance on the information in this document or for any consequential, special or similar
damages, even if advised of the possibility of such damages.
TEMENOS does not accept any responsibility for any errors or omissions, or for the results
obtained from the use of this information. Information obtained from this guide should not be
used as a substitute for consultation with TEMENOS.
References and links to external sites and documentation are provided as a service.
TEMENOS is not endorsing any provider of products or services by facilitating access to these
sites or documentation from this guide.
The content of this guide is protected by copyright and trademark law. Apart from fair dealing
for the purposes of private study, research, criticism or review, as permitted under copyright
law, no part may be reproduced or reused for any commercial purposes whatsoever without the
3
Service Routines in Java Customer How-to Guide 1.0
prior written permission of the copyright owner. All trademarks, logos and other marks shown in
this guide are the property of their respective owners.
1.2 History
Version Date Change Author
4
Service Routines in Java Customer How-to Guide 1.0
2 Introduction
The Service Routines in Java Customer How-to Guide describes how to write service
routines in Java to update fields of a locally developed application (L3).
The use case in this document involves linking mortgage accounts with customer accounts
(savings and current), so that they provide preferential rates up to a certain applied percentage
of the loan balance.
2.1.1 AAL.MORTGAGE.LINK
This table records details of applied percentage and preferential interest rate for the linked
account of a mortgage loan. The objective is to write service routines in java to update the
fields LINKED.ACCT.BAL and LOAN.BALANCE of the L3 application with data from the
corresponding core applications.
5
Service Routines in Java Customer How-to Guide 1.0
2.1.2 AAL.MORT.MULTI.AC.LINK
This table records the linked account IDs of mortgage loans. The service routine uses this
application to retrieve arrangement IDs.
6
Service Routines in Java Customer How-to Guide 1.0
7
Service Routines in Java Customer How-to Guide 1.0
3. Create the table AAL.MORTGAGE.LINK and populate it with the required fields. Repeat
the above steps to create the table AAL.MORT.MULTI.AC.LINK.
8
Service Routines in Java Customer How-to Guide 1.0
Procedure
1. In the menu bar, click File > New > Project. Select Design Studio > Design Studio
Template Projects.
2. Click choose a template drop down and select Design Studio Model Project.
3. In the Project Name field, type the name of the new project (for example, L3).
4. Click Finish to create the project. Package Explorer displays the new Design Studio
project.
As well as the *-models project and *-models-gen project, you also need to add a *-
server project to the workspace.
Procedure
3. Enter a name for the server project ending with –server (for example, L3-server).
9
Service Routines in Java Customer How-to Guide 1.0
4. Click Next. The Choose the server connection type dialog is displayed.
5. Select T24 Server - Web service as the connection type. Click Finish.
6. Double click server.properties under *-server to open the properties file in the editor
window:
a. Enter a valid T24 username, password and company code in the T24 User
section.
c. In the Service view pane, verify that the server connection is set to Active.
10
Service Routines in Java Customer How-to Guide 1.0
Procedure
1. Select File > Import > Design Studio - Import T24 Applications.
2. Select the T24 server from the list and click Next. Design Studio connects to T24 and
retrieves all existing applications.
4. Click Next and select the *-model project where you want the applications to be
imported.
5. Click Finish.
Ignore the error on the *-models project. The imported domain has
dependencies on other domains which are missing in the workspace.
11
Service Routines in Java Customer How-to Guide 1.0
Procedure
1. Right-click the *-models project > Design Studio > Generate T24 API.
12
Service Routines in Java Customer How-to Guide 1.0
1. Create a new Java project (File > New > Java project). In the wizard supply a project
name.
2. Configure the build path settings for the Java project to add dependent T24 and TAFJ
libraries.
a. Right click the project, for example L3JAVA > Build path > Configure build
path.
b. Click Libraries tab > Add Library > User Library > User Libraries.
c. In the User Libraries window, click New and give the library a name, for
example, t24lib.
d. Click Add external jars. Navigate to the T24 libraries folder under
%JBOSS_HOME%/modules. Select all the jars and click Open.
13
Service Routines in Java Customer How-to Guide 1.0
Alternatively, just add the required T24 hook jars like EB_TemplateHook.jar,
T24_API-Tables.jar etc using Add External JARs.
e. In the Libraries tab, click Add External JARs and add TAFJClient.jar from
%TAFJ_HOME%/lib
f. In the Libraries tab, click Add External JARs, navigate to the T24_API-
Tables.jar folder and click open.
14
Service Routines in Java Customer How-to Guide 1.0
1. Create a new Java package. Right click the project > New > Package and supply a
name.
2. Right click the package and add a new Class to the package, for example,
ETDUpdateService.
15
Service Routines in Java Customer How-to Guide 1.0
To find out more about the class ServiceLifecycle and what methods can be
overridden, click the com.temenos.t24.api.hook.system package in L3 API
documentation in the browser.
16
Service Routines in Java Customer How-to Guide 1.0
package com.local.service;
import java.util.List;
import java.util.logging.Logger;
import com.temenos.api.TBoolean;
import com.temenos.api.TStructure;
import com.temenos.api.exceptions.T24CoreException;
import com.temenos.api.exceptions.T24IOException;
import
com.temenos.t24.api.complex.aa.contractapi.BalanceMovement;
import
com.temenos.t24.api.complex.eb.servicehook.ServiceData;
import com.temenos.t24.api.contract.accounting.Contract;
import
com.temenos.t24.api.hook.system.ServiceLifecycle
; import
com.temenos.t24.api.records.account.AccountRecor
d; import com.temenos.t24.api.system.DataAccess;
import com.temenos.t24.api.tables.aalmortgagelink.AalMortgageLinkRecord;
import com.temenos.t24.api.tables.aalmortgagelink.AalMortgageLinkTable;
import com.temenos.t24.api.tables.aalmortmultiaclink.AalMortMultiAcLinkRecord;
public class ETDUpdateService extends ServiceLifecycle {
@Override
public String getTableName(ServiceData serviceData, List<String>
controlList) { return "F.AA.AAL.MORT.MULTI.AC.LINK";
}
@Override
public void process(String id, ServiceData serviceData, String controlItem) {
DataAccess da = new DataAccess(this);
try {
AalMortMultiAcLinkRecord accountLinkRecord = new AalMortMultiAcLinkRecord(
da.getRecord("AA.AAL.MORT.MULTI.AC.LINK", id));
da.getRecord("AA.AAL.MORTGAGE.LINK", mortgageLoanId));
17
Service Routines in Java Customer How-to Guide 1.0
mortgageRecord.setLinkedAcctBal(actualBalance
); Contract contract = new Contract(this);
contract.setContractId(mortgageLoanId);
List<BalanceMovement> loanBalance =
contract.getBalanceMovements("CURACCOUNT", ""); int dateBalance =
loanBalance.get(0).getBalance().intValue();
String balanceAsString =
Integer.toString(dateBalance);
mortgageRecord.setLoanBalance(balanceAsString);
mortgageTable.write(mortgageLoanId, mortgageRecord);
} catch (T24IOException e) {
System.out.println("Write failed " + e);
} catch (T24CoreException tce) {
System.out.println("File does not exist " + tce);
}
}
}
1. After the Java code is written, right click the project > Export > JAR file. Select the
export destination.
18
Service Routines in Java Customer How-to Guide 1.0
2. Update module.xml in %JBOSS_HOME%/modules with the new jar path and name.
Restart JBoss.
2. Create EB.API records for each of the overridden methods (select and record routine).
Append .SELECT to EB.API ID for the select routine. (For a load routine, append
.LOAD to the ID).
19
Service Routines in Java Customer How-to Guide 1.0
20
Service Routines in Java Customer How-to Guide 1.0
2. After running the service, the local table fields Linked Acct Bal and Loan Balance are
updated for the Arrangement.
21