Ruling

General Language Guidance

The rule language does not support referring to items by 'this'. The rule language is case-sensitive. This means that:

  • Upper case must be used for all keywords (for example IF, THEN, ELSE).

  • Lower case must be used for Boolean values (true, false) and they must be not enclosed within quotation marks.

  • The correct case must be used when referring to Form items by their code.

Structure

Basic 'IF' Structure

This is the simplest of the rule structures available and invokes specified behaviour if a condition is met.

IF (Car = "blue")
... do something

The 'IF...ELSE' Structure

This is a slightly more complex structure, invoking an alternative action if the condition is not met.

IF ( colour = "blue" )
... do something
ELSE
... do something else

The 'IF...ELSE IF...ELSE' Structure

This structure requires the nesting of one statement within another to enable multiple conditions to be checked and acted upon.

With this template, parentheses are used to embed one 'IF ... ELSE' statement within another. The closing parenthesis is required for the rule to be valid.

Keywords

There are a number of keywords that can be used within the rules language: Conditional Keywords to enable conditions of varying complexity to be checked within the main statement; and Behavioural Keywords to provide the different actions available within a Form.

Conditional Keywords

AND enables two or more conditions to be verified. Progress will only be made if all the conditions are met. In the following example:

AND ( colour = "blue" ) ( grass = "green" )

In order to progress, it is necessary that both the colour is blue and that the grass is green.

OR enables two or more conditions to be verified. Progress will be made if at least one of the conditions are true. In the following example:

OR ( colour = "blue" ) ( grass = "green" )

You only need either the colour to be blue or the grass to be green in order to progress.

XOR enables two or more conditions to be verified and progress will be made if only one part is true (but not if more than one part is true). In the following example:

XOR ( colour = "blue" ) ( grass = "green" )

You need either the colour to be blue or the grass to be green in order to progress. You will not progress if both the colour is blue and the grass is green

Behavioural Keywords

These keywords relate to the component parts of a Form (Panels, Question Groups and Questions) and need to be followed by the Code of the item for which the action is to be taken. For example, if we look at the rule shown in the Example, and display it in the Rules Editor, it sets out the conditions under which the different Question Groups are shown and hidden:

The rule means that if the type of policyholder is an individual (as opposed to an organisation), then the following occurs:

  • The POLICYHOLDER_INFO Question Group is shown; and

  • The IS_DRIVER Question Group is shown; and

  • The COMPANY_NAME Question Group is hidden (unless set to Initially Visible).

If the Policyholder is not an individual, then the opposite occurs, that is to say:

  • The POLICYHOLDER_INFO Question Group is hidden (unless set to Initially Visible); and

  • The IS_DRIVER Question Group is hidden (unless set to Initially Visible); and

  • The COMPANY_NAME Question Group is shown. In addition:

  • The POLICYHOLDER_BUSINESS Question Group is shown

Panel Keywords

The Panel keywords are as follows:

  • SHOW_PANEL <panel_code>

  • HIDE_PANEL <panel_code>

For example:

This means that, if the party type is an "individual" (as opposed to an "organisation"), then the following occurs:

  • The policyholder individual details Panel is shown; and

  • The policyholder organisation details Panel is hidden (unless set to Initially Visible); and

  • The add individual policyholder details Panel is shown.

If the policyholder is not an "individual", then the opposite occurs, that is to say:

  • The policyholder individual details Panel is hidden (unless set to Initially Visible); and

  • The policyholder organisation details Panel is shown; and

  • The add individual policyholder details Panel is hidden (unless set to Initially Visible).

Question Group Keywords

The Question Group keywords are as follows:

  • SHOW_Q_GROUP <question_group_code>

  • HIDE_Q_GROUP <question_group_code>

  • CLEAR_Q_GROUP <question_group_code>

Question Keywords

The Question keywords are as follows:

  • SHOW <attribute_code>

  • HIDE <attribute_code>

  • CLEAR <attribute_code>

  • ENABLE <attribute_code>

  • DISABLE <attribute_code>

  • SETVALUE AGE CALC_AGE(DATE_OF_BIRTH)

For example:

The rule means that if the driver's date of birth has been completed, then the following occurs:

  • The DriverAge is set as the difference in years between the driver's date of birth and the quote start date; and

  • The DriverAge field is disabled.

If the driver's date of birth has not been completed, then:

  • The DriverAge field is enabled.

Last updated