Business Layer Rules Templates

Business Layer Rules Templates

Intro

This guide describes how BL rules templates can be used to create business rules for FIXICC H2 1.3.0 and later.

There are templates for rules, events, and conditions. Rule and event templates are used for creating rules from YAML templates. Regarding condition templates, they are used in the dynamic condition builder. A condition is a special type of rule/event parameter. It can be used to create a rule's condition.

How-To Guide

Preparation

Change Business Rules Configuration Mode to ‘Biz_Layer_Components’ mode. Please refer to this article.

Templates and Template Editor pages

There is a "Templates" option in the side menu. If a user clicks it, the Templates page with a table of templates will be displayed.

templates list.png

Besides the table, the Templates page contains a detailed view for a template which will open if a user selects some table row.

There are default and extended filters on the Templates page. In addition, there are Add, View, Edit, and Remove buttons on the page. If a user clicks Add or Edit, the Template Editor page will open.

template editor.png

There is a code editor for template text and two buttons: OK and Cancel on this page.

Such actions as Edit and Remove are also available from the Template Detailed view.

Add rule from template

Adding a new rule from a template can be done in different ways:

  • From the BL components page, click the Create popup button and select "Rule from template."

Rule from template 1.png
  • From the Sessions page, click on a FIX session and select the "Add rule from template" option in the context menu.

Rule from template 3.png
  • From Session Detailed view, click the Other popup button and select "Add rule from template."

Rule from template 2.png

Then the Rules window will open. It contains the list of rules and event templates.

Rules window.png

When a user clicks a table row, the "New rule from template" dialog will open. Its content is generated dynamically from a YAML template. The dialog contains a Name text field (required), Description (read-only), Source component, Trigger lookup field (for events only), dynamic parameters fields, Summary (read-only), and a "Create Rule" button.

New rule from template.png

If a user clicks "Add" to add a source, the Source component will be displayed. It is possible to choose FIX session by sender, target, qualifier; FIX session by name; FIX session by regex; TA session by name; or TA session by regex.

source.png

If a user tries to add a new rule from a template for a specific FIX session (after they have clicked "Add rule from template" in the context or Other menu), the source will be displayed as read-only.

source read only.png

If a user selects some event template in the Rules window, the "New rule from template" dialog will contain a "Trigger" lookup field with available events: "Message has not been processed", "FIX session state has been changed", "Session created".

event.png

With regard to dynamic parameters of a rule, string and integer parameters can be entered into text fields. In addition, there is validation for integer fields. As for enumeration parameters, they can be entered in lookup fields.

Regarding such parameters as FIX sessions and TA sessions, JavaScript, History, and FIX Message Type, lookup picker fields are used. So a user can select a FIX session from the list or click "..." in a lookup picker. If they click "...", a dialog with the FIX sessions table will be displayed. A user can add, edit, or remove a FIX session if necessary, select some session, and click the Select button in the dialog. As a result, the session will be selected.

lookup picker list.png
lookup picker table.png

As far as the condition parameter is concerned, the Condition component will be displayed for such a parameter. It includes a lookup field with a conditions list. A user can select some condition.

Condition list.png

When a condition is selected, an input dialog with its parameters will open. Condition parameter types are similar to rule or event parameter types.

condition parameter.png

A user can enter parameter values and click Ok. Then the label with the selected condition (condition's caption field with populated parameters) will be displayed under the condition lookup field.

It is possible to select several conditions.

several conditions.png

As for Summary, it is a description of what will be done by the rule. When the "New rule from template" dialog is open, parameter names and source in Summary are replaced with "undefined". But when a user enters sources and parameters, they will be displayed in Summary.

rule summary.png

If several conditions are selected, they will be concatenated in the Summary using "AND".

several conditions (1).png

When parameters are entered, the rule's name is filled, and the "Create Rule" button is clicked, the "New rule from template" dialog will be closed, and the rule or event will be added to the FIXICC H2 database. The rule will be displayed in the table on the BL Components page.

created rule.png