Logic Syntax

Sometimes when creating a logical rule, you may find it easier to manually enter the rule rather than using the graphical logic builder, such as when you are copying logic to use in a new rule. When doing so, it is important that your rule has the correct logic syntax. In the event that your syntax is incorrect, you will not be able to save the rule and a descriptive message will display. You can always open the graphical logical builder to complete an incomplete logical rule.

 

Logical Rule

A single logical rule is made up of three components; a question, middle operator and answer. The question is displayed as a field reference code wrapped in square brackets '[ ]', as shown here. The operator can either be a relational operator or special operator. The answer, which is displayed on the right-hand side of the logical rule is always wrapped in curly brackets '{ }'. The answer will either be an option reference code, as shown here or a number or date-time literal, ie {100}.

Logical rule

 

Combining Logical Rules

Logical rules can be combined using the AND and OR logic operators. When combined, each logical rule must be separated by a comma. The logical rules must be wrapped in curved brackets '( )'. 

 

Nesting of Logical Rules

Logical rules can be nested to create expressions of increased complexity. When nesting a rule, be sure to include a comma between each expression and nested rule, as you would between logical rules.

 

 

Balanced Brackets

Brackets are said to be balanced when every opening bracket has a corresponding closing bracket. Logical rules in the Rulestar system must always have balanced brackets (this applies to all types of brackets). If brackets are not balanced, the expression will be invalid and you will be unable to save it.