Rules Engine User Guide
Rules Engine User Guide
Rules Engine
User Guide
No part of this document may be reproduced or transmitted in any form or by any means,
electronic or mechanical, for any purpose, without the express written permission of TEMENOS Holdings NV.
Table of Contents
Overview................................................................................................................................................ 3
Setup...................................................................................................................................................... 3
Rule Designer Main Screen............................................................................................................... 4
Rule Designer View............................................................................................................................ 5
Application Menu - Header Pane.................................................................................................... 5
Variables Pane............................................................................................................................... 6
Script Pane..................................................................................................................................... 6
Error and Description Pane............................................................................................................ 6
Definition of Rule Context.................................................................................................................. 7
Simple Context............................................................................................................................... 7
Complex Context............................................................................................................................ 8
Direct Complex Context.............................................................................................................. 8
Derived Complex Context........................................................................................................... 9
Deriving Similar to j-descriptor........................................................................................................ 9
Using Subroutine.......................................................................................................................... 10
Rule Designing..................................................................................................................................... 11
Adding Rule Context........................................................................................................................ 11
System Variables............................................................................................................................. 12
System Variables Explained......................................................................................................... 12
Rule Variables.................................................................................................................................. 13
Embedded Rule............................................................................................................................... 13
Rule Syntax and Functions.............................................................................................................. 14
Rule Structure.................................................................................................................................. 15
Validate Rule................................................................................................................................ 15
Saving the Rule to T24................................................................................................................. 16
Test Harness.................................................................................................................................... 16
Reporting.............................................................................................................................................. 17
EB.RULES....................................................................................................................................... 17
EB.RULES.VERSION...................................................................................................................... 17
EB.RULES.HIERARCHY................................................................................................................. 18
Overview
Rules Engine allows definition of complex business rules to support decision processing and scoring.
This needs to be generic so as to allow it to be deployed anywhere within T24 / ARC where a rules
based decision is required or where a score needs to be calculated.
The business rules language is procedural/imperative in style. It is helpful to think of it in terms of a
machine state consisting of a control part representing the instructions to be executed and a data part
consisting of the structure being manipulated by the instructions. Rules Engine has been designed to
be used by non-technical ‘power users’. Where previously a routine would need to be coded to make
a complex calculation or decision, The Rule Designer can be used by a business user to write a rule
expressing the logic required to make the correct decision or find the right score
Examples of where the Rules Engine can be used at the moment is in the CR Sales Opportunity
module, where it can be used to determine whether an opportunity is appropriate for a customer or
not and if so, what value/probability can be placed on that opportunity for a customer.
Another instance where a rule can be used is in process workflow, where a rule may determine the
correct status of a PW activity or process.
There are many places within T24 where a decision or score is made – along with Sales Opportunity
and process workflow, In future, the Rules Designer may be used in these places. This guide
describes the process of the business rules language and covers some simple usage through rule
composition
Setup
Rule Designer allows users to construct simple rules through an intuitive graphical interface and is
available as part of designers and Wizards option in T24 Tool box.
Actions in start page are short cuts for creating a new rule, opening rule saved to T24 database or
opening rule saved to local disk database. It is advisable to login into a T24 server area before
starting to design rules.
Variables Pane
The Variable Pane contains all ingredients for writing the rule.
Script Pane
The Script pane is where the business rule is defined. Script pane provides syntax coloring and
content assist functionality to aid definition of a business rule.
Creating rule context is the first step to be done before designing a business rule. Rule context are
defined(one time definition) in T24 application EB.CONTEXT. From a designer perspective, contexts
are T24 applications / field names indented to be used in rule definition.
For example, if the rule was based on whether customer has been at the bank for longer than a
specified period, or was resident in a particular country, the context would be based on T24 table
CUSTOMER. If the rule was based on whether an account had a balance higher than a particular
amount, or was a particular type of account, then the context would be based on ACCOUNT.
Simple Context
The simple EB.CONTEXT record has in its ID only. Field PRIMARY TABLE linked to Context
Variable in RULE DESIGNER can access any of the field in the table CUSTOMER for evaluation
of the rules.
Complex Context
Whenever the detail in a single table is insufficient to evaluate the rules, we need to have a complex
EB.CONTEXT. The id of any complex contexts should contain a delimiter ‘*’ – e.g.
CUSTOMER*COMPLEX. We have two types as below.
To access data directly from more than one table, the tables that share a common ID can given in the
field PRIMARY TABLE and field LINKED TABLE linked to Context Variable in RULE DESIGNER
can access the field in the table for evaluation of the rules.
When required information cannot directly get from the given tables, it needs to be derived. This can
be achieved in two ways as below.
1) Deriving Similar to j-descriptor
2) Using Subroutine
Based on Primary key of a table, the desired value can be got in turn by linking to other tables whose
primary keys are obtained from the previous record.
DATA LABEL.1: New derived field which can be directly used in the RULES DESIGNER for
generating rules as any other field of the table.
SELECTION.PR.1.1: The value of the field is derived as similar to j-descriptor
The above image, Field DATA LABEL.1 (NEW.CUST.DERIVED) will hold the value of field
LABEL.DESCRIPTION.1 (DELIVERY.POINT) in the table DEPT.ACCT.OFFICER. System will use
the value in the field ACCOUNT.OFFICER from the table CUSTOMER and read the corresponding
record in DEPT.ACCT.OFFICER to fetch the value of DELIVERY.POINT
Using Subroutine
Complicated values can be very well achieved by writing a subroutine which returns the desired value.
Rule Designing
Adding Rule Context
To add /include rule context,
1. Expand the “Contexts” list from the variable pane
2. Double click on the “…” element of the list
Choose the required context required for the business rule and select OK. When a context is added
to a rule, all fields available in T24 application context would be displayed under the context screen.
The required context can be added or removed depending on the business rule’s requirement.
System Variables
The System variables hold information representing the system state during the Rule Evaluation and
can be used when defining a business rule. However, only the special system variables (i.e variables
that starts with RULE… e.g RULE.SCORE ) are assignable. All other system variables can only be
used as a reference. For example a business rule cannot assign value to system variable TODAY. (i.e
TODAY = 20090101 is not a valid assignment )
Rule Variables
Rule variables are virtual fields that are used solely for that specific rule. The below example uses rule
variable TOTAL.BALANCE which at run time contains the total account balance.
Embedded Rule
It is possible to nest (embed) an existing rule with a new rule. However, it should be noted that is a
context used in embedded rules should be the same.
In the above example, both the rules (check Sector and Check Industry) uses the same context
CUSTOMER. These rules can be embedded when defining a new rule as below.
Following functions can be used when defining a business rule. Functions can also be selected from
the variable pane and such a selection would auto script the function selected in scripting pane.
The following operators will be supported. They are listed in precedence order, with the most tightly
binding operators listed first.
Rule Structure
It is possible to define simple and complex rules and the typical structure of a business rule may be
seen below.
Validate Rule
On selecting icon Validate Rule or Key F8 , Active rule is validated and below message is
displayed.
This confirms that a valid rule has been written – the syntax is correct, and the rule can be evaluated.
If there are problems with the validation, these will be shown in the Error pane, which will indicate the
first issue with the rule to be corrected.
On clicking the icon save Rule to T24 a save dialog would appear. A valid name and description
needs to be updated. A confirmation message should appear (as below)
Test Harness
The Test Harness is designed to enable the user to test their rule and ensure that it is giving the
expected results, before putting it to use. The user is able to enter sample data without accessing
T24 data, to see the output that would be generated if this data was supplied from T24 through the
contexts.
The results for the Valid Rule will be displayed in the Test Harness. On Pressing icon Run Test
Harness or key F5 Test Harness window is displayed.
Reporting
EB.RULES
EB.RULES is a system maintained file which holds the versions of each rules created in the Rules
GUI. The key to this file being a unique basic description of the underlying rule each time the rule
changed and saved the version/date is written to this file.
EB.RULES.VERSION
When a rule is saved in the GUI a record will be written to the file EB.RULES.VERSION, if the rule is
edited on a different day to the original rule then a new rule record will be written with the current date
as the new version number. This is so that versioning can be applied to rules, and specific versions of
rules can be called where appropriate.
The ARC / T24 output which the rules engine produces upon evaluation of a business rule.
EB.RULES.VERSION shows the rule structure in XML format.
EB.RULES.HIERARCHY
EB.RULES.HIERARCHY when a rule is saved a record will also be written containing one field
which will contain a chain of all the rules nested rule keys and the nested rules nested rules.
This is again necessary for rules versioning, where the user can work out how the changing of one
rule may impact the processing of other rules. For example, if a rule is updated to add a new context,
then all rules which use that rule may also need to be updated, to ensure they can still provide the
necessary data to run that rule