TOP

for

Description

Execute the nested tasks in a separate temporary environment for each element described in a Selector Iterate over a selector or resources collection and execute the nested tasks in a separate (local) environment for each of them. This way, any environment changes made by one iteration are released and do not affect the other iterations.
By default it iterates on the value of "this" property Note:
 <for property="name"> 
 
 is a shortcut of
 
   <for>
     <propertSelector property="name"/>
 

Implementation class

net.mdatools.modelant.util.task.IterateTask

Parameters

Attribute Description Type
iterator The name of the property to bind the current list element to check. Default: this String
property This is the name of the property, whose value is expected to be a collection of objects to iterate upon Default: "this" String

Nested elements

Element Description
A single ModelANT selector, that produces a collection to iterate upon. No more than one selector or resource collection set expected. Choose among:
Element Description
allOfMetaclassSelector Selector of all model elements, that are instances of a metaclass
propertySelector Select the collection held as a value of a property. The not defined properties are treated as empty lists, the collection-valued attributes are used to iterate upon, the attributes that have any other than a collection value a returned as a collection of a single element.
ref.get Retrieve an object by its MOF ID or as an associated object or an attribute's value.
search Starting from the selected objects, execute the nested tasks for them and collect the produced results for iteration upon. The iteration ends when all objects are processed and no new objects are put for collected.
Note:
 <search property="name"> 
 
 is a shortcut of
 
   <search>
     <propertSelector property="name"/>
 
If no selectors specified, it iterates on the value of "this" property
select Iterate among the selected objects and collect all those objects that satisfy the nested condition. In an advanced usage form, state the name of the property to collect in the "collect" property and provide nested tasks to set up the value of the "collect" property for each object that satisfies the nested condition.
Note: 
 <select property="name"> 
 
 is a shortcut of
 
   <select>
     <propertSelector property="name"/>
 
If no selectors specified, it iterates on the value of "this" property
uml13.get This get task allows navigation through the UML 1.3 specific associations that are unidirectional in the UML 1.3 meta-model, but are useful in the opposite direction. Supported paths
  • tag = the tag values associated to the model element
  • stereotype = the stereotype assigned to the model element
  • associationEnd = the collection of association ends associated to the model element. Valid only for Classifier instances.
This task and its subclasses could be used also as a selector in iterator, select, search, etc, tasks as it inherits from the general GetTask
A single ANT standard resource collection to iterate upon. See the ANT types for more details. Choose among:
tasks These are tasks to execute in a separate local environment for each object to iterate upon condition and set the property whose values are to be collected. This class collects nested tasks for execution

Nested elements

Element Description
Any task The tasks to execute is a non-null task to collect

Use <typedef resource="net/mdatools/modelant/util/antlib.xml"/>
Documentation generated by ant.doc Ant macro from ModelAnt by MDA Tools