Expressions
An expression is a combination of values, variables, operators, and functions that can be evaluated to produce a result. Think of it as a sentence of instructions that we tell inorigo®, and to get an answer from these instructions we need to write it in a language that inorigo® understands, i.e., expressions.
Overview
Expressions allow you in this way to customize and transform your data from the information you have to the information that you need. They can help you reduce the need for additional attributes and enable you to, for example, apply logic, use formulas, manipulate dates, or filter items.
Where can we use expressions?
Expression can be applied in some way for most modules in inorigo®. Look for an “Expression” text box for where you can add an expression. This can for example be in attribute automation in Model Builder or calculated columns in Knowledge Set Builder.
How to use expressions
Expressions can be as simple as a single value or variable, or they can be more complex, involving multiple values, functions, and operators. Some common types of expressions include Mathematical expressions (such as 2 + 3), logical expressions (such as x > y or a == b), and string expressions (such as "Hello, " + “name”).
A good use for expressions is to manipulate the data that you have created in Model Builder in other modules such as Application Builder and Knowledge Set Builder, but you can also, to some extent, use them in Model Builder. Note that the trickiest part about learning how to use expressions will be understanding how each available function works.
We have categorized the available functions according to their use in this documentation along with descriptions on how you can apply them in expressions.
Adding Comments
Comments can be added to your expressions, using the same format as a Java block comment, by writing /* at the start of the comment and */ after it. Comments can be added to any expression. They can be used to add context to what the expression is supposed to do and/or document any important information within the expression.
Examples: /* This is a comment*/
"Time is " + $NOW() /* This is a comment*/