Predicate and Expression builder

There are many expressions or predicates that are required in Interact offer arbitration logics. Interact Runtime uses a third party library to parse expressions and calculates their values in process of offer arbitrations.

To define an expression, Interact Design Time environment has an Expression Builder, a reusable UI widget, which is used to build expressions in many UI components, for example, score predicate, eligibility predicate, FlexOffers, and user expression action, etc.

The following screen shows the Expression Builder.

The left pane of Expression builder contains a list of building blocks including variables, operators, and macro functions, which can be used to build an expression.

For ease of look ups, the building blocks are categorized and displayed by folders. “All built-in macros” contains all functions and operators, which are further grouped into “Logical operators”, “Mathematical operators”, and other categories, which are functionally meaningful. See the HCL Macros Guide, "Using macros in Unica Interact" section to find the functions linked to it.

The possible variables in an expression, different types of attributes defined in Interact Design Time are listed as follows.
  • MarketerScore
  • EligibleSegments
  • Offer attributes
  • Mapped profile attributes
  • Event patterns
  • Real-time attributes
  • Strategic segments
  • Smart segments

where “MarketerScore” and “EligibleSegments” are special variables and must be used without a change in spelling.

If no data is defined in the system, some categories may not be listed. Also, not all variable categories are displayed at all times. Depending on the expression being built, only applicable categories are displayed in the left pane as building blocks.

The right pane of Expression builder is a free form text area to build a new expression or display an existing expression. You can build an expression using the following options.

  • Select a item from left pane and drag and drop it to the curser position of your expression in right pane.
  • Type @ in right pane. All items available in the left pane are displayed as a sorted flat list. You can type or scroll and select an item.

Since, the right pane is a free form text area, Expression Builder provides capability to Validate syntax to ensure that your expression is syntactically correct so that it can be processed correctly during offer arbitration in Runtime. The similar syntax check is also performed while deploying the interactive channel containing strategies. If syntax of any expression is not correct, the deployment fails. You must have the Interact Runtime server configured to perform syntax check as it uses same syntax check modules in Interact Runtime.