Assertion functions

Assertion functions are normally used within the context of a decision step rather than as an element of the Function action.

Note: Functions can be written in Legacy Script Language or in ECMAScript. For details, see Scripts within tests and stubs. All the examples given in the following table are in Legacy, unless otherwise specified.
Function Usage
And

The And function performs a logical AND on the results of one or more expressions, returning true or false.


and(expr, expr, ....)
Legacy Example:

and(eq("yes", %%answer%%), validateXSD(%%doc%%, "%%SYSTEM_PROJECT_ROOT%%\\example.xsd" )
ECMAScript Example:

and((answer == "yes"), validateXSD(doc, "%%SYSTEM_PROJECT_ROOT%%\\example.xsd" ))
Equals

The Equals function returns true if the expressions are logically equal.


eq(expr,expr)
Note: Both expressions are evaluated as strings, regardless of whether one or both expressions are quoted (including tags).
Greater than

The Greater than function returns true if the first expression is greater than the second.


gt(expr,expr)
Greater or equal

The Greater or equal function returns true if the first expression is greater than or equal to the second.


ge(expr,expr)
Less than

The Less than function returns true if the first expression is less than the second.


lt(expr,expr)
Less or equal

The Less or equal function returns true if the first expression is less than or equal to the second.


le(expr,expr)
Not equal

The Not equal function returns true if the first expression is unequal to the second.


ne(expr,expr)
Or

The Or function performs a logical OR on the results of one or more expressions, returning true or false.


or(expr, expr, ....)
Legacy Example:
or(eq("yes", %%answer%%), validateXSD(%%doc%%, "%%SYSTEM_PROJECT_ROOT%%\\example.xsd" )
ECMAScript Example:
or((answer == "yes"), validateXSD(doc, "%%SYSTEM_PROJECT_ROOT%%\\example.xsd" ))