Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added <break> and <continue>.

...

Conditional/Looping Statements

Info
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 message 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.
Section
Column
width20%
<break>
Column
Causes script execution to exit the nearest loop element.
Section
Column
width20%
<check-id>
Column
Evaluates the specified field, and adds an error message to the error message list if the field's value is not a valid database ID value.

Attributes

field

optional

The name of the field to validate

 

map-name

optional

The name of the map containing field

 

error-list-name

optional

The name of the error list

Defaults to "error_list"


Child Elements

<fail-message>

optional

<fail-property>

optional


Info
titleProposed Changes
  • Currently, the field attribute is optional. Require the field attribute.
  • Eliminate the map-name and error-list-name attributes.
  • Currently, the child elements are optional. Require one child element.

...

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%
<continue>
Column
Causes script execution to return to the beginning of the nearest enclosing loop element.
Section
Column
width20%
<else>
Column
Contains a block of code to be executed when a condition 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>

...