Boxed Expressions

◷ Reading Time: 5 minutes

What is a Boxed Expression?

Boxed Expressions is a business glossary document that has only formulas definition. Boxed Expressions enable 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 easy.

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

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

Top Menu

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

  1. Add a formula: Add a formula to boxed expression
  2. Delete the selected item: Delete a formula
  3. Properties: Properties of the glossary
  4. Filter: Search a formula in the glossary

Expression Properties

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

  1. Name: Name of the formula. This name will be used throughout the documents to refer to the expression.
  2. Expression: Expression of the formula
  3. 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.
  4. Parameters: If there are parameters used in the expression, define them here
  5. Description: Description of the formula

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 the boxed expressions file.
  3. Select a column.
  4. Under Properties window –> Value, you will see a property called ‘Expression’.
  5. Enter the formula name you want to use.
    designer-boxed-expression-DT

Natural Language

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

Press Control + Space in 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 October 9, 2020

Article Attachments

Was this article helpful?

Related Articles