0% found this document useful (0 votes)
12 views

Course Document Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Uploaded by

Manasa C M
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Course Document Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Uploaded by

Manasa C M
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 207

Transact Programming Foundation TR3PRGFO -

R22 Revision 1 English

©2023 Temenos Headquarters SA - all rights


reserved.
Warning: This document is protected by copyright
law and international treaties. Unauthorised
reproduction of this document, or any portion of
it, may result in severe and criminal penalties, and
will be prosecuted to the maximum extent
possible under the law.
Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Table of Contents

Table of Contents ................................................................................................................................................................................... 1


Document History .................................................................................................................................................................................. 8
Introduction ............................................................................................................................................................................................. 9
Lesson Overview ............................................................................................................................................................................................... 9
Your Course » Objective and Learning Outcomes ............................................................................................................................... 10
Your Course » Timetable ............................................................................................................................................................................. 11
Programming Foundation » Getting Started with jBC ......................................................................................................................... 12
Design Studio » Transact Design Studio ................................................................................................................................................. 13
Design Studio » Launch Design Studio IDE and Start H2 Database ................................................................................................ 14
Design Studio » Enterprise Design Studio .............................................................................................................................................. 15
Design Studio » Creating a New Project .................................................................................................................................................. 16
Design Studio » Toggle TAFJ Project Nature » Setting TAFJ_HOME ................................................................................................ 17
Design Studio » Use Existing Property File ............................................................................................................................................. 18
Design Studio » Properties » Precompiled ............................................................................................................................................. 19
Design Studio » Properties » Database ................................................................................................................................................... 20
Design Studio » Adding a Folder for the Programs .............................................................................................................................. 21
Design Studio » Programs in jBC ............................................................................................................................................................... 22
Design Studio » Programs in jBC ............................................................................................................................................................... 23
Design Studio » Compiling the Code ....................................................................................................................................................... 24
Design Studio » Execute the Program...................................................................................................................................................... 25
Design Studio » Execute the Program » Run Configuration .............................................................................................................. 26
Design Studio » Execute the Program » Run Configuration .............................................................................................................. 27
Design Studio » Invoking Subroutines in jBC ......................................................................................................................................... 28
Design Studio » Compiling the Subroutine ............................................................................................................................................ 29
Design Studio » Compiling the Subroutine ............................................................................................................................................ 30
Design Studio » Compiling the Subroutine ............................................................................................................................................ 31
Design Studio » Calling Subroutine .......................................................................................................................................................... 32
Design Studio » Invoking Programs in jBC ............................................................................................................................................. 33
Common Variables » Know your Variables ............................................................................................................................................ 34
Common Variables » Accept User Input ................................................................................................................................................. 35
Common Variables ........................................................................................................................................................................................ 36
Common Variables » Local Variables » Visibility .................................................................................................................................. 37
Common Variables » Variables with Global visibility .......................................................................................................................... 38
Common Variables » INSERT Files ............................................................................................................................................................ 39
Common Variables » INSERT Files ............................................................................................................................................................ 40
Common Variables » Variable Scope ....................................................................................................................................................... 41

2 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Lesson Summary ............................................................................................................................................................................................ 42


Practice ................................................................................................................................................................................................... 43
Practice 1.......................................................................................................................................................................................................... 43
Practice 1 » Solution ..................................................................................................................................................................................... 44
Practice 1 » Solution ..................................................................................................................................................................................... 45
Practice 1 » Solution ..................................................................................................................................................................................... 46
jBC Programming Constructs ........................................................................................................................................................... 47
Lesson Overview ............................................................................................................................................................................................ 47
Conditional Execution » The Way jBC Works ........................................................................................................................................ 48
Conditional Execution .................................................................................................................................................................................. 49
Conditional Execution » CASE Construct ................................................................................................................................................ 50
Conditional Execution » CASE Construct ................................................................................................................................................ 51
Looping Constructs ....................................................................................................................................................................................... 52
Looping Constructs ....................................................................................................................................................................................... 53
Looping Constructs » FOR…NEXT .............................................................................................................................................................. 54
Looping Constructs » BREAK and CONTINUE ........................................................................................................................................ 55
Paragraphs ....................................................................................................................................................................................................... 56
Paragraphs » Comments ............................................................................................................................................................................. 57
Paragraphs » Modular Code ....................................................................................................................................................................... 58
Paragraphs » Creation of Paragraph ........................................................................................................................................................ 59
Editor Functionality ....................................................................................................................................................................................... 60
Editor Functionality ....................................................................................................................................................................................... 61
Editor Functionality ....................................................................................................................................................................................... 62
Debug Basic Code.......................................................................................................................................................................................... 63
Debug Basic Code » Debug View .............................................................................................................................................................. 64
Debug Basic Code » Variables and Expressions View ......................................................................................................................... 65
Lesson Summary ............................................................................................................................................................................................ 66
Practice ................................................................................................................................................................................................... 67
Practice 1.......................................................................................................................................................................................................... 67
Practice 1 » Solution ..................................................................................................................................................................................... 68
Practice 1 » Solution ..................................................................................................................................................................................... 69
Practice 1 » Solution ..................................................................................................................................................................................... 70
Practice 1 » Solution ..................................................................................................................................................................................... 71
Practice 2.......................................................................................................................................................................................................... 72
Practice 2 » Solution ..................................................................................................................................................................................... 73
Practice 2 » Solution ..................................................................................................................................................................................... 74
Practice 2 » Solution ..................................................................................................................................................................................... 75
Practice 2 » Solution ..................................................................................................................................................................................... 76
Dynamic and Dimensioned Arrays ................................................................................................................................................. 77

3 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Lesson Overview ............................................................................................................................................................................................ 77


Arrays in jBC » Scenario 1............................................................................................................................................................................ 78
Arrays in jBC .................................................................................................................................................................................................... 79
Arrays in jBC » Scenario 2............................................................................................................................................................................ 80
Arrays in jBC » Scenario 2............................................................................................................................................................................ 81
Arrays in jBC » Scenario 3............................................................................................................................................................................ 82
Arrays in jBC » Subvalue Markers (SM) ................................................................................................................................................... 83
Arrays in jBC .................................................................................................................................................................................................... 84
Arrays in jBC .................................................................................................................................................................................................... 85
Dynamic Array » Manipulation » Scenario 4 .......................................................................................................................................... 86
Dynamic Array » Manipulation » Append Fields ................................................................................................................................... 87
Dynamic Array » Manipulation » Append Values ................................................................................................................................. 88
Dynamic Array » Manipulation » Direct Assignment at a Location ................................................................................................. 89
Dynamic Array » Manipulation » Direct Assignment at a Location ................................................................................................. 90
Dynamic Array » Manipulation » Append Subvalues .......................................................................................................................... 91
Dynamic Array » Manipulation .................................................................................................................................................................. 92
Dynamic Array » Insert Elements .............................................................................................................................................................. 93
Dynamic Array » Insert Elements .............................................................................................................................................................. 94
Dynamic Array » Search Elements ............................................................................................................................................................ 95
Dynamic Array » Search Elements ............................................................................................................................................................ 96
Dynamic Array » Search Elements ............................................................................................................................................................ 97
Dynamic Array » Search Elements ............................................................................................................................................................ 98
Dynamic Array » Search Elements ............................................................................................................................................................ 99
Dynamic Array » Search Elements ..........................................................................................................................................................100
Dynamic Array » Search Elements ..........................................................................................................................................................101
Dynamic Array » Search Elements ..........................................................................................................................................................102
Dimensioned Array......................................................................................................................................................................................103
Dimensioned Array......................................................................................................................................................................................104
Lesson Summary ..........................................................................................................................................................................................105
Practice ................................................................................................................................................................................................ 106
Practice 1........................................................................................................................................................................................................106
Practice 1 » Solution ...................................................................................................................................................................................107
Practice 2........................................................................................................................................................................................................108
Practice 2 » Solution ...................................................................................................................................................................................109
Practice 2 » Solution ...................................................................................................................................................................................110
Practice 2 » Solution ...................................................................................................................................................................................111
Practice 2 » Solution ...................................................................................................................................................................................112
Practice 2 » Solution ...................................................................................................................................................................................113
Practice 2 » Solution ...................................................................................................................................................................................114

4 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 3........................................................................................................................................................................................................115
Practice 3 » Solution ...................................................................................................................................................................................116
Practice 4........................................................................................................................................................................................................117
Practice 4 » Solution ...................................................................................................................................................................................118
Practice 5........................................................................................................................................................................................................119
Practice 5 » Solution ...................................................................................................................................................................................120
Practice 6........................................................................................................................................................................................................121
Practice 6 » Solution ...................................................................................................................................................................................122
Practice 7........................................................................................................................................................................................................123
Practice 7 » Solution ...................................................................................................................................................................................124
Practice 7 » Solution ...................................................................................................................................................................................125
TUT ........................................................................................................................................................................................................ 126
Lesson Summary ..........................................................................................................................................................................................126
UTF Methods » UnitTest Framework ......................................................................................................................................................127
SIMPLE.CALCULATOR API .........................................................................................................................................................................128
SIMPLE.CALCULATOR API .........................................................................................................................................................................129
SIMPLE.CALCULATOR API .........................................................................................................................................................................130
TESTCASE .......................................................................................................................................................................................................131
TESTCASE » Steps ........................................................................................................................................................................................132
TESTCASE » Global UTF Methods ............................................................................................................................................................133
TESTCASE » Global UTF Methods ............................................................................................................................................................134
TESTCASE » Global UTF Methods ............................................................................................................................................................135
Using IDE to Set the target ........................................................................................................................................................................136
TESTCASE » Global UTF Methods ............................................................................................................................................................137
TESTCASE » Assertion .................................................................................................................................................................................138
TESTCASE » Running the Test ..................................................................................................................................................................139
TESTCASE » Debugging the Test .............................................................................................................................................................140
Stubs ................................................................................................................................................................................................................141
Stubs ................................................................................................................................................................................................................142
Stubs ................................................................................................................................................................................................................143
Stubs » Using the IDE to Add STUB and StubParam ..........................................................................................................................144
Stubs ................................................................................................................................................................................................................145
Assertions » NUMBER.DIVISION Test .....................................................................................................................................................146
Lesson Summary ..........................................................................................................................................................................................147
Practice ................................................................................................................................................................................................ 148
Practice 1........................................................................................................................................................................................................148
Practice 1 » Solution ...................................................................................................................................................................................149
Practice 1 » Solution ...................................................................................................................................................................................150
Practice 1 » Solution ...................................................................................................................................................................................151

5 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution ...................................................................................................................................................................................152


Practice 1 » Solution ...................................................................................................................................................................................153
Practice 1 » Solution ...................................................................................................................................................................................154
Practice 1 » Solution ...................................................................................................................................................................................155
Practice 1 » Solution ...................................................................................................................................................................................156
Practice 1 » Solution ...................................................................................................................................................................................157
Transact API and Caching ............................................................................................................................................................... 158
Lesson Overview ..........................................................................................................................................................................................158
Transact Caching .........................................................................................................................................................................................159
Transact Caching » Levels of Caching....................................................................................................................................................160
Transact Caching » Levels of Caching » Static Cache .......................................................................................................................161
Transact Caching » Levels of Caching » Named Cache ....................................................................................................................162
Transact Caching » Levels of Caching » Transaction Cache ............................................................................................................163
Transact APIs .................................................................................................................................................................................................164
Transact APIs » Example of Standardization » Opening Files .........................................................................................................165
Transact APIs » Opening Files ..................................................................................................................................................................166
Transact APIs » Adding to Transaction Cache .....................................................................................................................................167
Transact APIs » Read to Dynamic Array » F.READ ..............................................................................................................................168
Transact APIs » Example » Code Using F.READ ...................................................................................................................................169
Transact APIs » Creating the PGM.FILE Record ...................................................................................................................................170
Transact APIs » Launch EX .........................................................................................................................................................................171
Transact APIs » Execute the SUBROUTINE ............................................................................................................................................172
Transact APIs » Read to Dimensioned Array » F.MATREAD .............................................................................................................173
Transact APIs » MATREAD .........................................................................................................................................................................174
Transact APIs » Locking..............................................................................................................................................................................175
Transact APIs » Read with Lock to Dynamic Array » F.READU ........................................................................................................176
Transact APIs » Read with Lock to Dimensioned Array » F.MATREADU ......................................................................................177
Transact APIs » Writing to Transaction Cache .....................................................................................................................................178
Transact APIs » Write as Dynamic Array » F.WRITE ...........................................................................................................................179
Transact APIs » Write as Dimensioned Array » F.MATWRITE ..........................................................................................................180
Transact APIs » Releasing the Lock.........................................................................................................................................................181
Transact APIs » Adding to Static Cache » CACHE.READ ...................................................................................................................182
Transact APIs » CACHE.READ ...................................................................................................................................................................183
Transact APIs » Named Cache .................................................................................................................................................................184
Transact APIs » Date APIs ..........................................................................................................................................................................185
Transact APIs » Date APIs ..........................................................................................................................................................................186
Lesson Summary ..........................................................................................................................................................................................187
Practice ................................................................................................................................................................................................ 188
Practice 1........................................................................................................................................................................................................188

6 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution ...................................................................................................................................................................................189


Practice 1 » Solution ...................................................................................................................................................................................190
Practice 1 » Solution ...................................................................................................................................................................................191
Practice 1 » Solution ...................................................................................................................................................................................192
Practice 1 » Solution ...................................................................................................................................................................................193
Practice 1 » Solution ...................................................................................................................................................................................194
Practice 2........................................................................................................................................................................................................195
Practice 2 » Solution ...................................................................................................................................................................................196
Practice 2 » Solution ...................................................................................................................................................................................197
Practice 2 » Solution ...................................................................................................................................................................................198
Practice 2 » Solution ...................................................................................................................................................................................199
Practice 2 » Solution ...................................................................................................................................................................................200
Practice 2 » Solution ...................................................................................................................................................................................201
Practice 2 » Solution ...................................................................................................................................................................................202
Practice 2 » Solution ...................................................................................................................................................................................203
Practice 2 » Solution ...................................................................................................................................................................................204
Practice 2 » Solution ...................................................................................................................................................................................205
Practice 2 » Solution ...................................................................................................................................................................................206

7 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Document History

Author Version Release Date Comments

TLC CaTS 1.0 1-Jan-23 Initial document.

8 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Introduction
Lesson Overview
In this lesson, I am going to describe what Your Course is all about, Programming Foundation, Design Studio, and Common
Variables.

9 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Your Course » Objective and Learning Outcomes


This course will allow you to: Describe Overview of programming in Transact using DS. In particular you will be able to: Define
JBC commands. Describe programming constructs. Identify Dynamic and Dimensioned Arrays. Explain TUT. List commonly
used core APIs. Describe Caching..

10 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Your Course » Timetable


Here’s the timetable. We’ve just started on the Introduction lesson. Following this, we’ll cover jBC Programming Constructs,
Dynamic and Dimensioned Arrays, TUT. On our 2nd day, we will take a look at Transact API and Caching.

11 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Programming Foundation » Getting Started with jBC


The jBC primarily aims to write business applications and contains all the constructs needed to access and modify files and
their data efficiently. It also comes with in-built libraries to access database tables.

12 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Transact Design Studio


Transact design studio is our single design tool. It can be used to design Transact artifacts like version, enquiry, COS, menu,
etc. It is also the IDE used by developers to create, debug and run programs.

13 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Launch Design Studio IDE and Start H2 Database


Execute start-all.bat in the folder Temenos. It will start the JBoss AS and also launch the H2 Database. Strictly speaking, the
database and JBoss are not needed for this session as we are writing a simple console application and not interacting with
Transact.

14 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Enterprise Design Studio


Launch Design Studio IDE by clicking on the path specified. The workspace is a folder that contains all the projects. Specify
a new location to start with a fresh workspace.

15 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Creating a New Project


First, you need to create a new project. From File Menu, select New, Project. Provide a name for the project in the project
name box. Keep the default settings and click on finish.

16 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Toggle TAFJ Project Nature » Setting TAFJ_HOME


Right-click on your project in the package explorer window and click on the toggle TAFJ project nature to make your project
a TAFJ project. Step 1: set the TAFJ_home. It is the Temenos or TAFJ folder. Step 2: Set the properties. Choose the radio button
Import from the TAFJ property file.

17 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Use Existing Property File


The property files are in the TAFJ_home or conf folder. Choose TAFJ.properties for this session. We will later see how to set
properties from scratch in a later session.

18 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Properties » Precompiled


We have to specify the location of the Transact jars. This location is already set because we are using an existing property
file.

19 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Properties » Database


We must specify the database connection properties. This location is already set because we are using an existing property
file. We have to mention the port number, the DB's name, and the DB's login credentials B.

20 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Adding a Folder for the Programs


You may right-click on the project and click on New folder to add a new Basic folder for your project. The existing folder basic
can also be used to store the jBASE basic programs.

21 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Programs in jBC


Right-click on the MYPROG folder and choose the new T24 routine, component, and test case option. Give a name for your
program and choose to create a program radio button. All programs or subroutines end with the .b (for basic program)
extension.

22 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Programs in jBC


The programs begin with the keyword program and end with the end. The CRT is used to display data on the console. The
print can also be used for displaying data on the console.

23 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Compiling the Code


The compilation will create the equivalent .java and .class files. Alternatively, you can right-click on the program and choose
to Compile a basic file.

24 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Execute the Program


Right-click on the program, Run As, Basic Program. The output will be displayed in the console window.

25 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Execute the Program » Run Configuration


If we do not have the code, we can create a Run configuration to run the required Program. Right-click on the program in
the project explorer to bring up the Run configurations window. Alternatively, click on the green "Run" button. Double-click
on the basic program to create a new configuration.

26 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Execute the Program » Run Configuration


The name can be any meaningful name. A program must be the name of the program. The project browses and chooses the
current project. We can click on apply to create a new configuration or run to save the configuration and run. We will look at
the use of this later in training.

27 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Invoking Subroutines in jBC


A subroutine is a named block of code. The subroutines also hold jBC code, but unlike Programs, subroutines are not directly
executed from the runtime. Create a subroutine called MYSUB.

28 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Compiling the Subroutine


We will understand the concept of the Dollar package later in this training.

29 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Compiling the Subroutine


This slide is the continuation of the previous slide.

30 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Compiling the Subroutine


This slide is also the continuation of the previous slide.

31 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Calling Subroutine


The Subroutines are executed using the keyword call. The Control is returned to the statement after the call in the sample
program.

32 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Design Studio » Invoking Programs in jBC


The program's name to be executed must be given within quotes. Otherwise, it will be assumed to be a variable.

33 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Common Variables » Know your Variables


A variable need not be declared in jBC. However, you require a name for the variable, and it's a good practice to initialize a
variable before use. It's not a strongly typed language which makes it quite flexible to write programs. The variables in jBC
can store all types of data and data of any length. They are not declared to be of a specific type. For example, the customer.ID
equals "A001", the customer.ID variable stores a character string. Customer.ID = 9278, Here, the same customer.ID variable
now stores a numeric value. The variables must have a name. The variables need not have a type. The variable names can
contain characters, numbers, underscore, dollars and periods. The first letter for an identifier for a variable must be a
character. The following are all valid identifiers for variables part-time, part.time, part dollar time, time10, ABC_.ABC. The
general practice is to use dots to separate words in variable names, for example, party.venue. All variables, by default, are
string or text variables.

34 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Common Variables » Accept User Input


The input statement allows the program to collect data from the current input device, the keyboard. Input variable name, for
example, input name. The colon operator is used for concatenation.

35 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Common Variables
The Variables can be created locally within a program or subroutine, local variables. The shareable between programs or
subroutines, common variables. The local variables are variables used within the program or subroutine.

36 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Common Variables » Local Variables » Visibility


The variables X and Y have been initialized in program one and are local variables. Hence, their values are not outside of the
program (in the subroutine).

37 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Common Variables » Variables with Global visibility


Any variable declared common within a program or subroutine is not allocated space on its stack frame in the process space.
The common variables are created in a common session space. The process space is exclusively allocated to each program
and is available until it completes execution or terminates. A session space and a session variable are available even after
the program terminates as long as the session is active. When accessing common variables from another program or a
subroutine, a namespace must be used to define the common variable as shown. In the example, NS is the namespace that
acts as an abstract container for holding the shared variables. When a namespace is shared, all programs or subroutines
using it should declare the same number of variables in the same order within it. (Note: In the above example, you may
declare the common variable without using the namespace. Then the common variables are destroyed once the main
program completes execution and is unavailable for the entire session). The Y is now common and shared by program one
and subroutine two. The variable Y is created in the session space. A refers to all the requests from a client. A session is
specific to the user. A session variable is hence specific to that user and is used to store user-specific "global" data for use by
all programs within the application. The common variables retain states across multiple code blocks and act as session-
specific variables. When a user initiates a session, a session space is created, which is identified by the user's session ID, and
common variables are created in this space.

38 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Common Variables » INSERT Files


Instead of declaring the common variables in every program or subroutine where they are required, you can declare them
once in an insert file and insert this file in all the required programs or subroutines. In the slide, you can see the example, an
insert file called I_MY.common.VARS is created in the My Prog folder. Y, Y1, and Y2 are declared as common variables to be
used throughout the session in this file. This file is inserted in program one and subroutine two using the dollar insert
statement.

39 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Common Variables » INSERT Files


This slide is the continuation of the previous slide.

40 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Common Variables » Variable Scope


See the table above to understand the scope of local and common variables.

41 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Lesson Summary
In this lesson, I described what Your Course is all about, Programming Foundation, Design Studio, and Common Variables.

42 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice
Practice 1
Predict the output of the above code snippets

43 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
Practice Solution It will throw the error as JBase does not need us to declare the type of VARB and it will not recognise what
INT is and hence it will throw error as seen : ERROR unexpected token: INT The variable 'VARB' is not initialized

44 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
Practice Solution In the above snippet NAME variable is initialized to DON in Program Customer and it calls the SUBROUTINE
CUST.ADDRESS and then prints the NAME on the console . Since the CUST.ADDRESS subroutine initializes the NAME to SAM
, hence the Printing of NAME after Subroutine call in Program CUSTOMER will print the output as: NAME=SAM

45 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution

46 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

jBC Programming Constructs


Lesson Overview
In this lesson, I am going to describe Conditional Execution, Looping Constructs, Paragraphs, Editor Functionality, and Debug
Basic Code.

47 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Conditional Execution » The Way jBC Works


Conditional Execution: The way jBC works. Many sections are available inside the Program Block. A Program Block comprises
sections for Variable Initializations, Array Declarations. Branching constructs: if, then, else, and case. Looping constructs:
loop, repeat, for next. Comment lines and more. Finally, the block ends with an end. Any code written beyond this statement
will become unreachable and not be picked up for compilation and execution.

48 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Conditional Execution
The expression will be evaluated to a value of Boolean true or false. If the expression is true, the statements defined by the
then clause will be executed (if present). If the expression is false, the statements defined by the else clause are executed.
The then and else clauses may take two different forms, single and multiple-line statements. The simplest form of either
clause is of the form: IF A then CRT A or IF A else CRT A, but the clauses may be expanded to enclose multiple lines of code
using the end keyword as so: IF A then, A equals A multiply by 6, CRT A, end else, A equals 76, CRT A END. The single and
multi-line versions of either clause may be combined to make complex command combinations, if the statements can be
nested within either clause to any number of levels.

49 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Conditional Execution » CASE Construct


The beginning case and end case statements bound the case structure. Any number of case <conditions> statements is
allowed inside begin the case, the end case. Any number of jBC statements can follow each case <condition>. If a case
<condition> evaluates to true, then the jBC statements below are executed. The rest of the case <conditions> are then
ignored. Execution resumes from the first line of code after the end case. Case 1 is the default case which always evaluates
to true. It must be the last case in the construct. This case will execute if all the other case <conditions> fail.

50 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Conditional Execution » CASE Construct


A remark is printed depending on the value of the day Variable. Note: if the day is not 1, then the default Case 1 rule will be
executed as a "catch-all".

51 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Looping Constructs
Looping Constructs: If you want a statement or group of statements multiple times without writing the code repeatedly, then
the solution for this Looping. In other words, Loops, as you are aware, facilitate the repetitive execution of code. The jBC has
two types of looping constructs, for, next and loop, repeat.

52 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Looping Constructs
VAR is the counter variable (aka index variable) used to control the loop. The first time the loop is entered, VAR is assigned
the value of expression1, which must evaluate as a numeric value. After each loop iteration, the VAR is automatically
incremented by one. The expression 2 must also evaluate to a numeric value as it causes the loop to terminate when the
value of var is greater than the value of this expression. Expression 2 is evaluated at the start of every iteration of the loop
and compared with the value of expression 1. If the step expression3 clause is included within the statement, var will
automatically be incremented by the value of expression3 after each iteration of the loop. Expression 3 is evaluated at the
start of each iteration. expression3 may be negative, wherein the loop will terminate when VAR is less than expression2.

53 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Looping Constructs » FOR…NEXT


The above code snippet will display the output as follows: HELLO1, HELLO1, HELLO1, HELLO1, and HELLO1. That is, it will
display the message “hello” followed by a value inside the INIT variable five times as the step value is 2. As such, the CNT
variable is incremented by 2 for every iteration. Moreover, For loop can be used only when the number of times the loop will
be executed is known prior.

54 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Looping Constructs » BREAK and CONTINUE


To break out of a loop before it completes its designed execution, use the break keyword, which takes control of the line of
ensuing code repeat.

55 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Paragraphs
Paragraphs: The Paragraph facilitates the modular programming approach to help make the code more maintainable and
reusable. A few points: The jBC is a structured programming language and follows a modular programming approach. In
Modular programming, a large program is broken into manageable units called paragraphs to create code that can be easily
re-used. Modular programming improves the maintainability of code. A modular program consists of a main module and
one or more auxiliary modules.

56 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Paragraphs » Comments
All data lines other than code should be prefixed with an asterisk to denote that it is a comment line. The compiler ignores
comment lines. All jBC programs must have comments, followed by the author’s name and date of creation. The date and
details of any further amendments to the program must also be recorded.

57 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Paragraphs » Modular Code


A unit of task or activity can be segregated and written in a paragraph. Every paragraph must be named as Paragraph name.
A paragraph can be invoked using the GOSUB command. The paragraph can be invoked any number of times from anywhere
within the program. The Paragraphs facilitate re-use of code and easy maintainability of code.

58 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Paragraphs » Creation of Paragraph


This slide is the continuation of the previous slide.

59 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Editor Functionality
When you right click on the editor or on the main menu or toolbar, you will find 8 editor functionalities: collapse all regions,
expand all regions, create region, create GOSUB, insert comment line, format code, block comment, and block uncomment.

60 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Editor Functionality
The Region: The region is part of the code decorated by some tags ignored by the compiler. In the annotation bar, you can
collapse or expand it. Comment code: You can add a comment line in the code using “Insert comment Line.” You can
comment or uncomment a block of code using “block comment” or “block uncomment.”

61 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Editor Functionality
Format Code: Use the format code option to indent your code. GOSUB: In the code a GOSUB and a region with the label
provided in the dialog box will be created.

62 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Debug Basic Code


Start the debugger. Design Studio allows you the run your basic code in debug mode. To Debug, use the debug as basic
program option to run the basic code in debug mode. By doing so, the design studio will automatically switch on the debugger
view. The program will be launched and will break on the first breakpoint. Once the program is stopped, you can investigate
variables, change their content, etc. The snapshot shows the execution paused at Line 7, where the break point was added.
The basic launcher uses the eclipse standard for debugging. Step over: F6, step in F5, step out: F7, continue: F8. We will
discuss each view in detail. [Note: The Debug As… option is also available in the Design Studio menubar and the toolbar.]

63 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Debug Basic Code » Debug View


The Debug window displays the call stack, which shows the program's parts currently executed and how they relate to each
other. It gives a detailed hierarchical tree view of the current routine executing, line no, calling routine, etc. This information
is dynamically updated based on your current line of execution. You can re-launch your program at any time by using the
context menu. Right-click in the Debug window to invoke the context menu as shown. Controlling the program execution.
The design studio provides buttons in the toolbar (also available as options in the context menu) for controlling the execution
of the program you are debugging. Typically it is easier to use the corresponding keys to control this execution. You can use
the F5, F6, F7, and F8 keys to step through your coding. The meaning of these keys is explained below: F5: Executes the
currently selected line and goes to the next line in your program; if the selected line is a method call, the debugger steps into
the called code. F6: F6 steps over the call, i.e., executes the method call (for example, call a subroutine.B) without stepping
into the method code in the debugger. F7: F7 steps out to the caller of the currently executed method. It finishes the execution
of the current method and returns to the caller of this method. F8: F8 tells the eclipse debugger to resume the execution of
the program code until it reaches the next breakpoint. If there are no breakpoints, it completes the execution.

64 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Debug Basic Code » Variables and Expressions View


Variables view: The Variables view displays variables from the current executing stack. Please note you need to run the
debugger to see the variables in this view. The Variables view allows you to change the values assigned to your variable at
runtime. Click on the Value cell of the variable whose value you want to change. The cell becomes editable. Alternatively
right, click on the cell for a context menu and select ‘change value.’ If a common variable is not used in the program, it will
not be shown in the variable list (Variables tab in the variables and expressions view). The Expression Watchpoint.
Sometimes, there are too many variables, which is tricky to find. By right-clicking on the variable, you can choose the “Add
Watch” option. Then the variable you want to watch will be in the Expression view. If the expression view is unavailable on
your IDE, you can add it from the window, show view, and expressions. Breakpoints view and deactivating breakpoints. The
Breakpoints view allows you to delete and deactivate breakpoints. To deactivate a breakpoint, remove the corresponding
checkbox in the Breakpoints view. You can use the corresponding buttons in the view toolbar to delete it. These options are
depicted in the screenshot. If you want to deactivate all your breakpoints, you can press the Skip all breakpoints button. If
you press it again, your breakpoints are reactivated. This button is highlighted in the screenshot.

65 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Lesson Summary
In this lesson, I described Conditional Execution, Looping Constructs, Paragraphs, Editor Functionality, and Debug Basic Code.

66 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice
Practice 1
Write a Simple program to store personal details of an employee as described in the slide above.. What changes will have
to be made to the program if it is written using sub routines instead of paragraphs If the program has to be rewritten using
subroutines, then then variables to accept employee info must be declared as a common variable in an insert file and the
insert file must be included in the subroutine accepting the emp info , displaying the emp info. Main program must be used
to just call the subroutines separately.

67 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution

68 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
Practice 1 PARAGRAPH TO ACCEPT EMPLOYEE DETAILS

69 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
Practice 1 PARAGRAPH TO DISPLAY EMPLOYEE DETAILS

70 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
Practice 1 CONSOLE OUTPUT SHOWING THE INPUT TO ACCEPT AND DISPLAY OF EMPLOYEE DETAILS

71 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2
Modify the Program created in Practice 1 to use subroutines instead of paragraphs

72 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Practice 2 Solution Main Program named EMP_PERSONAL_DETAILS would be using subroutines subroutines separately to
accept and display employee details are shown above..

73 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Practice 2 Solution Subroutine named EMP.INFO.ACCEPT is used to accept the employee details is shown above. Variables
are defined in a separate file named I_MYEMP.VARS and inserted in the subroutines using $INSERT statement.

74 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Practice 2 Solution Subroutine named EMP.INFO.DISPLAY is used to display the employee details is shown above

75 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Practice 2 Solution Console output of Employee Details using subroutines is shown above

76 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic and Dimensioned Arrays


Lesson Overview
In this lesson, I am going to describe Arrays in jBC, Dynamic Array, and Dimensioned Array.

77 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Arrays in jBC » Scenario 1


We have above the details of Bob, Jo's friend. We are going to store these details in a Jbase variable.

78 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Arrays in jBC
We can use a variable to store the details of Jo's friend. Details equal Bob Artist Music 1231231231 India. If we store the
details in a single variable, we need a marker to segregate each piece of information. The first level of the marker is the FM
or the field marker. It is used to separate the different fields. These are the first level of markers that delimit the data and are
referred to as Field Markers or FM in jBC. The ASCII character denotes it equals char(254). S

79 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Arrays in jBC » Scenario 2


If Jo has to store another hobby, painting for Bob, we need another marker to distinguish the values within the hobbies field.
It is the second level of markers or delimiters and is referred to as Value Markers or VM in jBC. It is denoted by the ASCII
character char(253). Details 3,1 means details field 3, Value 1.

80 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Arrays in jBC » Scenario 2


In the above example, there are 6 fields separated by FM. Field 3 has 2 values. To refer to Painting, we must use details <3,2>.
Field 5 also has 2 values. To refer to India, we must use details <5,1>. To store the fact, Bob has visited Big Ben in the UK.

81 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Arrays in jBC » Scenario 3


Details <6,1,2> is equivalent to saying details lesser than field 6, value 1, sub value greater than 2. The ASCII character for
Sub-Value markers is char (252). In jBC, DETAILS is stored as a single contiguous string in an array.

82 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Arrays in jBC » Subvalue Markers (SM)


In memory, all the data is stored as a single contiguous string in an array.

83 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Arrays in jBC
Arrays in jBC. The Arrays are variables that hold multiple values in continuous memory locations. Every variable in jBC is
Dynamic. The Arrays are not always static. How can the size of this array be decided, especially since unlimited information
can be stored using the markers. The Size of the Array cannot be decided as we can store multiple types of related information
on a single variable.

84 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Arrays in jBC
To cater to this variable length information, jBC has specially optimized arrays, which are also variable in size, to
accommodate its exact length. It obviates the need to declare enormous arrays as we need to be aware of the information
length, running the risk of massive waste of allocated space. An unlimited amount of information can be stored in a single
array: limited only by the RAM capacity.

85 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic Array » Manipulation » Scenario 4


Suppose we want to add one more piece of information, like Bob's favorite color. Then we want to add Blue as Bob's favorite
color then we have to append blue to the existing array using FM as a delimiter.

86 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic Array » Manipulation » Append Fields


To add Blue as Bob's favorite color, we can say details <-1> equals Blue. Blue is appended to the list with an FM separator.

87 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic Array » Manipulation » Append Values


ArrName<FMPOS,-1> - to "append multi values" to an array using VM as the delimiter. To add another hobby, Baking, details
<3, minus one> equals baking. Details will now be seen below, and we can see that Blue is added as the last field to the
existing array contents with FM as a delimiter. Details equal Bob at FM Artist at FM Music at VM Baking at FM India at VM UK
at FM TAJ SM Kashmir at VM Big Ben at FM Blue.

88 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic Array » Manipulation » Direct Assignment at a Location


ArrName <FMPOS, MVPOS> to add multiple values "at the specified position" in an array using VM as a delimiter. To directly
add the phone number at MV position 3, Details <4,3> equals 7897897891 will add the phone number at position 3. Note
the required number of VMs added, as seen above.

89 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic Array » Manipulation » Direct Assignment at a Location


ArrName <FMPOS, MVPOS> to add multi values "at the specified position" in an array using VM as the delimiter. To directly
add the phone number at MV position 3. If we use an existing position, the data will be overwritten. Details <4,1> equals
3453453451 and will replace the value in position 1. Please observe the details array before replacement and after
replacement (highlighted).

90 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic Array » Manipulation » Append Subvalues


To add another location visited in the UK. Friends.list <6,2,-1> equals Wimbledon (To the fifth field, second multi-value,
append a sub value). How many FMs have we skipped equals 5. Hence FM position is 6. Inside the 6th Field, how many VM
have we skipped equals 1, VM position is 2. In the 6th field, 2nd Multi value, how many SM have we skipped equals 1. Hence
SM position equals 2.

91 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic Array » Manipulation


Values from the dynamic array are retrieved using their index numbers. CRT details <2,1> will yield a result as Artist. CRT
details <5,2> will yield a result as "UK." Also, Predict the index for 7897897891. Predict the index for Blue. Predict the index
for Big Ben.

92 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic Array » Insert Elements


The following are the syntax elements: Insval evaluates the element to be inserted in the dynamic array. FPOS, VPOS, and
SVPOS should all evaluate numeric values and specify the Field, Multi-Value, and Sub-Value before the new element is
inserted. Specifying a negative value to any of the FPOS, VPOS OR MVPOS will cause the element to append as the last Field,
Value, or Sub-Value rather than at a specific position. Only one expression may be negative. The above code snippet inserts
the first 5 natural numbers into Values in the reverse order. Values equal 5 FM, 4 FM, 3 FM, 2 FM 1. The statement, INS
Natural. On the other hand, Num before Values <-1> will append the first 5 natural numbers 1 FM 2 FM 3 FM 4 FM 5.

93 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic Array » Insert Elements


Details <3,2> is painting. Hence Art is inserted before Painting.

94 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic Array » Search Elements


Expression 1 evaluates the string to compare every dynamic array element. ArrName is the dynamic array. The three variables
FPOS, VPOS, and SVPOS are used to record the Field, Value, and Sub-Value positions in which expression1 was found. If
expression1 is found in any element of ArrName, then FPOS, VPOS ASVPOS is set to the position in which it was found, and
any then clause of the statement is executed. If expression1 is not found within any element of the dynamic array then FPOS,
VPOSandand, and SVPOS are undefined, and the else clause of the statement is executed that will be searched.

95 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic Array » Search Elements


F1, F2, and F3 are set with the corresponding field, value, and subvalue position where the string was found in the dynamic
array.

96 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic Array » Search Elements


Expression 1 evaluates the string to search every dynamic array element. ArrName is the actual dynamic array that will be
searched. The three variables FPOS, VPOS, and SVPOS are used to record the Field, Value, and Sub-Value positions in which
expression1 was found. If expression1 is found as a substring of any element of ArrName, then FPOS, VPOS, and SVPOS are
set to the position in which it was found, and the then clause of the statement is executed if it is present. If expression1 is not
found within any element of the dynamic array, then FPOS, VPOS, and SVPOS are undefined, and the else clause of the
statement is executed.

97 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic Array » Search Elements


F1, F2, and F3 are set with the corresponding field, value, and subvalue position where the string was found in the dynamic
array.

98 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic Array » Search Elements


Expression1 evaluates the string that will be searched for in ArrName. ArrName evaluates the dynamic array within which
expression1 will be searched for VPOS, and SVPOS is the specified dimension within which the search element is located.
VPOS, SVPOS indicates the value or sub-value "from which" the search will begin in the specified dimension (for example,
on the next page). The Var will be set to the position of the Value or Sub-Value in which expression 1 was found. If the search
item were not found, Var would be set to one position past the end of the searched dimension. The command must include
one or both of the then and else clauses. If expression1 is found in an element of the dynamic array, it executes the
statements defined by the then clause. If expression1 is not found in an element of the dynamic array, it executes the
statements defined by the else clause. Note: the 'BY' clause can be used for improved performance if the array elements are
arranged in a specific order.

99 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic Array » Search Elements


The dimension specified in the command is Located in Field 4, value 1. The Code snippet searches the phone.no in field <4>
from the first Value. To search from the 3rd value, the command should be re-written as locate searchstr in friends.list <4,3>
setting MVPos else null. In this case, Locate will not search for the search string in <4,1> and <4,2>. Search starts from <4,3>
only.

100 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic Array » Search Elements


The dimension specified in the command is Located in Field 6, second multi-value and first sub-value . The Code snippet
searches the “Big Ben in Field <6> from the second multi-value and first sub-value position.If the command is given as locate
searchSTR, in details <6,1,1> setting SVPos. Or else, CRT “not found” END SVPos will be set to 3 (as the search string is not
found), and the ELSE clause will be executed.

101 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dynamic Array » Search Elements


Locate art in details <3,1> setting MVPos else null. Find art in details setting F1, F2, F3 STR art in details setting F1, F2, F3 else
null. Predict the results of the above statements with respect to the array seen above in the slide.

102 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dimensioned Array
Dimensioned Array: As the name implies, dimensioned arrays have a dimension. They are declared using the DIM statement.
To store Jo's friend's details, we may declare a dimensioned array as DIM ArrName (row), for example, DIM friend (6).
Allocates 6 rows. Each row in a Dimensioned Array is a Dynamic Array of variable length depending on the data to be stored.
Use a Dimensioned Array when the amount of information stored is vast.

103 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Dimensioned Array
You may visualize Jo's friend list stored in a dimensioned array as shown. Each row is of variable length to provide room for
as many multi-values and sub-values as required. The number of rows is fixed. The use of parenthesis () instead of angular
brackets. The lack of Field Markers to segregate the individual friends. You can see how the dimensioned array is represented
in the above slide, and a total of 7 rows has been declared, with each row having a variable number of elements in it.

104 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Lesson Summary
In this lesson, I described Arrays in jBC, Dynamic Array, and Dimensioned Array.

105 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice
Practice 1

106 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
Answers are shown in the Bold letters in blue color in the slide above red VM maroon FM blue VM green VM marine blue
SM ocean blue SM marine green FM orange VM amber. <1,1> <1,2> <2,1> <2,2> <2,3,1> <2,3,2>
<2,3,3> <3,1,1> <3,2,1> AAA FM BBB VM CCC VM DDD SM EEE FM FFF <1,1> <2,1> <2,2>
<2,3,1> <2,3,2> <3,1> Is the declaration correct? No. Only the number of rows is fixed for a dimensioned array. The
no of columns cannot be specified

107 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2
Write a program to accept the employee details and display them

108 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Write a program named EMP_INFO in Design Studio to store the details of the employee and display it on the console. User
is requested to enter the choice and based on the choice entered by the user it will evaluate the options using case statements
as seen in next slide.

109 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Case statements is used to evaluate the choices entered by the user and to proceed with the execution . If the user enters
the valid choice execution proceeds accordingly else if user enter the choice which is not shown, then the user is notified
about his invalid entry of choice

110 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Store the details of the employee using paragraph STORE.EMPLOYEE

111 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Store the details of the employee using paragraph STORE.EMPLOYEE For year of qualification, phone numbers and Email
id’s.

112 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Answers are shown in the Bold letters in blue color in the slide above red VM maroon FM blue VM green VM marine blue
SM ocean blue SM marine green FM orange VM amber. <1,1> <1,2> <2,1> <2,2> <2,3,1> <2,3,2>
<2,3,3> <3,1,1> <3,2,1> AAA FM BBB VM CCC VM DDD SM EEE FM FFF <1,1> <2,1> <2,2>
<2,3,1> <2,3,2> <3,1> Is the declaration correct? No. Only the number of rows is fixed for a dimensioned array. The
no of columns cannot be specified

113 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Collect the details of the employee EMAIL ID using paragraph ADD.ANOTHER.EMAIL if the employee has one or more EMAIL
ID’s

114 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 3
DCOUNT Function explained with a syntax above in the slide.. The DCOUNT( ) function counts the number of field elements
in a string that are separated by a specified delimiter.

115 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 3 » Solution
Usage of DCOUNT Function is shown with a simple example

116 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 4
Modify the program written in Practice 2 to make Use of the DCOUNT function to count the number of phone numbers,
email ids entered.

117 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 4 » Solution
Add the paragraph named COUNT.PHONE and COUNT.EMAIL to the existing practice 2 program as seen above with the
DCOUNT function to count the Number of Phone Numbers and Email ID’s held by the employee..

118 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 5
Description of FIELD Function and it’s syntax

119 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 5 » Solution
Usage of FIELD function is shown with a simple example ..

120 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 6
Modify the program written in Practice 2 to make Use of the FIELD function to display each email/phone number on a
separate line

121 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 6 » Solution
Add the paragraph named DISPLAY.PHONES and COUNT.EMAILS to the existing practice 2 program as seen above to display
the Number of Phones and Email ID’s Held by the Employee..

122 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 7

123 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 7 » Solution
Input have been gathered once the choice entered by the user is 1

124 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 7 » Solution
Output is displayed once all the inputs have been entered . Please notice the Phone Numbers and Email ID’s are shown in
separate line because of usage of FIELD function ..

125 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

TUT
Lesson Summary
In this lesson, I am going to describe UTF Methods, Testcase, Stubs, and Assertions.

126 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

UTF Methods » UnitTest Framework


The Unit test framework helps to validate that the code is doing what it is intended to do. The Unit tests provide immediate
feedback when the underlying routine is amended. We can create tests on Subroutines or Components independently of the
context (no database, no dependencies). A testcase is the same as a subroutine, function, or program. When defined as
"testcase," a special UTF object is available in the code. The UTF allows you to create Stubs, context, invoke routines, generate
a report, etc.

127 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

SIMPLE.CALCULATOR API
This is a subroutine to do simple arithmetic. Take a minute to understand the parameters of the sub-routine. Read the
comments to understand the API.

128 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

SIMPLE.CALCULATOR API
Understand the DO.basic.checks paragraph. ETEXT is a common variable defined in I_common that contains the error
message. Store.end.error is the API used to display the error. If the Operator or Operand is invalid, an error message is
assigned to ETEXT, and an error is raised.

129 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

SIMPLE.CALCULATOR API
In the DO.calculation paragraph, if the operator is plus, the answer is calculated and assigned to the result. If any other
operator is specified, another subroutine is called to do the calculation.

130 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

TESTCASE
A test case is a .tut file. The .tut is a JBC file that starts with the keyword testcase (and not subroutine, program, or function).
Anything that can be done in a jBase file can also be done in the .tut. The Testcase automatically adds a low-level reference
to the "UTF" component in the code. The UTF component is a low-level component sitting in the runtime. The UTF component
does not exist on the disk. The dollar use is not required in the test case for the UTF component. We can consider it as a
language extension.

131 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

TESTCASE » Steps
The steps to create a test case are as follows: We must first define the target. The subroutine or function being tested. Define
the parameters for the target routine. Once the parameters are specified and the context is defined, the test can be run. The
target routine is executed. As a final step, we do the assertions to check if the target routine has created or updated the
required records or set the variables with expected values.

132 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

TESTCASE » Global UTF Methods


We use UTF.set Target to define the routine of the function being tested. It is important also to give a meaningful description
for the test case as this is recorded in the log in case of errors.

133 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

TESTCASE » Global UTF Methods


The first step in creating a testcase is to set the target routine. The API which we are going to test is the simple.calculator.
Hence use the UTF.set Target to set the target as simple.calculator.

134 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

TESTCASE » Global UTF Methods


The routine being tested may have input parameters. UTF.set Param is used to setting the values for these parameters. This
method has one parameter: the variable or value for the parameters of the tested routine (target routine). This method is
called as many times as there are parameters. Another method UTF.addParam(). It is also available to specify values for the
parameters.

135 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Using IDE to Set the target


We can also use the IDE to set the parameters. Right-click in the test case editor, choose the unit test framework and set the
target routine. Uncheck the box Show only components to see the subroutines. Type the name or a part of the name in the
text box. Select the required routine and click ok. The IDE adds the set target and the addParam statements. The class files
or jars must be available in the TAFJ project to use the IDE for setting the target.

136 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

TESTCASE » Global UTF Methods


UTF.runTest () launches or executes the method being tested. Calls the routine defined by set Target with the parameters
defined using setParam. The stubs are explained later in this session.

137 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

TESTCASE » Assertion
Every test case must have an assertion to check if the test is successful. Based on the assigned parameters, the
simple.calculator is expected to set the return value as 6. this is checked using the assert statement. If the values are equal,
the test case is successful, or else the test case fails.

138 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

TESTCASE » Running the Test


Double-click on the test to get back to the editor.

139 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

TESTCASE » Debugging the Test


We can also debug the test case as we debug a subroutine by inserting break points. The values of the variable are displayed
on mouse hover and also displayed in the variables window.

140 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Stubs
The scope of the unit test is to test the target API and not any calls made from there. We must create Stubs for the APIs called
from the target routine. The stub is created with UTF.add Stub. Stubs are never called.

141 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Stubs
We will get an error No stub found for number.division when we run a division test. The simple.calculator calls the API
number.division. The test case is to test the simple.calculator and not any calls made from that subroutine. Hence, we must
define a STUB for the number.division API that is called for a division.

142 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Stubs
Use the UTF.add the Stub method to create a reference for a stub. Stubs are not called or executed; hence we must use the
UTF.add Stub Param to set the parameter for the stub. The First parameter is the stub reference obtained from add Stub().
Second is the IN parameter, and Third is the value of the IN parameter after the call. The framework will match the stub based
on the value of the parameters.

143 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Stubs » Using the IDE to Add STUB and StubParam


When defining stubs, we can use the IDE to add new stubs. It will automatically add the UTF.add Stub Param as many times
as parameters. The values for the parameters must be modified as required. UTF.any () and UTF.same () are modifiers and
will be explained later.

144 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Stubs
Stub for number.division is added, and now the test case is successful.

145 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Assertions » NUMBER.DIVISION Test


We have defined a STUB for a number.division, but we know that STUB will never be called. We have defined using UTF.add
Stub Param () what the expected result is when inputs are operator for division, operand one is 1, and operand two is 2.
hence a better check is to see if number.division is called when the operator is "forward slash" in the assertion using get NB
Invocation rather than to check if the return value is 0.5.

146 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Lesson Summary
In this lesson, I described UTF Methods, Testcase, Stubs, and Assertions.

147 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice
Practice 1
Create test cases for the SIMPLE.CALCULATOR to test below: Test Invalid Operator Test Invalid Operand 1 Test Invalid
Operand 2 Test "+" invocation Test "-" invocation Test "*" invocation Test "/" invocation

148 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
Create a test case with Seven Paragraph for seven tests from runtest1 to runtest7 as seen in Design studio

149 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
Test for Invalid operator Runtest1 paragraph is used to test invalid operator. When the SIMPLE.CALCULATOR receives an
invalid operator, the DO.BASIC.CHECKS paragraph sets the error in ETEXT common variable, and this is used in the assertion.
Note – if the I_COMMON is not inserted in the TESTCASE, ETEXT will be a local variable and the assertion will fail. Also, you
can see Runtest1 is used to raise or propagate the error stored in ETEXT variable and compare it in assertions .Hence we
have to define a stub for the STORE.END.ERROR as this is used to propagate the error. If we don’t declare stub, then it will
throw the error as : [ERROR] No stub found for 'STORE.END.ERROR’

150 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
Test for Invalid Operand1 This is similar to runtest1. This Runtest2 checks for Invalid Operand 1

151 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
Test for Invalid Operand2 This is similar to runtest1. This Runtest3 checks for Invalid Operand 2

152 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
Test “+” Invocation Runtest4 checks for Plus(+) operator to add two numbers. SIMPLE.CALCULATOR does the calculation by
itself and hence the test case does not define a STUB.

153 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
Test “-” Invocation Runtest5 is used to test the minus operator. SIMPLE.CALCULATOR calls NUMER.SUBTRACTION hence we
have to define a stub for the same. In the assertion we check if stub is called when the operation is to subtract two numbers.

154 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
Test “*” Invocation Runtest6 is used to test the multiply operator. SIMPLE.CALCULATOR calls NUMER.MULTIPLICATION hence
we have to define a stub for the same. In the assertion we check if stub is called when the operation is to multiply two
numbers. We also use getNbInvocation method of UTF object to see if the stub is invoked at least once.

155 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
Test “/” Invocation Runtest7 is used to test the division operator. SIMPLE.CALCULATOR calls NUMER.DIVISION hence we have
to define a stub for the same. In the assertion we check if stub is called when the operation is to multiply two numbers. We
also use getNbInvocation method of UTF object to see if the stub is invoked at least once. Here we have testing the division
operator assuming that both the numerator and denominator will be valid numeric value other than zero. We recommend
to perform a test if the denominator is zero and see how it works . Please do perform a test for dividing a number by zero
and see how it works to get the full taste of testing the Division operator either by storing the “EB-DIVISON BY ZERO” as a
return value from the NUMBER.DIVISION routine or store the value in a local error variable in the test and see how it works.

156 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
This information for declaring Shared details and shared stub Is specified here if we are not intended to define a stub for
each and every tests instead will prefer to create a common stub to be accessed by all test for STORE.END.ERROR in case if
required then we must define a stub for STORE.END.ERROR in setSharedStub section which can be shared by all test if
required. All the tests' cases and their alternatives are not shown. Just we are giving some basic sample tests .

157 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact API and Caching


Lesson Overview
In this lesson, I am going to describe Transact Caching, and Transact APIs.

158 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact Caching
Before discussing Transact APIs, it is important to understand Caching in the Transact. Caching is retaining frequently
accessed information in memory so that expensive I or O can be reduced. The caching is done in the Transact by using
Common Variables in jBC.

159 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact Caching » Levels of Caching


Cache in Transact is maintained at 2 levels. Session Cache: This is of 2 types. Static Cache: Common cache which stores
information from different files. For Example, The parameter tables with few records are stored in the static cache. Named
Caches: These are specific caches created by programs that store information used within a session. For example, the OPF
maintains a cache called File Open, which holds the file pointers for all files opened in a session. The following are features
of Transaction Cache: Consists of 2 variables: FWC, FWT. These variables are reinitialized after each transaction request.
Holds records read and written during a transaction.

160 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact Caching » Levels of Caching » Static Cache


Session Cache: The common cache which stores information from different files. This cache is maintained till the end of the
session. This cache is also known as a static cache. For example, Parameter tables, which have few records, are stored in the
static cache. When the session starts, the common variables related to the session will get added to the cache. Note: Today
is a common variable that holds the current Transact data. R.SPF.SYSTEM is a common variable that holds the system record
from the SPF table. The operator is a common variable that holds the currently logged username.

161 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact Caching » Levels of Caching » Named Cache


Named Caches: These are specific caches created by programs that store information used within a session. For example,
The OPF maintains a cache called File open, which holds the file pointers for all files opened in a session. The flow shown in
this slide explains the Static and Named Cache: When the session starts, the common variables related to the session get
added to the static cache. The request to open a customer file looks into the named cache File Open to check whether the
file pointer is available. Since the file pointer is unavailable, the file is located in the database, the File Open cache is updated,
and the pointer is returned. The same is repeated for open account file requests. Then there is a request to open the customer
file once again. Since the requested data is in the cache, it is returned from the cache. No database I or O is required in this
case. At the end of the session, the Named Cache and the Static Cache get cleared.

162 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact Caching » Levels of Caching » Transaction Cache


The Transaction level cache is maintained till the end of the transaction and uses common variables FWT and FWC.
Whenever data is requested, the first transaction cache is searched for the data. If it is there in the cache, then the data is
provided from the cache. If the data is not available in the cache, then the data is fetched from the database, and the data is
provided to the user along with updating the cache with the data. The common variable FWT stores the record ID and the
table name, and FWC stores the corresponding record. At the end of the transaction, the transaction cache will get cleared.
In this slide, the transaction cache is explained as At the beginning of the transaction, the transaction cache FWT and FWC is
initialized. The Customer record will be read from the table for the first time, and the subsequent read request for the same
Customer record will happen from Cache. When the request to write the Account record, the write happens to the cache. At
the end of the transaction, either the transaction is committed or aborted. Whatever the case, the transaction cache gets
cleared at the end of the transaction.

163 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs
Standardize logic to perform operations that are done across applications. Encapsulate the database layer and the Transact
framework logic from the application. Make the code more efficient by caching relevant information.

164 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Example of Standardization » Opening Files


If you look into the file list shown here, You can observe that the bank mnemonic is a part of the file name. Assume you had
to write jBC code to open a file. You need to work on the following: Work out the file names based on the file type. Work out
the file relevant to the user's branch. Arrive at the actual File name. Open the file. Transact routine OPF does this for you. You
supply the file name to it, and it returns the file Pointer to you.

165 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Opening Files


OPF is the Transact API used to open the file. Syntax, Call OPF(Filename, Filepath). The Filename is the name of the file to
be accessed. The File path is the pointer to the file location. Observe the syntax and the above example to see how OPF is
called with the required parameters.

166 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Adding to Transaction Cache


Here is the list of Transact APIs used to read from a database. Once the data is read from the database, the transaction cache
is updated, allowing further access through the cache. F.READ wraps the JBC command read. F.READU wraps the JBC
command READU. F.MATREAD wraps the JBC command MATREAD. F.MATREAD wraps the JBC command MATREADU.

167 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Read to Dynamic Array » F.READ


F.read is the Transact API that reads from the table into a dynamic array. Syntax: CALL F.READ (File Name, Key, Record,
Filepath, Error variable). For example, Call F.Read, (FN.account, 43338, R.account, F.account, read.error).

168 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Example » Code Using F.READ


Read the account record with account id 19461 and display the Customer ID, Account Currency, and Balance. A sample
program to perform the above task is seen in the slide above.

169 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Creating the PGM.FILE Record


Create a PGM.file record for the subroutine. The PGM.file type should be given as M for mainline routines that can be run
from the awaiting application prompt in classic.

170 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Launch EX


Remember to check the Eclipse console check box in the Run configuration window. If you forget this, restart Design studio
and modify the run configuration to launch classic. In the Classic screen, we need to enter the sign-on name and Password
to Login.

171 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Execute the SUBROUTINE


Classic screen showing the execution of the Subroutine is shown above. In this Classic Screen, you would input the routine
name as seen here at the Awaiting Application Prompt. In this case, our routine name, which we have created an entry in the
PGM file, is account.read, and hence we supply the same in the Awaiting Application Prompt and press enter. Once done,
execution of the subroutine begins and awaits the user input. You can also see that after calling OPF, the filename gets
changed to FBNK.account based on the Branch and File Classification. Since we accept the Account ID as input, we supply
the same. This account ID which we supply must be available in Transact to process. Finally, we can see the Output below:
Customer.ID (customer whose is owning the account) – 100282. Currency: USD. Working balance: 13301172.34.

172 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Read to Dimensioned Array » F.MATREAD


F.MATREAD is the Transact API to read from a table into a dimensioned array. Note: MAT is a keyword. The size refers to the
size of the dimensioned array.

173 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » MATREAD


This slide shows how to program using Transact API. This example demonstrates how to read to a dimensioned array. From
standard.selection record for the account, we can find out the customer's position.ID, account.balance, and currency in
account application. We can find the position of field customer.ID, account.balance and currency from AC
AccountOpening.jar will be seen under Transact libraries folder. The transact lib folder is available in Model Bank Area under
the path specified in the slide.

174 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Locking


What is record locking. Assume you open a record 101024 in the customer application using function 'I.' Will someone else
be able to open the same record using the function 'I' at the same time? NO. How do we ensure that two people don't open
the same record simultaneously? It is achieved using the concept of record locking. Whenever an application (Transact in
our case) instructs the database (jBASE in our case) that it wishes to have exclusive access to a record (This is achieved using
functions I, A, D, and R), the database marks that particular record for exclusive access and then releases it to the user. This
record remains locked until the time: The record is written back into the file. The record is deleted. The program in the
application that asked for the lock terminates normally or abnormally. The program in the application that asked for the lock
explicitly says 'release' so that the lock can get released. All locks held within a transaction are released after the transaction
is committed or aborted.

175 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Read with Lock to Dynamic Array » F.READU


Almost all the parameters are self-explanatory, except for the last parameter of F.READU. It is used to inform about what to
do if the record is locked. And it can take any one of the following values: P msg: Prompt the user with 'msg' if the record is
locked. The default if 'msg' is null is 'XXXX FILE ID record locked or retry Y or N.' R nn xx: Retry xx times with a sleep interval
of nn seconds. If xx is not specified, the record is continually retried. I: Ignore the lock (The record variable is left blank). E:
Return immediately with an error message. Null: Retry continuously with a sleep interval of one second.

176 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Read with Lock to Dimensioned Array » F.MATREADU


This slide is the continuation of the previous slide. Here, MAT is a keyword.

177 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Writing to Transaction Cache


Here is the list of APIs that could be used to write to a transaction cache. F.write wraps the jBC command write. F.MATWRITE
wraps the jBC command MATWRITE. Note: Writes happen at the cache level. And there should be a mechanism to flush the
data into the database. This mechanism is taken care of by Transact itself. And the way the data is flushed to the database
should be discussed here. Therefore, the changes may not be reflected if you try to write to the database.

178 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Write as Dynamic Array » F.WRITE


F.write is the Transact API to write to the transaction cache, where the record data is available in a dynamic array. It will write
only into the cache and not the database. We have to use a separate API to flush the data from the cache to the database,
which is not covered in this course. The Syntax and examples of using it are given above.

179 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Write as Dimensioned Array » F.MATWRITE


F.MATWRITE is the Transact API to write to the transaction cache, where the record data is in a dimensioned array. Syntax
and Examples to use it are given above.

180 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Releasing the Lock


A lock will get released when a write is executed on the record that has been locked. If within a transaction block, the write
will not release the lock. Once the transaction is complete, the lock gets released. When a transaction comes to an end, all
locks get released. Internally calls the jBC command release. Release <filename> releases all locks on the given file held by
the current session. The API F.release is used. Word of Caution: Use this API if the record is read with lock, but the no write
had happened. All locks on the specified file name are released if no record key is specified. All locks are released (Online
only) if no file name is specified.

181 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Adding to Static Cache » CACHE.READ


This API is used to delete a record from the cache. This routine takes in two parameters: Filename and record id. The record
is physically deleted at the end of the transaction block. Note: Deletes happen at the cache level, and there should be a
mechanism to update the changes to the database. This mechanism is taken care of by Transact itself. And the same is not
discussed here.

182 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » CACHE.READ


The cache.read should be used only to read the information that can be used across multiple transactions. For Example,
Parameter files. Cache.read should be used to read the information that does not change frequently. We should not use
cache.read to fill it with Transactional level data like Customers, Accounts, Contract records, etc. The cache.read should not
be used to read data subject to frequent changes like currency rates. The cache.read should not also be used to load large
amounts of data that are used specifically only in some programs. Instead, the application cache should be used for this. Do's
and Don'ts of cache.read are summarised above.

183 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Named Cache


Named cache is specific to an application. Gets cleared only at the end of the session. And hence similar to a static cache.
Data is managed into this cache by routines: System.put Cache (Bucket Name, record.ID, record, return value).
System.getCache (Bucket Name, record.ID, record). For example, The OPF creates a bucket called "file open" to keep track
of file pointers.

184 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Date APIs


CDT: It Calculates the forward or previous date from a start date using the number of days. In this API, the last parameter
takes the no.of.days that has to be added or subtracted from the given date. For example, trans.date equals 20110301. Call
CDT(trans.date, plus 5W). The above example computes a 5 working days later than the current date, and the result will be
stored in trans.date variable. Note: The no.of.days specified could be working days (W) or calendar days (C ).

185 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Transact APIs » Date APIs


CDD calculates the day's difference between two supplied dates. In this API, the last parameter is an input and an output
parameter. Do not pass the last parameter as a constant. For example, days equals C, asterisk to find the difference between
Calendar days or Working days. CURRDATE equals 20110303. TRANSDATE equals 20110309. Call CDD (CURRDATE,
TRANSDATE, days). This above example finds the difference between the dates, and the result can be positive or negative.

186 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Lesson Summary
In this lesson, I described Transact Caching, and Transact APIs.

187 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice
Practice 1
Steps: Open the file customer Read the specific customer record Retrieve the required data Display the data. After writing
the subroutine, create an entry in PGM.FILE for this subroutine as main line routine and execute it from Transact.

188 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
Practice 1 Solution 1. Write a routine named CUSTOMER.READ in Design Studio and save and compile the file.

189 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution

190 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
Practice 1 SOLUTION Create a PGM.FILE entry in transact for the routine CUSTOMER.READ as seen above WITH Type as “M”
and Product as “EB” and commit the record.

191 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution
Practice 1 SOLUTION Create a Run configuration in Design Studio by clicking on Run Menu -> Run Configurations… and the
in the window that is opened fill the following properties : NAME : Classic (Any Meaningful Name can be given) Program : EX
(this is the Transact Classic Application and its name cannot be changed. Should be configured as such) Check on Eclipse
Console . Click on Run which will launch Classic Please see the screen grab above for configurations and do it as such.

192 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution

193 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 1 » Solution

194 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2
Hint : Read data from Concat file CUSTOMER.ACCOUNT. Process each account separately using DCOUNT and FIELD function
In this case , below three Application needs to be opened and read. - CUSTOMER (To Validate the customer ID entered) -
CUSTOMER.ACCOUNT ( To view the List of Accounts held by the particular Customer) - ACCOUNT(To Display each and every
Account details held by a customer) Then we have to use DCOUNT function to fetch the number of accounts held by a
particular customer and display it separately using FIELD function.

195 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Practice 2 SOLUTION 1. Write a routine named READ.CUSTOMER.ACCOUNT in Design Studio and save and compile the file.

196 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Practice 2 SOLUTION 1. Write a routine named READ.CUSTOMER.ACCOUNT in Design Studio and save and compile the file.

197 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Practice 2 SOLUTION 1. Write a routine named READ.CUSTOMER.ACCOUNT in Design Studio and save and compile the file.

198 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution

199 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Practice 2 SOLUTION 1. Write a routine named READ.CUSTOMER.ACCOUNT in Design Studio and save and compile the file.

200 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Practice 2 SOLUTION 1. Write a routine named READ.CUSTOMER.ACCOUNT in Design Studio and save and compile the file.

201 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Practice 2 SOLUTION Create a PGM.FILE entry in transact for the routine READ.CUSTOMER.ACCOUNT as seen above.

202 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Practice 2 SOLUTION Create a PGM.FILE entry in transact for the routine READ.CUSTOMER.ACCOUNT as seen above WITH
Type as “M” and Product as “EB” and commit the record.

203 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Practice 2 SOLUTION Create a Run configuration in Design Studio by clicking on Run Menu -> Run Configurations… and the
in the window that is opened fill the following properties : NAME : Classic (Any Meaningful Name can be given) Program : EX
(this is the Transact Classic Application, and its name cannot be changed. Should be configured as such) Check on Eclipse
Console . Click on Run which will launch Classic Please see the screen grab above for configurations and do it as such.

204 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Practice 2 SOLUTION Once you run the Run configuration in Design Studio Transact Classic is launched as seen above.

205 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

Practice 2 » Solution
Practice 2 SOLUTION In the Transact Classic is launched type in the Credentials Username and Password to login to transact.
Then key in the Routine name which you have created (in this case(READ.CUSTOMER.ACCOUNT) in the Awaiting Application
Prompt as seen above and also provide the input. Once the input is done for any Customer ID, you can see the output too
seen on the right-hand screen which has the name of the application as READ.CUSTOMER.ACCOUNT and the output of EACH
ACCOUNT HELD BY THE CUSTOMER IS SEEN.

206 ©2023 Temenos Headquarters SA - all rights reserved


Transact Programming Foundation TR3PRGFO - R22 Revision 1 English

207 ©2023 Temenos Headquarters SA - all rights reserved

You might also like