◷ 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

- Name: Name of the glossary
- Variable Definition: Define variables to be used in the glossary
- 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.

- Add a formula: Add a formula to boxed expression
- Delete the selected item: Delete a formula
- Mode up/ Move down: Change the order of the expressions
- Properties: Properties of the glossary
- Filter: Search a formula in the glossary

### Expression Properties

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

- Boxed Expression: Type of the boxed expression
- Expression: Expression of the boxed expression
- Name: Name of the formula. This name will be used throughout the documents to refer to the expression.
- Parameters: If there are parameters used in the expression, define them here
- 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

- Open the decision table you want to use a formula from boxed expressions.
- Refer to the boxed expressions file.
- Select a column.
- Under
*Properties*window –>*Value*, you will see a property called ‘Expression’. - Enter the formula name you want to use.

### 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*).