Start page / Template development / Rules / Comparative expressions / <GREATER_THAN/>

<GREATER_THAN/>: "Greater than" check in dynamic forms

The <GREATER_THAN/> tag can be implemented in the value determination area of the rule definition (or for the definition of a precondition) and is used to compare two logical expressions. The result of the combined logical expression is a Boolean value, which is true when “Expression a” is greater than “Expression b”.

<GREATER_THAN>
Expression a
Expression b
</GREATER_THAN>

The <GREATER_THAN/> tag makes it possible to check a property of the form against a comparison value.

To do this, a <PROPERTY/> tag is used to query a particular numeric property of the form element (such as the length of a value in an input component or the date from a CMS_INPUT_DATE type input component) within the <GREATER_THAN/> tag.

The comparison value may be a fixed (numeric) default value or may refer to a numeric property of a (different) form element.

The following tags can be used to enter a fixed, defined default value:

  • <NUMBER/>: used to enter a numeric comparison value within an expression of comparison.
  • <DATE/>: used to enter a fixed, defined date within an expression of comparison.

Examples

1) Comparing a form property with a numeric default value

VALUE / NUMBER:
Compares the value of an input component (<PROPERTY/> tag) with a numeric default value (<NUMBER/> tag):

<GREATER_THAN>
<PROPERTY source="rules_element" name="VALUE"/>
<NUMBER>2</NUMBER>
</GREATER_THAN>

LENGTH / NUMBER:
Compares the length of the value of an input component (<PROPERTY/> tag) with a numeric default value (<NUMBER/> tag):

<GREATER_THAN>
<PROPERTY source="st_text" name="LENGTH"/>
<NUMBER>2</NUMBER>
</GREATER_THAN>

SIZE / NUMBER:
Compares the number of the entries of an

type input component (<PROPERTY/> tag) with a numeric default value (<NUMBER/> tag):

<GREATER_THAN>
<PROPERTY source="st_list" name="SIZE"/>
<NUMBER>2</NUMBER>
</GREATER_THAN>

2) Comparing two form properties with each other

VALUE / VALUE:
Compares the numeric values from two input components to each other (using two <PROPERTY/> tags):

<GREATER_THAN>
<PROPERTY source="st_value" name="VALUE"/>
<PROPERTY source="st_upperLimit" name="VALUE"/>
</GREATER_THAN>

3) Comparing a date from an input component with a predefined date

VALUE / DATE:
Compares the value from a CMS_INPUT_DATE type input component (<PROPERTY/> tag) with a predefined date:

<GREATER_THAN>
<PROPERTY source="st_date" name="VALUE"/>
<DATE>2012-12-01 12:00:00 +0100</DATE>
</GREATER_THAN>

© 2005 - 2022 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2023.1 | Data privacy