You are viewing the documentation for Blueriq 15. Documentation for other versions is available in our documentation directory.
For the design guide on how to model logic see Decision Management guide.
For more information on what you can use in an Expression, please refer to the Reference Guide for Expression function reference.
What is it?
A reusable expression is a piece of logic that is reused throughout your application. We speak of a reusable expression to indicate that the purpose of it is to be reused, in Blueriq Studio this is shortened to expression.
What does it do?
With reusable expressions you can substitute parts of your logic with that reusable expression, which shortens your logic and makes it more understandable as well as maintainable.
How to – create a reusable expression
There are two ways to create a reusable expression:
- Via the Home tab → Logic group → click the Expression button
- By selecting (part of) an existing expression in the expression editor and clicking Create Expression
Create a reusable expression via the Expression button
- Select the Home tab
- From the Logic group select the Expression icon
- Fill in the required fields
- Click Save or Save & close
Properties
Property | Description |
---|---|
Cluster | Optionally select the name of the cluster from the drop down list. |
Name | It identifies the object. Maximum 100 characters (only letters, numbers and underscores (_)) are allowed. |
Functional name | Optional, can be used in documentation |
Description | Optional |
Expression | The actual expression is filled in here |
Create a reusable expression from the expression editor
- Open a logic element, for instance a business rule
- Select (part of) an expression used in the logic element
- With the right mouse click, a menu appears, select Create reusable expression from it
- Fill in the fields of the reusable expression (the expression itself is already filled in)
- The original expression that you created a reusable expression from, is now substituted by the reusable expression (named reusable). The reusable expression is denoted by curly braces ({ and }).
Using a reusable expression
Once you have created reusable expressions, you can use them in any logic element. There are two ways to insert a reusable expression in a logic element:
- When you are in an expression editor, you can select Inject Expression from the Expressions ribbon. This will insert the selected reusable expression at your cursor position.
- If you know the name of the reusable expression, you can also type it in the expression editor, bracketed by curly braces.
For performance reasons we advise to limit the use of reusable expressions to a minimum.