With the Expression Editor, a simple or a complex OTX term can be created without writing OTX code, see the image below. An OTX term may consist of many terms and different operators (i.e. operators and terms can be nested), and it has exactly one return value of a defined data type. All the OTX terms are categorized in the editor according to the OTX libraries (OTX Core and other OTX extensions). To open the Expression Editor, you can select the "<Expression>..." menu item in the combo box of a property in the properties window. With the Assignment activity, you can easily access the Expression Editor by clicking on the wrench icon ("") on the Assignment in the workflow.
Expression Editor Features
The Expression Editor consists of the expression box in the upper part and the selection box in the lower part, see image.
|Expression Editor allows for creating and editing OTX terms|
In the expression box, the OTX terms can be freely created and edited using the keyboard.
The operators can be entered in the expression box by using the keyboard. For example the "+" operator:
LengthOfString(Variable1) + 5
The Expression Editor supports the selection of the following important operators:
|%||Modulo, calculates the remainder after dividing its first operand by its second|
|&||Bitwise AND combination|
||||Bitwise OR combination|
|^||Bitwise XOR combination|
|>=||Greater than or equal|
|<=||Less than or equal|
In the selection box below the supported operators, all the available declarations, parameters, validities and OTX terms (also user-defined terms) are listed in groups. To insert a term or a declaration at the current cursor position in the Expression Editor, you only need to double-click on that term or declaration in the selection box.
A term has the following basic structure:
«result» = Name(«arg1», «arg2», «...», «argN»)
At the time of execution, each term returns a «result». Each term contains arguments «arg», and each argument can be replaced with a literal value (or a literal expression), a declaration or another term, note that the data of the input declarations shall not be changed by the calculation.
Adding an Expression
To add an expression of OTX term to a property of an activity, please proceed as follows:
- Open the properties window to view the properties of the activity
- Select the "<Expression>..." menu item in the combo box of the property you want to add the expression
- Find the appropriate term in the selection box
- Double-clicking on the term to insert it at the current cursor point in the Expression Editor
- Click on one of the arguments of the term
- Find and double-click on a declaration or a term to input for the argument
- Do the same for all the other arguments, you can delete the optional arguments
- Add operators by manually typing on the keyboard (if necessary)
- Add more terms and declarations etc.
- Apply the expression to the property via the OK button.