Rulebases


A Rulebase is a collection of rules, or custom expressions, that when triggered perform a defined action, such as prompting an alert or making a change to the model.

Creating a New Rulebase

A new Rulebase can be added to a model by selecting Rulebase from the New Item Menu.
Screenshot

Rules

Add a rule to Rulebase by selecting Create new rule while in Edit Mode.

Trigger Expressions

Trigger expressions follow the same syntax and semantics as other expressions in Modelshop, however the expression must return a boolean (true or false).

Result Text

When a rule is triggered on an item, we can define the textual output describing what rule was triggered and why.

Templating

Inside of the result text, we can insert values from the item which triggered the rule. To do this, simply encapsulate the field you would like to access

${ sampleField }

Additionally, logical expressions and computation can be done within the templating brackets when necessary.

${ sampleField - otherSampleField }

Formatting

To ensure readability, values inside of templating brackets can be formatted according to their intended meaning.

Format Syntax
Currency ${ Format.currency(sampleField) }
Number (percentage) ${ Format.number(sampleField / otherSampleField, “0.00%”) }
Integer ${ Format.integer(sampleField - otherSampleField) }
Date ${ Format.date(sampleDateField) }

Action Expressions