Boxed Expressions

◷ Reading Time: 5 minutes

What is a Boxed Expression?

Boxed Expressions is a business glossary document that has only expression definitions. Boxed Expressions enable the reusability of equations across different models. Using boxed expressions, you can create the building blocks of your logic or rules and then allow them to be used and shared in various places.

For example,

if you have an SQL query that can be used in multiple documents, you can add the query as a boxed expression and reuse it easily.

A Boxed Expression is a two-column table: The first column is the name and the second column is the value or expression. There are several types of value expressions as follows: Literal (constant) expression, Function definition, and Invocation.

You can add different types of expressions as boxed expressions.

  • Formula: To write formulas
  • Literal: To assign constants and literal formulas (without any parameters)
  • Function: To assign a function with a list of expressions
  • Native Method: To assign .NET native methods
  • Embedded Model: To embed a document from the project

Boxed Expressions

To add a new Business Glossary document,

Document Types --> Business Concept --> Boxed Expressions

Once you added an expression, this will be the window.

Boxed Expression Properties

  1. Name: Name of the glossary
  2. Variable Definition: Define variables to be used in the glossary
  3. Types Definition: List of Types and Functions

Toolbox

The ToolBox contains the following expression types,

  • Formula: To write formulas
  • Literal: To assign constants and literal formulas (without any parameters)
  • Function: To assign a function with a list of expressions
  • Native Method: To assign .NET native methods
  • Embedded Model: To embed a document from the project

Top Menu

At the top menu, you can see the following items.

  1. Add a formula: Add a formula to the boxed expression
  2. Delete the selected item: Delete a formula
  3. Mode up/ Move down: Change the order of the expressions
  4. Properties: Properties of the glossary
  5. Filter: Search a formula in the glossary

Expression Properties

If you click on an expression, the formula property window will appear.

  1. Boxed Expression: Type of the boxed expression
  2. Expression: Expression of the boxed expression
  3. Name: Name of the formula. This name will be used throughout the documents to refer to the expression.
  4. Parameters: If there are parameters used in the expression, define them here
  5. Type: Type of the formula’s expression result. The default is Expression. The other option is List which will translate the result into a list.

Referencing Boxed Expressions

It is similar to referencing a Business Glossary.

Referencing a formula

Decision Table

  1. Open the decision table you want to use a formula from boxed expressions.
  2. Refer to the boxed expressions file.
  3. Select a column.
  4. Under Properties window –> Value, you will see a property called ‘Expression’. You can add your formula name here.
  5. Or, as a cell value, you can enter the formula name with a : . For example, :Caclculate Total.

Natural Language

Similar to the decision table referencing, the ‘Term’ property is available under the Properties window.

Press Control + Space on the keyboard and the options can be viewed.

Sample Boxed Expression

A sample boxed expression file can be downloaded from the attachments at the end of this page (BoxedExpression.txt).

Rename the document extension from .txt to .xml before opening in your FlexRule project

Updated on April 12, 2022

Article Attachments

Was this article helpful?

Related Articles