2.6.2.2 ExecutableType Instance for ForEachLoop

ForEach executable defines a repeating control flow in a package. The loop implementation is similar to a ForEach looping structure in programming languages. An executable is a ForEach executable if the ExecutableType attribute value is "STOCK:FOREACHLOOP".

The ForEach executable is formally defined to be of type AnyNonPackageExecutableType. However, the following XSD fragment, which is expressed as an anonymous complex type declaration, places further restrictions on the type than the restrictions that are declared in the AnyNonPackageExecutableType type declaration. An Executable element with the ExecutableType attribute value equal to "STOCK:FOREACHLOOP" MUST follow the anonymous type declaration that is contained in this section.

Note the following differences between this anonymous complex type declaration and the full definition of the complex type for the AnyNonPackageExecutableType type.

  • This Executable element MUST NOT contain an ObjectData element.

  • This Executable element MUST NOT contain the ThreadHint attribute.

  • The allowed values for the Name attribute of the Property element are a restricted subset of the values that are allowed on the type, as specified in the AnyNonPackageExecutablePropertyNameEnum type. Hence, the formal type declaration of the Property element is replaced in this anonymous XSD fragment with an inline union of the Name attribute values that are allowed for the AllExecutablePropertyNameEnum with the additional values that are specified inline in this anonymous type definition. The Name attribute of the Property element MUST be restricted to the values that are shown as valid in the XSD fragment that is contained in this section.

For more information about the elements, attributes, and enumeration values in the following XSD fragment, see section 2.5.

   <xs:complexType>
     <xs:sequence>
       <xs:element name="ForEachEnumerator"
                   type="DTS:ForEachEnumeratorType"
                   minOccurs="1" maxOccurs="unbounded"/>
       <xs:element name="Property"
                   maxOccurs="unbounded">
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="DTS:PropertyElementBaseType">
               <xs:attribute name="Name" use="required">
                 <xs:simpleType>
                   <xs:union memberTypes=
                     "DTS:AllExecutablePropertyNameEnum">
                     <xs:simpleType>
                       <xs:restriction base="xs:string">
                         <xs:enumeration value="MaxConcurrent"/>
                       </xs:restriction>
                     </xs:simpleType>
                   </xs:union>
                 </xs:simpleType>
               </xs:attribute>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
       </xs:element>
       <xs:element name="Variable" type="DTS:VariableType"
                   minOccurs="0" maxOccurs="unbounded"/>
       <xs:element name="LoggingOptions" type="DTS:LoggingOptionsType"/>
       <xs:element name="PropertyExpression"
                   type="DTS:PropertyExpressionElementType"
                   minOccurs="0" maxOccurs="unbounded"/>
       <xs:element name="Executable" type="DTS:AnyNonPackageExecutableType"
                   minOccurs="0" maxOccurs="unbounded"/>
       <xs:element name="ForEachVariableMapping"
                   type="DTS:ForEachVariableMappingType"
                   minOccurs="1" maxOccurs="unbounded"/>
       <xs:element name="PrecedenceConstraint"
                   type="DTS:PrecedenceConstraintType"
                   minOccurs="0" maxOccurs="unbounded"/>
       <xs:element name="EventHandler" type="DTS:EventHandlerType"
                   minOccurs="0" maxOccurs="unbounded"/>
       <xs:choice minOccurs="0" maxOccurs="0">
         <xs:element name="ObjectData"/>
       </xs:choice>
     </xs:sequence>
     <xs:attribute name="ExecutableType" use="required"
                   fixed="STOCK:FOREACHLOOP"/>
   </xs:complexType>