evaluate term (a, b, c, d, e, [f])


This function can be used to evaluate a logical expression a. If the result is false, messages c of different types b (warning, info, error) can be logged into an internal list. This list can, for example, be output with the function dump validation data (a, b).

If at least one message of type error has been created, the profile terminates with an error at the end if the function dump validation data (a, b) has not been executed somewhere in the destination structure and the messages of type error have not been converted into user errors. The optional parameter f may contain the name of the source field - this shows the field more clearly in error handling and makes it easier to find.

The return value of the function is the result of the evaluation in a.

Description of Parameters

Parameter

Description

a

The logical expression to be evaluated. See section below for allowed operators and examples.

b

Type of the message that is generated if the term in a is evaluated to false. W, I or E for warning, info, error. Note: If the system variable VAR_SYS_VALIDATION_ERRORS has been created, every time an error is created, the number of errors so far is stored in it.

c

Text of the message. See parameter e.

d

If you later choose to use the option to create user errors in function dump validation data (a, b), you can specify the source value to be marked in d. Details can be found in the documentation of function log user error(a,b,[c]).

e

Optional properties file. If a value is specified here, parameter c is interpreted as a key in the properties file and the value for this key is used as the message text.

f

(optional) If you later choose to use the option to create user errors in function dump validation data (a, b), you can specify the source structure field to be marked in f. Details can be found in the documentation of function log user error(a,b,[c]).

Allowed Operators in Parameter a

Numerical Operators


Operator

Description

<

Numerically less.

<=

Numerically less than or equal.

>

Numerically greater.

>=

Numerically greater than or equal.

==

Numerically equal.

String Operators

Operator

Description

.equals

String equality.

.substring(a,b)

Substring from index a to b.

Logical Operators

Operator

Description

!

Logical NOT.

AND

Logical AND.

OR

Logical OR.

true

True.

false

False.

Reference to Function Position in Function Chain

Operator

Description

#<n>

Result of the function with position number <n> in the function chain. Important note: If the referenced value is a string, remember to put the value in quotes, as you do with other string values. See example below.

Parentheses

Operator

Description

()

Parentheses around a term, e.g. (1<2)

The usual rules used in standard logic apply.


Note: In principle, all available Java functions can be used in parameter a, but only those mentioned above will be covered by our support . Example: "Hans".concat(" in Luck").equals("Hans in Luck")

Examples

A basic understanding of logical expressions must be assumed here. It should be noted that you always want to get a logical value as a result. That is if you create large terms from subterms (for example, a numerical subterm would be 1<2), then these subterms must be connected with logical operators. The sub-terms themselves can be logical or numerical or perform string comparisons.

Term

Result

2<1

false

33==33

true

true AND false

false

true AND true

true

(1<2) OR (true AND false)

true

!((1<2) OR (true AND false))

false

"Hans".equals("Hans")

true

("Hans".equals("Hans")) AND false

false

"Hans".equals("Peter")

false

#1==22

If the function at position 1 of the function chain has the return value 22, then true.

#1 AND true

If the function at position 1 of the function chain has the logical return value true, then true. Note: The return value of the function must, for example, come from a logical function, it cannot just be a string true.

!(#1)

If the function at position 1 of the function chain has the logical return value true, then false.

"#1".equals("Hans")

If the function at position 1 of the function chain has the string return value Hans, then true.