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

<LESS_THAN/>: "Less than" check in dynamic forms

The <LESS_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 less than “Expression b”:

<LESS_THAN>
Expression a
Expression b
</LESS_THAN>

The <LESS_THAN/> tag is used 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 <LESS_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):

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

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

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

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

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

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

2) Comparing two form properties with each other

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

<LESS_THAN>
<PROPERTY source="st_value" name="VALUE"/>
<PROPERTY source="st_upperLimit" name="VALUE"/>
</LESS_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:

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

© 2005 - 2024 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2024.12 | Data privacy