JE Service
JE Service
2
3
In this lesson, we will use the Java apis available to create a service in T24
4
Services are multi threaded processes in core banking. They can be run
independently or as part of COB. Multi threaded processes have three components –
LOAD to initialize variables, SELECT – to prepare a list of IDs that Will be processed by
the service, RECORD – contains the processing logic.
getTableName - This interface enables the implementer to return a table name, the
RECORD routine (process/inputRecord) will then be invoked on all ids in the table.
inputRecord - Define a method to process a multiple records from the multiple tables
specified in the 'versionName' parameter
5
postUpdateRequest - This interface enables the to post the request to update the
records of any table in asynchronous mode.
Process - Define a method to process a single record from the table specified by
getTableName
5
This interface enables the implementer to initialise the ServiceLifecycle instance e.g.
set member variables.
Implementing this interface is optional and it will not be invoked if not specified.
This interface is invoked from BATCH.JOB.CONTROL in place of the LOAD routine once
before invoking the getTableName/getIds (SELECT) and process/updateRecord
(RECORD) methods.
The EB.API hook used by this interface is BATCH.JOB.NAME.LOAD.HOOK.
This hook is specified by naming convention, the EB.API record for the initialise hook
will append .LOAD to the job name
6
This interface enables the implementer to return a list of Ids to the process, the
RECORD routine (process/updateRecord) will then be invoked on all the ids in the list
If the control list is populated the getIds method will be invoked once for each item in
the list and the process/updateRecord for every id in the list each time.
The EB.API hook used by this interface is BATCH.JOB.NAME.SELECT.HOOK
This hook is specified by naming convention, the EB.API record for the getIds hook
will append .SELECT to the job name
For example, where the job name is MY.JOB the hook will be MY.JOB.SELECT
Parameters:
serviceData - It is all about the service like jobName, companyId, processId,
sessionId and jobData
controlList – The control list to be set
Returns:
List<String> - List of Ids to be processed
7
This interface enables the implementer to return a table name, the RECORD routine
(process/updateRecord) will then be invoked on all ids in the table.
If the control list is populated the getTableName method will be invoked once for
each item
This interface is invoked from BATCH.JOB.CONTROL in place of the SELECT routine
BATCH.BUILD.LIST will be invoked for the table
The EB.API hook used by this interface is BATCH.JOB.NAME.SELECT.HOOK
This hook is specified by naming convention, the EB.API record for the getTableName
hook will append .SELECT to the job name.
For example, where the job name is MY.JOB the hook will be MY.JOB.SELECT
8
Parameters:
serviceData - It is all about the service like jobName, companyId, processId,
sessionId and jobData.
controlList - The control list to be setReturns:List<String> - the list of ids are to
be processed
Returns:
List<String> - the list of ids are to be processed
9
This interface enables the developer to update the records of any table.
The update will be attempted before control is returned to the service dispatcher
BATCH.JOB.CONTROL.
This interface is invoked from BATCH.JOB.CONTROL in place of the RECORD routine.
The EB.API hook used by this interface is BATCH.JOB.NAME.HOOK.
The versionId should not be a comma version.
The T24 field specifying the job name is the JOB.NAME field in BATCH.
The OFS.SOURCE id should be specified in the first element of the transactionData
parameter.
The transaction will not be processed if the OFS.SOURCE is missing or invalid
10
public void updateRecord(String id, ServiceData serviceData, String controlItem,
TransactionControl transactionControl, List transactionData, List records)
Parameters:
id - The id to process
serviceData - Details about this service such as jobName, companyId,
processId, sessionId, jobData and batchStartDate.
controlItem - The item of the control list being processed for multi stage jobs.
transactionControl - Items that control how the request is processed such as
how to group transactions and handle errors.
transactionData - List of transaction data each for a single update request
including function, transactionId and versionId.
records - List of records for the corresponding request index in
transactionData. A record is only required for the INPUT function
Returns
nothing
11
This interface enables the to post the request to update the records of any table in
asynchronous mode.
This interface writes the request into the file OFS.MESSAGE.QUEUE. To post this
request into the T24, user has to run the OFS.MESSAGE.SERVICE service. This
interface is invoked from BATCH.JOB.CONTROL in place of the RECORD routine.
The EB.API hook used by this interface is BATCH.JOB.NAME.HOOK.
The versionId should not be a comma version. The T24 field specifying the job name
is the JOB.NAME field in BATCH. The OFS.SOURCE id should be specified in the DATA
field (first multi value position) in BATCH.
If no OFS.SOURCE mentioned or invalid OFS.SOURCE, then the process stops from
being processed.
12
public void postUpdateRequest(String id, ServiceData serviceData, String
controlItem, List transactionData, List records)
Parameters:
id - The id to process
serviceData - It is all about the service like jobName, companyId, processId,
sessionId, jobData and batchStartDate.
controlItem - The item of the control list being processed for multi stage jobs.
transactionData - List of transaction data each for a single update request
including function, transactionId and versionId.
records - List of records for the corresponding request index in
transactionData. A record is only required for the INPUT function.
Returns:
nothing.
13
14
Create a simple service that updates the ACCOUNT.TITLE of all accounts as
MNEMONIC + TITLE of the CUSTOMERS with SECTOR 1001
Steps
Select the Customers with SECTOR equals 1001
Read all the Accounts of the Customers one by one
Update all the Accounts ACCOUNT.TITLE in the below format
MNEMONIC + SHORT.TITLE
15
16
17
We must create EB.API entry for the .SELECT as well as the record routine
18
Create a PGM.FILE entry with Type as Batch and BATCH.JOB as
@BATCH.JOB.CONTROLS and Product as EB
19
Create a BATCH Record with the ID as BNK/<NAME OF THE RECORD ROUTINE EB.API>
20
Create TSA.SERVICE Record with the ID as BNK/<NAME OF THE RECORD ROUTINE
EB.API ID>
21
Start the TSM from the TAFJEE console using the command START.TSM
22
Account Name Updated
23
24
25