Skip to content

Expressions

Steve Cote edited this page Apr 23, 2017 · 1 revision

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

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.

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

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.

Operators

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'.

Functions

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

Constants

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

Methods

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.

Home

  1. Concepts
  2. Features
  3. Transform Engine
  4. Quick Start
  5. Configuration
  6. Secrets Vault
  7. Readers
  8. Writers
    • List of Writers
    • Custom Writers
  9. Filters
    • Accept
    • Reject
    • Custom Filters
  10. Tasks
    • List of Tasks
    • Custom Tasks
  11. Validators
    • List of Validators
    • Custom Validators
  12. Listeners
    • List of Listeners
    • Custom Listeners
  13. Transforms
    • List of Transforms
    • Custom Transforms
  14. Mappers
  15. Context
  16. Databases
  17. Templates
  18. Logging
  19. Encryption
  20. Usage
  21. Expressions
  22. Examples
Clone this wiki locally