Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

This is a draft document. It can be modified at any time by any committer. Comments on the draft should be made on the dev mailing list.

Attributes

Info
titleProposed Attribute Type Section

Attribute Types

constant

A string constant. The string may not include an expression

constant+expr

A string constant. The string may include an expression, but an expression-only string is not allowed

expression

A UEL expression

script

A short script ("scriptlet")

...

Conditional/Looping Statements

...

Info
<assert>
<check-id>
<check-errors>
<check-permission>
<condition>
<else>
<else-if>
<if>
<if-compare>
<if-compare-field>
<if-empty>
<if-has-permission>
<if-instance-of>
<if-not-empty>
<if-regexp>
<if-validate-method>
<iterate>
<iterate-map>
<loop>
<not>
<or>
<return>
<then>
<while>

...

titleProposed Changes

Add <continue> and <break> looping sub-elements.


Section
Column
width20%
<and>
Column
Combines conditional elements using a boolean AND.
Code Block
xml
xml

<if>
    <condition>
        <and>
            <if-compare field="colorModel" operator="equals" value="RYB" />
            <or>
                <if-compare field="color" operator="equals" value="red" />
                <if-compare field="color" operator="equals" value="yellow" />
                <if-compare field="color" operator="equals" value="blue" />
            </or>
        </and>
    </condition>
    <then>
        <set field="isPrimaryColor" value="true" type="Boolean" />
    </then>
    <else>
        <set field="isPrimaryColor" value="false" type="Boolean" />
    </else>
</if>
Section
Column
width20%
<assert>
Column
Evaluates each contained condition independently, and adds an error to the error message list for each condition that does not evaluate to true.

Attributes

title

optional

The assertion title - used in error messages to identify the assertion

 

error-list-name

optional

The name of the error list

Defaults to "error_list"


Child Elements

Any <condition> child element

optional

A condition to test


Info
titleProposed Changes
  • Currently, the title attribute is optional. Keep the title attribute optional but have it default to the file location and line number.
  • Eliminate the error-list-name attribute.
  • Currently, the child element is optional. Require at least one child element.
<check-id>
<check-errors>
<check-permission>
Section
Column
width20%
<condition>
Column
Combines a group of conditional elements into a single logical (true/false) expression.
Code Block
xml
xml

<if>
    <condition>
        <and>
            <if-compare field="colorModel" operator="equals" value="RYB" />
            <or>
                <if-compare field="color" operator="equals" value="red" />
                <if-compare field="color" operator="equals" value="yellow" />
                <if-compare field="color" operator="equals" value="blue" />
            </or>
        </and>
    </condition>
    <then>
        <set field="isPrimaryColor" value="true" type="Boolean" />
    </then>
    <else>
        <set field="isPrimaryColor" value="false" type="Boolean" />
    </else>
</if>
Section
Column
width20%
<else>
Column
Contains a block of code to be executed when a <condition> element evaluates to false.
Code Block
xml
xml

<if>
    <condition>
        <and>
            <if-compare field="colorModel" operator="equals" value="RYB" />
            <or>
                <if-compare field="color" operator="equals" value="red" />
                <if-compare field="color" operator="equals" value="yellow" />
                <if-compare field="color" operator="equals" value="blue" />
            </or>
        </and>
    </condition>
    <then>
        <set field="isPrimaryColor" value="true" type="Boolean" />
    </then>
    <else>
        <set field="isPrimaryColor" value="false" type="Boolean" />
    </else>
</if>
Section
Column
width20%
<else-if>
Column
Contains a block of code to be executed when a <condition> element evaluates to false.
Code Block
xml
xml

<if>
    <condition>
        <and>
            <if-compare field="colorModel" operator="equals" value="RYB" />
            <or>
                <if-compare field="color" operator="equals" value="red" />
                <if-compare field="color" operator="equals" value="yellow" />
                <if-compare field="color" operator="equals" value="blue" />
            </or>
        </and>
    </condition>
    <then>
        <set field="isPrimaryColor" value="true" type="Boolean" />
    </then>
    <else-if>
        <condition>
            <and>
                <if-compare field="colorModel" operator="equals" value="CYM" />
                <or>
                    <if-compare field="color" operator="equals" value="cyan" />
                    <if-compare field="color" operator="equals" value="yellow" />
                    <if-compare field="color" operator="equals" value="magenta" />
                </or>
            </and>
        </condition>
        <then>
            <set field="isPrimaryColor" value="true" type="Boolean" />
        </then>
    </else-if>
    <else>
        <set field="isPrimaryColor" value="false" type="Boolean" />
    </else>
</if>
<if>
<if-compare>
<if-compare-field>
<if-empty>
<if-has-permission>
<if-instance-of>
<if-not-empty>
<if-regexp>
<if-validate-method>
<iterate>
<iterate-map>
<loop>
Section
Column
width20%
<not>
Column
Inverts a conditional element using a boolean NOT.
Section
Column
width20%
<or>
Column
Combines conditional elements using a boolean OR.
Code Block
xml
xml

<if>
    <condition>
        <and>
            <if-compare field="colorModel" operator="equals" value="RYB" />
            <or>
                <if-compare field="color" operator="equals" value="red" />
                <if-compare field="color" operator="equals" value="yellow" />
                <if-compare field="color" operator="equals" value="blue" />
            </or>
        </and>
    </condition>
    <then>
        <set field="isPrimaryColor" value="true" type="Boolean" />
    </then>
    <else>
        <set field="isPrimaryColor" value="false" type="Boolean" />
    </else>
</if>
<return>
Section
Column
width20%
<then>
Column
Contains a block of code to be executed when a <condition> element evaluates to true.
Code Block
xml
xml

<if>
    <condition>
        <and>
            <if-compare field="colorModel" operator="equals" value="RYB" />
            <or>
                <if-compare field="color" operator="equals" value="red" />
                <if-compare field="color" operator="equals" value="yellow" />
                <if-compare field="color" operator="equals" value="blue" />
            </or>
        </and>
    </condition>
    <then>
        <set field="isPrimaryColor" value="true" type="Boolean" />
    </then>
    <else>
        <set field="isPrimaryColor" value="false" type="Boolean" />
    </else>
</if>
<while>
Section
Column
width20%
<xor>
Column
Combines conditional elements using a boolean XOR.


Call Operations

<call-bsh>

...