Skip to content

Iterate

Definition

<iterate iterator="identifier"/>

Iterate over the propositions enumerated in the <iterator>.

Attribute Type Description
iterator string The name of the iterator referenced.

Parents

Children

None

Behaviour

An element will make TDM assume one proposition at a time from the propositions enumerated in the <iterator> referenced. When the iteration is finished, testing the <condition> has_more_items will return false. If iteration continues, the test will return true until iteration is again finished.

Examples

iterate over nice destinations

<iterate iterator="nice_destinations"/>

Examples

iterate over nice destinations

If destination is paris, inform that we'll see the eiffel tower. When the iteration is done, we'll exit the plan.

    <plan>
      <iterate iterator="nice_destinations"/>
      <if>
        <proposition predicate="destination" value="paris"/>
        <then>
          <inform insist="true">
            <proposition predicate="info" value="we'll see the eiffel tower"/>
          </inform>
        </then>
      </if>
      <if>
        <has_more_items iterator="nice_destinations"/>
        <else>
          <signal_action_completion/>
        </else>
      </if>
    </plan>

Last update: May 20, 2022