Scripting Events PDF
Scripting Events PDF
Scripting Events PDF
7.0
SCRIPTING EVENTS
ExpertEdge Software
No part of this volume may be reproduced or transmitted in any form or by any means electronic or mechanical including
photocopying and recording or by any information storage or retrieval system except as may be expressly permitted.
Expertedge believes that the information in this publication is accurate as of its publication date. This document could
include typographical errors, omissions or technical inaccuracies. Expertedge reserves the right to revise the document and
to make changes without notice.
TABLE OF CONTENTS
1 INTRODUCTION ......................................................................................................... 3
1.1 WHAT IS A FINACLE™ ‘SCRIPT EVENT’ ................................................................ 4
1.2 REPOSITORIES AND CLASSES................................................................................... 5
1.3 RETURN STATUS OF THE SCRIPT ............................................................................ 5
2 FORM LOAD EVENTS ............................................................................................... 8
2.1 IDENTIFYING THE FIELD NAMES. ........................................................................... 8
2.2 PRE LOAD FORM EVENT............................................................................................ 9
2.3 POST LOAD FORM EVENT. ....................................................................................... 10
2.4 POST EXECUTE FORM EVENT ............................................................................... 11
2.5 PRE KEY REPLAY EVENT ........................................................................................ 12
2.6 POST KEY REPLAY EVENT ...................................................................................... 15
3 FINANCIAL TRANSACTION EVENTS .................................................................. 17
3.1 ACCOUNT DETAILS DISPLAY IN TM MENU OPTION ....................................... 17
3.2 CLEARING TRANSACTIONS .................................................................................... 19
3.3 TRANSACTIONS THROUGH TM ............................................................................ 24
3.4 OTHER FINANCIAL TRANSACTIONS ................................................................... 33
4 TRANSACTION UPLOAD SCRIPTS ....................................................................... 35
5 EVENT CHARGES RELATED SCRIPTING EVENTS .......................................... 39
5.1 SCRIPTS FOR CALCULATION OF CHARGES FOR DEMAND DRAFTS ......... 41
6.1 SCRIPTS FOR CALCULATION OF MICR CHARGES .......................................... 42
6.2 SCRIPTS FOR CALCULATION OF STOP PAYMENT CHARGES ...................... 43
6.3 SCRIPTS FOR CALCULATION OF ACCOUNT CLOSURE CHARGES ............. 44
6.4 MAHA TRANSACTION TEMPLATES.................................................................... 46
7 SECTION OBJECTIVE ............................................................................................. 47
8 PROCESSES INVOLVED ......................................................................................... 47
9 MTTUSERHOOKS ..................................................................................................... 47
9.1 DEFINETRANSACTION .............................................................................................. 47
9.2 DEFINEPARTTRAN...................................................................................................... 49
9.3 POPULATEINPUTDETAILS ....................................................................................... 55
9.4 ENDDEFINITION .......................................................................................................... 55
9.5 PROGRAMMING HINTS FOR MTT.......................................................................... 56
10 APPENDIX .............................................................................................................. 56
10.1 FIELDS IN STDIN CLASS IN BANCS REPOSITORY ......................................... 56
1 INTRODUCTION
Finacle™ is a Core Banking package which supports a number of deployment topologies
(Fully Distributed to Fully Centralized) and Implementation scenarios (Single currency,
Multiple currency, Various Retail and Trade finance banking products and Interest methods
etc.). In order to support these multitude of features, it is essential that Finacle™ is open to
‘Customization’ by the Bank so that it can implement the features that it requires and in the
way that it desires. Also, the Bank will need to interface some of their ‘peripheral
applications’ (like Treasury, Consumer Finance etc.) which are not supported directly by
Finacle™, to Finacle™ in various ways. Another area of ‘Customizability’ is in the interface to
various special purpose equipment like ATM switches, VRUs, MICR encoders etc. which are
supplied by many vendors with some differences in actual implementation.
So far, Finacle™ had addressed this issue by defining ‘parameters’ which was set up by the
Bank depending upon its requirements. However, this has the limitation of requiring that the
developers of Finacle™ know all the possible business logic before hand and then implement
them using parameters. However, a far more powerful approach is to allow the Bank to ‘take
control ‘ at certain ‘events’, apply their own logic on the data associated with that event and
be able to either influence the outcome of that event or communicate the occurrence of the
event to other ‘Custom’ applications. The Finacle™ ‘extensibility toolkit’ allows the bank to
do just this.
1 The Script Engine – This is an ‘interpretive language’ processor which allows a wide
range of key programming constructs, while allowing the Bank to ‘custom develop’
additional functions that can be called from the ‘scripts’. Please refer to Scripting
Syntax document for more details.
2 The Finacle™ functions – Certain standard functions and certain ‘module specific’
functions have been developed by the Finacle™ developers which can be called from
the ‘scripts’. Please refer to Scripting Hooks document for more details.
3 The Finacle™ ‘script events’ – Right across Finacle™, there are several events that
have been ‘opened up’ by defining script events. What it means is that for a ‘script-
enabled event’, the Finacle™ application, checks for the existence of a defined script
and if present, transfers control to the Script Engine to execute that script after
populating all the data required by that event in ‘input fields’. It is the script’s
responsibility to apply whatever logic it wants and provide the necessary ‘output
fields’ at the end of the script for Finacle™ to continue its processing. This document
contains more details about this.
1 Manipulate the data that is given as input (event specific ones and not the ones in
STDIN class) and provide the output as needed by Finacle™ to continue processing.
Basically, these events occur at the interface between ‘applications’ or ‘vendor-
specific’ devices. These events provide an easy way to take care of ‘formatting’
differences between different versions/applications. The Account formatting events
are an example of this, in which the Bank is expected to apply its specific logic to
convert an externally known account number to the internally known one and vice
versa. Also, events that allow massaging of messages to and from BancsConnect
fall into this category.
2 Manipulate menu options, screen variables, and key-based screen events to
customize the screens and workflow. Note that for the full functionality to be
available, the Bank has to install the Workflow module of Finacle™. The Form Load
and Post-Execute events are examples of this.
3 At various points during different business transactions, Transaction creation events
(MTT event) are generated which allows the Bank to customize the transaction that
needs to be posted. These would typically be used for defining charge transactions,
CDCI-related transactions, interest provisioning and interest effecting transactions
etc.
4 Apart from this there are a number of events that have been provided with
‘extensibility’ in mind. These events allow the bank to ‘communicate’ data of
Finacle™ events to other applications and vice-versa. For example the ‘Customer
creation/modification’ event allows the Bank to keep the Customer data in Finacle™
in synch with a ‘Central Customer master’ if any.
Some examples:
1 The bank decides the account number format. But this format may contain some
format that is common for all the accounts in the Service Outlet and the user wants
the same to be appended to the account number entered in some particular format
by default. It might be the Bank code, Branch code, Currency code, currency alias,
Data center alias etc. which are common to all accounts.
The format of the account is such that the user has to enter ‘-‘ in between the account
number which is very cumbersome. By making use of script, this can be done by default and
the user needs to enter only the actual account number ‘010203040001’ and it will be
converted to the format by the script written by the user before it is further processed.
2 The Branch may be connected to an ATM that supports only 10 character account
number and the actual account number size in FINACLE™ may be more. In this
case, the FINACLE™ account number format is to be converted to ATM account
number format using some logic. This can be done in scripting. The bank will decide
on the logic to derive the unique account number for ATM from FINACLE™ format
and will code the same in the Script.
To convert to 10 character ATM account number format, the bank may decide to leave out
the bank code portion as the ATM is attached to the branches of the same BANK and leave
out the formatting of account number with ‘-‘.
The ATM account number that is derived can be 0203040001 that should be unique in the
data center.
All Finacle™ ‘script events’ (except for Workflow related events and MTT related events)
interface with the scripts using a standard repository called “BANCS”. There are 3 classes
that have been predefined in this repository, STDIN, INPUT and OUTPUT, each of which hold
‘String’ type of fields.
STDIN class is the set of common fields that is available in any event.
The fields available in the standard CLASS STDIN are listed in the appendix on page 56
Using the following syntax in the scripts, one can accesses the field in the repositories –
ex : BANCS.STDIN.dcAlias.
The INPUT CLASS contains fields’ specific to the events, which are the data items that are
made available to the script defined for that event. The list of fields available to individual
events is described in the appropriate section below.
The OUTPUT CLASS contains fields’ specific to the events, which are the data items that will
be accessed by Finacle™ after the execution of the script to determine its logic of further
execution. The list of fields available to individual events is described in the appropriate
section below.
Ex : BANCS.OUTPUT.successOrFailure = “F”
The valid values are “S” for success and “F” Failure.
This executable must be executed at the unix prompt along with the form name.
dispfields
1. the crt file name must be mentioned. ( if the file is not in the current directory the entire
path must be mentioned)
2. Forms dir. – here the forms directory must be mentioned for the utility to pick the form.
( $TBA_PROD_ROOT/ cust/INFENG/forms directory)
5. All forms - If –5 is specified then all the forms are displayed. ( optional. If option 5 is
specified then 3 must not be specified)
EXAMPLE:
In the above screen, the CUMM option first screen, the form name baff0009 is shown and
from here we can find out the field name of Cust Non Resident? is datablk1.cust_nre_flg.
SCRIPT:
The script <formname> PreLoad.scr should exist in the TBA_SCRIPTS directory. Script
will be executed only if script exist in TBA_SCRIPTS directory.
There are no fields available in the INPUT class for this event. However
urhk_TBAF_InquireFieldValue can be used to get values of fields in the form that is
calling this form.
OUTPUTS EXPECTED:
BANCS.OUTPUT.<fldName>
SuccessOrFailure “S” or “F”. If not “S” then fatal error will occur.
This event would be required to be scripted by the Bank for those forms in which default
field value or default field attribute default needs to be changed from the Infosys setting.
The user hooks urhk_TBAF_SetValue and urhk_TBAF_SetAttrib should be used in this event.
It can also be used to define ‘Replay key’ events for the form using the userhook
urhk_TBAF_SetReplayKey.
SAMPLE SCRIPT:
# The following script sets mandatory attribute for each of the fields below
# It uses a user hook called urhk_TBAF_SetAttrib
<--start
sv_a = urhk_TBAF_SetAttrib(“tdff0009.d1.lien_flg|M”)
sv_a = urhk_TBAF_SetAttrib(“tdff0009.d1.nominee_print_flg|M”)
sv_a = urhk_TBAF_SetAttrib(“tdff0009.d1.printing_flg|M”)
sv_a = urhk_TBAF_SetAttrib(“tdff0009.d2.auto_renewal_flg|M”)
sv_a = urhk_TBAF_SetAttrib(“tdff0009.d2.tds_exemp_flg|M”)
sv_a = urhk_TBAF_SetAttrib(“tdff0009.d2.prtg_rmks|M”)
sv_a = urhk_TBAF_SetAttrib(“tdff0009.d2.int_accrual_flg|M”)
sv_a = urhk_TBAF_SetAttrib(“tdff0009.d2.close_on_maturity_flg|M”)
sv_a = urhk_TBAF_SetAttrib(“tdff0009.d3.sulabh_flg|M”)
sv_a = urhk_TBAF_SetAttrib(“tdff0009.d3.safe_custody_flg|M”)
exitscript
end-->
SCRIPT:
There are no fields available in the INPUT class for this event. However
urhk_TBAF_InquireFieldValue can be used to get the default values of fields in the form.
OUTPUTS EXPECTED:
BANCS.OUTPUT.<fldName>
SuccessOrFailure “S” or “F”. If not “S” then fatal error will occur.
This event would be required to be scripted by the Bank for those forms in which default
field value or default field attribute default needs to be changed from the Infosys setting.
The user hooks urhk_TBAF_ChangeFieldValue and urhk_TBAF_ChangeFieldAttrib
should be used.
It can also be used to define ‘Replay key’ events for the form using the userhook
urhk_TBAF_SetReplayKey.
Though both the PreLoad and PostLoad event are very similar in their usage scenario, the
actual event used will depend upon whether the logic is dependent on field values of the
calling form or the called form or not dependent at all. If logic is dependent on field values
of the calling form then PreLoad event should be used. If logic is dependent on field values
of the called form then PostLoad event should be used. If logic is not dependent upon the
field values at all then either one can be used.
SAMPLE SCRIPT:
Similar to 3.1
SCRIPT:
There are no fields available in the INPUT class for this event. However
urhk_TBAF_InquireFieldValue can be used to get the values of the fields in the form
that called this form.
OUTPUTS EXPECTED:
BANCS.OUTPUT.<fldName>
successOrFailure “S” or “F”. If not “S” then fatal error will occur.
This event allows the Bank to implement some minimum workflow capabilities. This can be
done because, when a form that is called from menu is exited, the context of the post-
execute event becomes the menu form and the script can then examine menu fields and
execute key-based events in the menu. This will allow for the automatic calling of another
menu option after exiting from one.
SAMPLE SCRIPT:
SCRIPT:
There are no fields available in the INPUT class for this event. However
urhk_TBAF_InquireFieldValue can be used to get the values of the fields in the form.
OUTPUTS EXPECTED:
This event allows the Bank to implement some minimum workflow capabilities like
automating the visiting of ‘mandatory screens’, protecting/unprotecting of certain fields in
datablock based on values entered in other blocks etc.
SAMPLE SCRIPT:
In this example, a sample script has been written which can be used to invoke all the
mandatory forms to be visited while opening a deposit account automatically.
First we will code the PreLoad script of the deposit form to execute an ‘accept-key’ when the
option block is visited.
Then we will code the pre-replay script of the above key to populate the appropriate option
code into the option field.
Then we will code the post-replay script of the above key to reset the replay key so that
when the option block is visited again the next option is chosen.
SCRIPT NAME :-
tdfe3201PreLoad.scr
<--start
sv_a = urhk_TBAF_SetReplayKey(“optnblk.key-f2|tdoptpre.scr|0|tdoptpost.scr|0”)
exitscript
end-->
SCRIPT NAME :-
tdoptpre.scr
<--start
sv_b = cint(INTBAF.INTBAFC.TbafEventStep)
if (sv_b == 0) then
GOTO STEP0
endif
if (sv_b == 1) then
GOTO STEP1
endif
if (sv_b == 2) then
GOTO STEP2
endif
if (sv_b == 3) then
GOTO STEP3
endif
exitscript
# Populate option as G to visit general details.
STEP0:
sv_a = urhk_TBAF_ChangeFieldValue(“optnblk.acct_opn_option|G”)
exitscript
# Populate option as N to visit Nominee details
STEP1:
sv_a = urhk_TBAF_ChangeFieldValue(“optnblk.acct_opn_option|N”)
exitscript
# Populate option as F to visit Flow details.
STEP2:
sv_a = urhk_TBAF_ChangeFieldValue(“optnblk.acct_opn_option|F”)
exitscript
# Populate option as V to visit Advance details.
STEP3:
sv_a = urhk_TBAF_ChangeFieldValue(“optnblk.acct_opn_option|V”)
exitscript
end-->
Script Name :- tdoptpost.scr
<--start
sv_b = cint(INTBAF.INTBAFC.TbafEventStep)
if (sv_b == 0) then
GOTO STEP0
endif
if (sv_b == 1) then
GOTO STEP1
endif
if (sv_b == 2) then
GOTO STEP2
endif
exitscript
# Populate Replay key to execute Step 1 or Step 2 of pre-script
STEP0:
sv_a = urhk_TBAF_InquireFieldValue (datablk1.nom_available_flg)
if (B2KTEMP.TEMPSTD.TBAFRESULT = “Y”)
sv_a = urhk_TBAF_SetReplayKey(“optnblk.key-f2|tdoptpre.scr|1|tdoptpost.scr|1”)
else
sv_a = urhk_TBAF_SetReplayKey(“optnblk.key-f2|tdoptpre.scr|2|tdoptpost.scr|2”)
exitscript
# Populate Replay key to execute Step 2 of pre-script
STEP1:
sv_a = urhk_TBAF_SetReplayKey(“optnblk.key-f2|tdoptpre.scr|2|tdoptpost.scr|2”)
exitscript
# Populate Replay key to execute Step 3 of pre-script
STEP2:
sv_a = urhk_TBAF_SetReplayKey(“optnblk.key-f2|tdoptpre.scr|3”)
exitscript
end-->
SCRIPT:
There are no fields available in the INPUT class for this event. However
urhk_TBAF_InquireFieldValue can be used to get the values of the fields in the form.
OUTPUTS EXPECTED:
This event allows the Bank to implement some minimum workflow capabilities like
automating the visiting of ‘mandatory screens’, protecting/unprotecting of certain fields in
datablock based on values entered in other blocks etc. Typically used in tandem with Pre
Key Replay event.
This event can also be used to integrate Finacle™ with some other applications. By scripting
this event for the COMMIT key, the Bank can pass the data already entered in Finacle™ to
some other applications.
SAMPLE SCRIPT:
HOT-KEY EVENT
This event occurs whenever a function key which is defined as a ‘Scripting Hot Key” in the
CRT definition file is pressed by a user on any Finacle™ screen.
SCRIPT:
The defined inputs are available in a repository called BANCS, a class called INPUT and with
the field names mentioned below. One can access the inputs by referring to the fields in the
following manner.
BANCS.INPUT.<filedName>
OUTPUTS EXPECTED:
BANCS.OUTPUT.<fldName>
SuccessOrFailure “S” or “F”. If not “S” then fatal error will occur.
This event allows the Bank to interface Finacle™ with their other applications. By defining a
‘hot key’ (which may be applicable on certain pre-defined Finacle™ screens), the bank can
instruct their users to use that key in certain situations where control needs to be
transferred to another application for some additional processing before returning to the
Finacle™ screen. Then this script can be used as the ‘binder’ between Finacle™ and the
other application, in terms of transferring certain data from the Finacle™ screen to the other
application and vice-versa.
Note that for this event to occur, the appropriate ‘crd’ file needs to contain an entry for the
hotkey as shown below:
key-call-script-1 |5|Tba_TrgInvokeScript|
In this example ‘key-call-script-1’ will be passed as the logical key to the HotKeyScript.scr
whenever the user presses CTRL-E on any Finacle™ screen.
SAMPLE SCRIPT:
By default a number of account details (like customer status, mode of operation, balance
break-up etc.) are being displayed. This event occurs whenever such a display occurs.
The account details for the account can be obtained by calling the user hook
ushk_getAcctDetailsInRepository by passing account number as input to the user hook.
(refer document on Scripting User hooks for the functionality details of user hook).
TBAF_ChangeFieldAttrib user hook can be used to display or hide the account details (refer
document on Scripting User hooks for the functionality details of the user hook) being shown
in the ‘account/customer information block’ of the ‘transaction maintenance screen.
SCRIPT
The defined inputs are available in a repository called BANCS, a class called INPUT and with
the field names mentioned below. One can access the inputs by referring to the fields in the
following manner.
BANCS.INPUT.<fieldName>
OUTPUTS EXPECTED:
The script is expected to set the attributes of the required fields appropriately. No other
outputs are expected in the OUTPUT class of BANCS repository.
All account details as defined in the transaction maintenance screen will be displayed.
This event is typically used for controlling the kinds of information about the customer and
account that is to be shown in the ‘transaction maintenance’ screen. The bank can decide
which of the fields are to be ‘hidden’ and which are to be displayed based on the account
number passed to this script.
SAMPLE SCRIPT:
This example shows how to hide account balance fields(except shadow balance) in TM if the
account belongs to an employee
# -----------------------------------------------------------------------------------------
---------
# - sv_a (account id) is the input to user hook getAcctDetailsInRepository
# - Call user hook getAcctDetailsInRepository to put get the Account details
# -----------------------------------------------------------------------------------------
---------
sv_b = urhk_getAcctDetailsInRepository(sv_a)
# if getAcctDetailsInRepository function returns failure exit out of script.
if( sv_b == 1 ) then
exitscript
endif
sv_c=”E”
# ----------------------------------------------------------------------------
# If the acctOwnerShip flag of OUTPARAM class is equal to “E”
# then hide the appropriate fields
# ----------------------------------------------------------------------------
The above script will hide or display the account balances in TM screen of Finacle™.
The script will be called in OCTM menu option in this mode when <KEY-COMMIT> is pressed
after entering the outward clearing part tran and instrument details. The script will be
invoked once for each part tran entry with the event as “OWCLG_LODGE”.
SCRIPT:
The script FinTran.scr should exist in the TBA_SCRIPTS directory. Also, the parameter “Use
Fin. Transactions script?” must have been set as ‘Y’ in SRGPM menu option for the scheme
of the account involved.
The defined inputs are available in a repository called BANCS, a class called INPUT and with
the field names mentioned below. The inputs can be accessed by referring to the field in the
following manner :
BANCS.INPUT.<fieldName>
In addition to the above details, the following instrument wise details are also available.
Here, the field name will include the instrument number also. Hence, for example,
INST3_Amount stands for the amount of the 3rd instrument. In general, the instrument
number is given as a wild card (‘?’). This can actually be any number from 1 to n where n is
the number of instruments involved (available in NumOfInstruments field as given above).
BANCS.OUTPUT.<fldName>
In this mode user can do additional user specific validations on the part transaction and
instrument details, raise exceptions or errors for exception conditions and accept additional
user defined data. More than one exception can be raised from within the script. The
additional data can be accepted by bringing up the general parameter acceptance screen in
which user can define his own fields and accept relevant values for them. If an error is
returned by the script, the lodging of instruments will fail and successful lodging will go
through only on correcting the error condition. If one or more exception is raised from the
script, then all such exceptions will be shown to the user in the exception handler form
which can be overridden if required. If any additional data is accepted by user, then the
same will be saved and will be provided as input to the script in the regularization mode.
SAMPLE SCRIPT:
The script will be called in OCTG, AUTOREG and MCLZOH menu option in this mode when
<KEY-COMMIT> is pressed after request for zone regularization and where the shadow
balance flag is set as ‘Y’.
SCRIPT:
The script FinTran.scr should exist in the TBA_SCRIPTS directory. Also, the parameter “Use
Fin. Transactions script?” must have been set as ‘Y’ in SRGPM menu option for the scheme
of the account involved.
The defined inputs are available in a repository called BANCS, a class called INPUT and with
the field names mentioned below. The inputs can be accessed by referring to the field in the
following manner.
BANCS.INPUT.<fieldName>
BANCS.OUTPUT.<fldName>
In this mode user can use the additional user defined data specified at lodging time to do
some additional processing (for e.g. initiate a workflow to execute some other menu option).
Irrespective of the value returned by the script, the regularization process will continue. If
any additional processing like initiating a work flow is specified within the script, then the
corresponding action is done.
SAMPLE SCRIPT:
The script will be called in TM menu option in this mode when the part tran details are
entered in the TM menu option and <KEY-ACCEPT> is pressed. Here the event will be
“TM_ENTRY”.
SCRIPT:
The script FinTran.scr should exist in the TBA_SCRIPTS directory. Also, the parameter “Use
Fin. Transactions script?” must have been set as ‘Y’ in SRGPM menu option for the scheme
of the account involved.
The defined inputs are available in a repository called BANCS, a class called INPUT and with
the field names mentioned below. The inputs can be accessed by referring to the field in the
following manner.
BANCS.INPUT.<fieldName>
TodLvlIntFlg The TOD level interest flag for the Instant TOD
BANCS.OUTPUT.<fldName>
SuccessOrFailure To check whether the script returned success or failure. “S” for
success and “F” for failure. If “F”, then the error message given
in the next field below will be displayed and the <ACCEPT> will
fail.
ErrorDesc Any error message in case of script failure.
AddtlDetails The additional user defined and accepted data if any. This will be
saved in the database for later usage.
DeleteUAD The flag to indicate whether to delete the UAD record (User
additional detail) or not. Values “Y” for delete and “N” for do not
delete. In this mode, this output is not relevant. Any value can
be passed back.
In this mode user can do additional user specific validations on the part transaction, raise
exceptions or errors for exception conditions and accept additional user defined data. More
than one exception can be raised from within the script. The additional data can be accepted
by bringing up the general parameter acceptance screen in which user can define his own
fields and accept relevant values for them. If an error is returned by the script, the part
transaction entry will fail and successful entry will go through only on correcting the error
condition. If one or more exception is raised from the script, then all such exceptions will be
shown to the user in the exception handler form at the time of posting which can be
overridden if required. If any additional data is accepted by user, then the same will be
saved and will be provided as input to the script in the post mode.
SAMPLE SCRIPT:
The script will be called in the TM menu option in this mode when the individual part trans
are being requested for posting (i.e. when option code is given as ‘P’ and <KEY-ACCEPT> is
pressed. Here the event will be “TM_REQUEST_POST”.
SCRIPT:
The script FinTran.scr should exist in the TBA_SCRIPTS directory. Also, the parameter
“Use Fin. Transactions script?” must have been set as ‘Y’ in SRGPM menu option for the
scheme of the account involved.
The defined inputs are available in a repository called BANCS, a class called INPUT and with
the field names mentioned below. The inputs can be accessed by referring to the field in the
following manner.
BANCS.INPUT.<fieldName>
BANCS.OUTPUT.<fldName>
SuccessOrFailure To check whether the script returned success or failure. “S” for
success and “F” for failure. If “F”, then the error message given
in the next field below will be displayed and the POSTING
REQUEST will fail.
ErrorDesc Any error message in case of script failure.
AddtlDetails The additional user defined and accepted data if any. In this
mode, the input addtdetails should be copied to this output field
as no modification is allowed here.
DeleteUAD The flag to indicate whether to delete the UAD record (User
additional detail) or not. Values “Y” for delete and “N” for do not
delete. In this mode, this output is not relevant. Any value can be
passed back.
In this mode user can do additional user specific validations on the part transaction, raise
exceptions or errors for exception conditions and validate the additional user defined data
specified in the entry mode. If an error is returned by the script, the part transaction posting
request will fail and successful posting request will go through only on correcting the error
condition. If one or more exception is raised from the script, then all such exceptions will be
shown to the user in the exception handler form which can be overridden if required. If the
Instant TOD amount has changed due to some other transaction, then the script can decide
whether the user needs to visit the Instant TOD details screen again. The user hook,
getAcctDetailsInRepository has to be called to obtain all the available amounts and the script
can decide based on these available amounts and the 2 inputs, InstantTodAmt and
TodLvlIntFlg.
SAMPLE SCRIPT:
The script will be called in TM menu option in this mode when for each part tran, option code
is given as ‘J’ and <KEY-ACCEPT> is pressed. Here the event will be
“TM_USER_ADDTL_DETAILS”.
SCRIPT:
The script FinTran.scr should exist in the TBA_SCRIPTS directory. Also, the parameter
“Use Fin. Transactions script?” must have been set as ‘Y’ in SRGPM menu option for the
scheme of the account involved.
The defined inputs are available in a repository called BANCS, a class called INPUT and with
the field names mentioned below. The inputs can be accessed by referring to the field in the
following manner.
BANCS.INPUT.<fieldName>
BANCS.OUTPUT.<fldName>
SuccessOrFailure To check whether the script returned success or failure. “S” for
success and “F” for failure. If “F”, then the error message given in
the next field below will be displayed on the screen and cursor will
be positioned at the option code.
ErrorDesc Any error message in case of script failure.
AddtlDetails The additional user defined and accepted data if any. Since this
mode is only to display the data, no modifications are allowed.
Hence, the input addtdetails should be copied to this output field
and returned back.
DeleteUAD The flag to indicate whether to delete the UAD record (User
additional detail) or not. Values “Y” for delete and “N” for do not
delete. In this mode, this output is not relevant. Any value can be
passed back.
In this mode user can view the additional details specified in the entry mode. He cannot
modify the data. In case the data needs to be modified, it can be done as part of part tran
modification only.
SAMPLE SCRIPT:
The script will be called in TM menu option in this mode when for each part tran, option code
is given as ‘K’ (Check part tran exceptions) and <KEY-ACCEPT> is pressed. Here the event
will be “TM_CHECK_EXCEPTION”.
SCRIPT:
The script FinTran.scr should exist in the TBA_SCRIPTS directory. Also, the parameter
“Use Fin. Transactions script?” must have been set as ‘Y’ in SRGPM menu option for the
scheme of the account involved.
The defined inputs are available in a repository called BANCS, a class called INPUT and with
the field names mentioned below. The inputs can be accessed by referring to the field in the
following manner.
BANCS.INPUT.<fieldName>
BANCS.OUTPUT.<fldName>
SuccessOrFailure To check whether the script returned success or failure. “S” for
success and “F” for failure. If “F”, then the error message given in
the next field below will be displayed on the screen and cursor will
be positioned at the option code.
ErrorDesc Any error message in case of script failure.
AddtlDetails The additional user defined and accepted data if any. The input
addtdetails should be copied to this output field and returned back
as no modifications of addtldetails are allowed in this mode.
DeleteUAD The flag to indicate whether to delete the UAD record (User
additional detail) or not. Values “Y” for delete and “N” for do not
delete. In this mode, this output is not relevant. Any value can be
passed back.
In this mode user will have to perform the same validations that he performed during entry
mode for raising any exceptions. The same exceptions, if any, must be raised in this mode
so that these too appear along with the built-in exceptions for this part tran in the exception
display window. There is no data modification in this mode.
SAMPLE SCRIPT:
The script will be called in this mode whenever any financial part tran is being posted (by
any module) in the application. Here the event will be “PTRAN_POSTING”.
SCRIPT:
The script FinTran.scr should exist in the TBA_SCRIPTS directory. Also, the parameter “Use
Fin. Transactions script?” must have been set as ‘Y’ in SRGPM menu option for the scheme
of the account involved.
The defined inputs are available in a repository called BANCS, a class called INPUT and with
the field names mentioned below. The inputs can be accessed by referring to the field in the
following manner.
BANCS.INPUT.<fieldName>
BANCS.OUTPUT.<fldName>
SuccessOrFailure To check whether the script returned success or failure. “S” for
success and “F” for failure. If “F” then posting will fail citing the
reason given in the field below
ErrorDesc Any error message in case of script failure – why posting should
fail.
AddtlDetails The additional user defined and accepted data if any. The input
addtdetails should be copied to this output field and returned back
as no modifications of addtldetails are allowed in this mode.
DeleteUAD The flag to indicate whether to delete the UAD record (User
additional detail) or not. Values “Y” for delete and “N” for do not
delete. If “Y” then the additional details stored in the database will
be permanently deleted.
In this mode user can do additional user specific validations on the part transaction, raise
exceptions or errors for exception conditions and use the additional user defined data
specified at entry time to do some additional processing (for e.g. initiate a workflow to
execute some other menu option).. More than one exception can be raised from within the
script. If an error is returned by the script, the part transaction posting will fail and
successful entry will go through only on correcting the error condition. If one or more
exception is raised even then part tran posting fails. If any additional processing is specified
within the script, then the corresponding action is taken.
The Instant TOD amount might have changed between entry and posting. This can happen
due to the available amount having changed because of some other transaction or sanction
limit/drawing power change. Based on the two inputs, InstantTodAmt and TodLvlIntFlg and
the available amounts present in the user hook getAcctDetailsInRepository, the script can
decide whether the user has to visit the Instant TOD details screen again.
SAMPLE SCRIPT:
SCRIPT NAMES :
1 mcfe3009PreLoad.scr
This contain the values for the different fields of the form. Depending on the menu option
different values can be populated for the fields of the form.
2 Ttumupload.scr
This is the script which will be called from the menu option . The name of the script can be
mentioned in preload script of TTUM menu option (mcfe3009PreLoad.scr).
e.g.
sv_a= urhk_TBAF_SetValue("mcfe3009.datablk.pg0_script_name|Ttumupload.scr")
Ttumupload.scr internally calls one of the following scripts depending on the version of the
upload file.
If upload format is being used is different than vrp1.6.38 , then corresponding change has
to be made in Ttumupload.scr.
6 Ttumupload.scr :
Our objective of this menu option is to upload the transfer transaction records. The file
containing the records to be uploaded will be taken as input.
The input to the script is the entire line of the record to be uploaded. This line should
conform to the format specified for Menu option: TTUM in upload document.
None.
7 parseTTUM1595.scr
8 parseTTUM1635.scr
9 parseTTUM1638.scr
Above scripts contain the parsing logic for the record to be uploaded.
This will parse the input record and give values of different fields.
This script after parsing for different fields , will validate those fields. In case of failure it will
populate MTT.Error.Description with error message and make a call to MTT user hook
urhk_MTTS_ReportErrorCondition(""). This will also populate
BANCS.OUTPUT.successOrFailure = "F" in case of failure.
The input to the script is the entire line of the record to be uploaded.
If the part tran is HO part tran following additional fields will be delivered.
11 DD issue
12 DD cancellation
13 DD duplicate issue
14 HO Charges –
15 Originating credit
16 Originating reversal
17 Clearing functions
18 Inward rejections
21 MICR charges
22 Outward Clearing
23 Account upkeep
24 Account Opening
25 Account Maintenance
26 Account Closure
34 BG issue
35 BG modification of clauses
37 DC Issue
44 General Charges
These charges are categorised into Four types. Service triggered charges, Deferred charges,
Batch charges and non-standard event triggered charges (general charges).
Service triggered charges are computed and charged at the time of delivery of the service. A
DD Issue charge is calculated and charged from the customer who has requested for the
DD. These become additional part transactions along with the part transactions for DD
Issue. Each such Service (Event) is “Known” to the application and is available in PTTM
menu option as “Event Type”.
Deferred charges refer to service charges that are not charged at the time of delivering the
service, but deferred to a later period. Charges which are calculated at periodic intervals –
Account opening, Pass sheet printing. For eg: if DEFCALC is set up for daily calculation, all
accounts opened that day and all accounts for which pass sheets were printed that day
would be charged for the service.
Batch charges are similar except batch charges are for a set of similar services and are
setup to be charged for a period of time. For eg: Ledger Folio entries for three months can
be charged based on the number of entries. Charges which fall under this umbrella are:
Ledger Folio, Minimum balance, Account maintenance, Inactive account
maintenance, Domant account maintenance and Commitment charges.
Over and above this, General Charges is provided as a way of calculating non-standard
charges (like locker charges etc.). These are charged on-line from General charges menu
option.
Scripts can be used to tailor the charges over and above the functionality provided by the
existing setup menu options (Please refer to the document on Event Charges for further
details). Each charge here is associated with an Event Type which is “known” to the
application. Link to a script can be established in PTTM menu option for each of the services
mentioned above (and an GCHRG event for general charges). This script has a set of
common repository variables which are always passed to the script.
For all scripts mentioned under Event Based charges section, the BANCS.INPUT class has a
common set of fields. The output always is a currency code and an amount. The input list
which is common to all the scripts set up through PTTM is given below.
The defined common inputs for all the scripts set up through PTTM are available in a
repository called BANCS, a class called INPUT and with the field names mentioned below.
One can access the inputs by referring to the fields in the following manner.
BANCS.INPUT.<fieldName>
SCRIPT
The script name can be anything but it should be present in TBA_SCRIPTS directory.
The defined inputs are available in a repository called BANCS, a class called INPUT and with
the field names mentioned below. One can access the inputs by referring to the fields in the
following manner
BANCS.INPUT.<fieldName>
DD Amount Dd_amt
The Output of the script will be available in OUTPUT class of BANCS repository. The values to
be populated are
BANCS.OUTPUT.<fieldName>
Sometimes it might be required that the discount percentage for a customer is dependent
on the Demand Draft amount. In all these cases the script can be used to arrive at the
charges.
SAMPLE SCRIPT
SCRIPT:
The script name can be anything but it should be present in TBA_SCRIPTS directory.
The defined inputs are available in a repository called BANCS, a class called INPUT and with
the field names mentioned below. One can access the inputs by referring to the fields in the
following manner
BANCS.INPUT.<fieldName>
The Output of the script will be available in OUTPUTclass of BANCS repository. The values to
be populated are
BANCS.OUTPUT.<fieldName>
The event id set up in PTTM does not take into consideration the number of leaves in a
chequebook while calculating the charges. So in all cases where the charge amount is
dependent on number of leaves the script will have to be used.
SAMPLE SCRIPT
SCRIPT
The script name can be anything but it should be present in TBA_SCRIPTS directory.
The defined inputs are available in a repository called BANCS, a class called INPUT and with
the field names mentioned below. One can access the inputs by referring to the fields in the
following manner
BANCS.INPUT.<fieldName>
The Output of the script will be available in OUTPUT class of BANCS repository. The values to
be populated are
BANCS.OUTPUT.<fieldName>
The event id set up in PTTM does not take into consideration the number of leaves while
calculating the charges. So in all cases where the charge amount is dependent on number of
leaves the script will have to be used. Another case would be to charge different amount if
the cheque is stopped due to lack of balance in the account.
SAMPLE SCRIPT
These scripts can be used to generate the charges for premature account closure.
SCRIPT
The script name can be anything but it should be present in TBA_SCRIPTS directory.
The defined inputs are available in a repository called BANCS, a class called INPUT and with
the field names mentioned below. One can access the inputs by referring to the fields in the
following manner
BANCS.INPUT.<fieldName>
The Output of the script will be available in OUTPUT class of BANCS repository. The values to
be populated are
BANCS.OUTPUT.<fieldName>
In all cases where the charge to be collected depends on the scheme code to which the
account belongs the script can be used. Another case would be for the accounts which have
the same charge level code but a few of the accounts have to be charged differently this
script can be used.
SAMPLE SCRIPT
Define one or more transactions each with a user defined set of part transactions. The only
restriction is that the transaction should be balanced.
Consolidate one or more part transactions given a set of identical transactions. All
transactions will be merged into one and all part transactions where consolidation is
required will be made into a single part transaction. You can skip a whole transaction while
merging a set of transactions.
Define contra or consolidated contra part transactions for one or more part transactions.
Customise part transactions through account definition, amount derivation logic, remarks,
particulars and report codes population.
Amount derivation logic includes amount table code set-up based calculation.
Flag error conditions with suitable error messages, which will be printed in the error report.
Example:
Consider an account where interest has been collected in advance and credited to an "Advance interest
account".
During interest calculation, the interest amount is more than that collected in advance.
Hence the advance amount should be recognised for profit and loss and the remaining
interest should be taken from the customer's operative account.
During interest calculation, if the account balance in the operative account is less than the
minimum balance for that account, then the amount above the minimum balance limit
should be debited from the operative account and the remaining amount should be debited
from the shortfall account.
In such cases, the MTT can be used to perform the above operations.
7 SECTION OBJECTIVE
The Objective of this section is to introduce the user to the concepts of Maha Transaction
Template (Referred as MTT in short), The transaction creation events where the MTT can be
invoked and the user hooks available to MTT. The pre requisite must be the user must have
sufficient knowledge of Finacle™ and Scripting in Finacle™.
8 PROCESSES INVOLVED
MTT is basically a combination of the record layout concept of MRT and the functionality of
PTT implemented using Script Engine. The limitation in PTT of accepting only one input
amount based on which the additional set of part transactions have to be derived are
overcome in MTT. In this template, the part transaction definition can be based on more
than one amount and can also be conditional. The script engine in MTT makes use of special
script hooks to define a complete transaction. All the flexibility of the script, like conditional
statements, amount manipulation etc. is directly available in MTT.
Each script hook in MTT reads data from the script from a special class defined in the MTT
repository. The field Repository Name, which is default populated with the value MTT and
cannot be modified, is a mandatory field for all the user hooks. The user hooks that are
mandatory in any MTT script are described below.
9 MTTUSERHOOKS
9.1 DEFINETRANSACTION
You can use this script hook to initiate a transaction.
SYNTAX:
FUNCTIONALITY:
This function allows the script to initiate a financial transaction by defining some of its
attributes. A name is used while the transaction is being defined so that multiple
transactions can be defined in the same script. Each transaction having a unique identifier
string value.
INPUT:
Input String contains the identification of the transaction. This identifier should be referred
to while defining the part-transaction to link the part-transaction to the transaction.
Scripting Events ver. 1.00 Page 47
ExpertEdge Software Finacle™ Training Document
Example - “XYZ”
Output:
The return value will be 0 in case the transaction definition is accepted. If not, it will be 1.
9.2 DEFINEPARTTRAN
This script hook accepts all data required to define a complete part transaction.
SYNTAX:
FUNCTIONALITY:
This function allows the script to initiate a financial transaction by defining some of its
attributes. The attributes are first made available in the MTT.PartTranDetails class. A call is
made to define the part transaction after that. The class variables are identified in the table
below.
INPUT:
The input string contains the identification of the part-transaction. This is used to
consolidate multiple part-transactions into one part-transaction for all part-transactions
where consolidate flag is set.
Example - “XYZ”
Additional Part Transaction Details for Loan Accounts (LAA Scheme Types)
Additional Part Transaction Details for Loan Interest Accounts (OAB Scheme Type of
accounts that is partitioned by partition type ‘LOANS’)
Additional Part Transaction Details for Deposit Accounts (TDA Scheme Types)
Each part transaction that is defined should also have a unique name and should be passed
as an argument to the user hook. Each part transaction has a TranIdentifier field that
contains the name of the transaction. Using this, you can define multiple transactions in a
given script. A negative amount indicates a debit part transaction while a positive amount
includes a credit amount transaction.
OUTPUT:
The return value will be 0 in case the transaction definition is accepted. If not, it will return
1.
Example
#The following defines a commission part transaction based on Bill Amount, Bill Currency
and Commission Code
if (MTT.InputDetails.CommissionCode != "") then
BANCS.INPARAM.InputAmount=MTT.InputDetails.BillAmount
BANCS.INPARAM.CurrencyCode=MTT.InputDetails.HomeCurrency
BANCS.INPARAM.AmountTableCode=MTT.InputDetails.CommissionCode
sv_r = urhk_B2k_GetASTMAmount("")
sv_z = CDOUBLE(BANCS.OUTPARAM.OutputAmount)
MTT.PartTranDetails.RefAmount=CDOUBLE(BANCS.OUTPARAM.OutputAmount)
MTT.PartTranDetails.Account=MTT.InputDetails.CommAcct
sv_z = MTT.InputDetails.CommAcct
MTT.PartTranDetails.RefCurrency=MTT.InputDetails.HomeCurrency
MTT.PartTranDetails.ValueDateDiff="0"
MTT.PartTranDetails.Consolidate="N"
MTT.PartTranDetails.TranIdentifier="BillCharges"
MTT.PartTranDetails.PTranBusinessType="5"
sv_r = urhk_MTTS_DefinePartTran("COMMISSION")
# “COMMISSION” is used to refer to this part transaction later.
endif
9.3 POPULATEINPUTDETAILS
This script hook populates the event specific fields in the InputDetails class for the next
entity that needs processing. This is needed at the beginning of the script hook and in each
loop, if multiple entities need to be processed at a time. This script hook requires no inputs.
The return value of the hook should be checked for each of the items to be processed.
SYNTAX:
This function gets all the details put out by the MTT event in repository variables. The details
depend on the current event that is in process. This is equivalent to defining the transaction
header details in some respects.
INPUT:
OUTPUT:
The return value will be zero (0) in case the processing is successful. If not, it will return 1.
The actual fields depend on the event.
9.4 ENDDEFINITION
This script hook is required if it has a loop for processing multiple entities. It signifies the
end of the complete definition for a given entity and the start of the processing for the next
entity. This script hook also requires no inputs.
SYNTAX:
This function signals the end of definition for a part-transaction or transaction. It is needed
only if the script has a loop for processing multiple entities. This hook ensures that a part
transaction is created in internal storage variables within the application based on the
MTT.PartTranDetails class variables populated.
INPUT:
OUTPUT:
The return value will be 0 in case the processing is successful. If not, it will return 1.
The PopulateInputDetails class should be called before accessing any of the variables in
the InputDetails class.
A transaction should be defined before creating any part transaction for it.
All the required fields should be explicitly assigned values before each call to the user
hook. This is because each hook clears all the variables of the corresponding class.
10 APPENDIX
10.1 FIELDS IN STDIN CLASS IN BANCS REPOSITORY
1.
"languageCode" This field conatins the value of the
language code of the user e.g.
INFENG
2.
"userId" The userid of the user who executed
the script
3.
"onlineOrBatch" Whether this script is being executed
through a batch program or online (
"O" or "B")
4.
"userWorkClass" The workclass of the userid who
executed the script from UPM
5.
"menuOption" The menui option which called this
script
6.
"homeCrncyCode" The home currency of the data
center from SCFM
7.
"homeCrncyAlias" The home currency alias
8.
"CurrentBancsVersion" The Finacle™ version
9.
"myBankCode" The bank code opf the database
10.
"myBrCode" The branch code of the SOL
11.
"myExtCode" The Extentison counter
12.
"mySolId" The SOLID
13.
"mySolAlias" The SOLALIAS
14.
" mySolDesc" The description for the Sol as
specified in SCFM
15.
" homeSolId" The Sol to which the User belongs
16.
" homeSolAlias" The Home SOL Alias
17.
" homeSolDesc" The Home Sol description as
specified in SCFM.
18.
"dcAlias" The DC ALIAS
19.
"SBString" The value of custoption for SBSTING
20.
"CAString" The value of custoption for CASTING
21.
"LLString" The value of custoption for LLSTING
22.
"CCString" The value of custoption for CCSTING
23.
"sysDate" The system date of the machine
24.
"BODDate" The current BOD date of the SOL
25.
"termClass" The terminal class from TPM
26.
" moduleIdentity" The module which is calling the
Script
27.
"TestFlg" Whether the script is being invoked
in test mode. E.g through menu
option “SCRIPT”
28.
"WFflg" Whether the script is a workflow
script
29.
"ScriptName" The name of the script