-
Notifications
You must be signed in to change notification settings - Fork 2
Expressions
Coyote DX makes use of an infix expression evaluator in a variety of locations.
There are two types of expressions supported: Boolean and Numeric
Boolean expressions always evaluate to either true
or false
and can only contain boolean values or the boolean operators (!, ||, &&). Boolean values can be represented with literals, constants and methods.
Boolean methods in expressions allow for a simple method(arg1,argX)
notation to represent boolean values in an expression. For example, match( Working.RecordType, HDR)
will evaluate to true
if the current working frame contains a field named "RecordType" and its value contains "HDR" in any case variation. For a case sensitive check the equals( Working.RecordType, HDR)
method can be used.
Numeric expressions are regular math expressions which evaluate to a Double value; a value with a decimal. Only numerics are supported and boolean values are not allowed.
The basic operators are supported so expressions like 1+1
, 6/3
and 0-2^2
are possible.
Operator | Description |
---|---|
+ | Addition |
- | Subtraction |
- | Unary minus |
* | Multiplication |
/ | Division |
^ | Exponentiation |
% | Modulo |
Because Java is used to implement exponentiation, there are some limitations. For example (-1)^(1/3) returns NaN
. Please refer to Oracle documentation about limitations in `java.lang.Math.pow'.
There are several numeric functions supported which make more complex numeric expressions such as sin(pi/2)
possible.
Function | Description |
---|---|
abs | absolute value |
acos | arc cosine |
asin | arc sine |
atan | arc tangent |
average | average of arguments |
ceil | nearest upper integer |
cos | cosine |
cosh | hyperbolic cosine |
floor | nearest lower integer |
ln | natural logarithm (base e) |
log | base 10 logarithm |
max | maximum of arguments |
min | minimum of arguments |
random | pseudo-random number (between 0 and 1) |
round | nearest integer |
sin | sine |
sinh | hyperbolic sine |
sum | sum of arguments |
tan | tangent |
tanh | hyperbolic tangent |
There are a few constants which are evaluated within the current Context
Constant | Description |
---|---|
e | Base of natural logarithms |
pi | Ratio of the circumference of a circle to its diameter |
frame | current frame number |
The current supported methods in the Numeric Expressions is described below:
Method | Description |
---|---|
value | Retrieve the numeric value of the given field in the context. |
- Concepts
- Features
- Transform Engine
- Quick Start
- Configuration
- Secrets Vault
-
Readers
- List of Readers
- Custom Readers
-
Writers
- List of Writers
- Custom Writers
-
Filters
- Accept
- Reject
- Custom Filters
-
Tasks
- List of Tasks
- Custom Tasks
-
Validators
- List of Validators
- Custom Validators
-
Listeners
- List of Listeners
- Custom Listeners
-
Transforms
- List of Transforms
- Custom Transforms
- Mappers
- Context
- Databases
- Templates
- Logging
- Encryption
- Usage
- Expressions
- Examples