TOP

exists

Description

Check if there is at least one element of the collection that satisfies the nested condition. Iterate over the selected objects and verify that there is at least one among them, that satisfies the nested condition.
Note:
 <exists property="name"> 
 
 is a shortcut of
 
   <exists>
     <propertSelector property="name"/>
 
If no selectors specified, it iterates on the value of "this" property

Implementation class

net.mdatools.modelant.util.condition.ExistsCondition

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:
Any ANT or ModelANT standard condition to satisfy. See ANT Types for more details. Choose among:
Element Description
evaluate Evaluate the condition in the environment defined from the outer current environment and the result of the execution of the tasks provided. Note that this makes possible the use of expressions and calculations in the conditions, that are dynamically evaluated (in contrast to ANT), for example in for, select, exists or any other
 Usage:
     <evaluate>
       <tasks>
         define some properties
       </tasks>
       
       a condition using the properties defined in the tasks section
     </evaluate>
     
     The tasks are optional 
 
exists Check if there is at least one element of the collection that satisfies the nested condition. Iterate over the selected objects and verify that there is at least one among them, that satisfies the nested condition.
Note:
 <exists property="name"> 
 
 is a shortcut of
 
   <exists>
     <propertSelector property="name"/>
 
If no selectors specified, it iterates on the value of "this" property
for.each Check if each element of the collection satisfies the nested condition. Iterate over the selected objects and verify that all of them satisfy the nested condition.
Note:
 <for.each property="name"> 
 
 is a shortcut of
 
   <for.each>
     <propertSelector property="name"/>
 
If no selectors specified, it iterates on the value of "this" property
isempty Check if the object to test is null, an empty list or an empty string. This class is a condition checking if a property in the current environment is to an empty value, meaning NULL, an Empty String, an empty collection or an empty array.
isequal Check if the object to test equals to the condition's parameter. Check if the object value of one property is equal to the object value of another property. The comparison is held as of Java objects, by calling their equals() method. Two properties that have no value/they are not defined. are treated as equal.
isin Check if the collection to test contains another value. This class is a condition checking if a property in the current environment is bound to an object among the objects listed in the property provided in list task attribute.
isinstanceof Check if a model element is of a meta-model class.
method.condition Call a boolean method on a Java object and use it as a condition Call the boolean method with the name and parameters provided on the named object.
uml13.issubclass A condition to check if a model class is a subclass of another model class This condition checks if a model class, specified in the 'property' attribute is a subclass of another one.
wrap.condition Wrap the model element this is invoked for and invoke the specified boolean method on the wrapper, integrating it with the regular ANT conditions.

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