This filter calculates the value of a given expression.
The expression must be entered with valid syntax and can contain logical operators & (AND), | (OR), algebraic operators +, -, / and operators of comparison <, >, !=, and so on. To view the complete list of operators, see Operators.
The syntax of expressions is identical with that of conditional expressions. For more information, see Conditional Activation.
The expression can contain numbers, strings, Boolean constants (TRUE, FALSE) and RRTs from another components or previous filters.
|Field name||Enter the name of the FRTN generated by the filter.|
|Expression||Enter the expression in this field.|
|Fail job if input/output is invalid||If this check box is selected, the component will reject the current job if input or output is empty.|
|Test||Click this button to evaluate the expression; the result will be displayed in a separate dialog box.|
~DFT::%field name%~ is replaced with the value of the expression.
Examples of filter usage
Here are examples of expressions.
- Algebraic operations:
- "1 + 1" evaluates to 2
- "(2 * 100 + 300) / 50" evaluates to 10
- Logical operations produce TRUE or FALSE values:
- ~RRT::FileExt~ = ”PDF” is true if the file has PDF extension.
- ~RRT::FileSize~ > 10485760 is true when the size of the file exceeds 10485760 bytes.
- (~RRT::FileExt~ = ”PDF”) & (~RRT::FileSize~ > 10485760) is true if both of the above conditions are true.
- (~IMA::FromName~ = "John" | ~IMA::FromName~ = "Jane") & ~IMA::Subject~ = "report" evaluates to true if, when using the IMAP Capture component, the sender name is "John" or "Jane" and the subject is "report".
- ~FTP::SiteIP~ = "10.16.16.95" is true when the IP address of the FTP server from which the file is captured equals to 10.16.16.95.
- Complex expressions:
- ~DFT::FileSize~ > 10000 ? ~DFT::FileName~ + "_large" + ~DFT::FileExt~ : ~DFT::FileName~ + "_small" + ~DFT::FileExt~ is an example of a ternary operator that uses conditional selection. The result will be the name of the file with appended string, "_large" or "_small", depending on whether the size of the file is greater or less than 10000 bytes.