×
Menu
Index

LoopNode

 
 

Introduction

A LoopNode iterates over the Elements as mentioned in Path. So if you want to execute a number of Tools for each element with a certain name, you can use a LoopNode.
 

Path

This is the element that should be used to iterate over.
 
Tip!
You can use a joker in Path. For example ./* iterates over all childnodes of the current node.
 

Loop type

A LoopNode can iterate over complex types as wel as over simple types. If you chose Complex Type, then all Tools below the LoopNode will be executed for each found Path.
 
Example:
 
Input XML:
 
<ImportDemo>
     <Policy>
          <PolicyNumber>845784</PolicyNumber>
          <CustomerNumber>69866</CustomerNumber>
          <CustomerName>John Tapscott</CustomerName>
          <CustomerAdress>1362 Steele Street</CustomerAdress>
          <Zipcode>60187</Zipcode>
          <City>Wheaton</City>
          <E-mailaddress>jtapscott@softrules.com</E-mailaddress>
          <Startdate>2005/6/30</Startdate>
          <Premium>343.12</Premium>
          <Licence>43SR22</Licence>
     </Policy>
     <Policy>
          <PolicyNumber>934232</PolicyNumber>
          <CustomerNumber>38763</CustomerNumber>
          <CustomerName>Brigette Shane</CustomerName>
          <CustomerAdress>1000 Ashton Lane</CustomerAdress>
          <Zipcode>78753</Zipcode>
          <City>Austin</City>
          <E-mailaddress>bshane@comparity.nl</E-mailaddress>
          <Startdate>2001/11/28</Startdate>
          <Premium>451.76</Premium>
          <License>CP4188</License>
     </Policy>
     <Policy>
          <PolicyNumber>172557</PolicyNumber>
          <CustomerNumber>26526</CustomerNumber>
          <CustomerName>Gertrude Jenkins</CustomerName>
          <CustomerAdress>1500 Raver Croft Drive</CustomerAdress>
          <Zipcode>TN 37929</Zipcode>
          <City>Knoxville</City>
          <E-mailaddress>gjenkins@volmachtpremies.nl</E-mailaddress>
          <Startdate>2008/1/15</Startdate>
          <Premium>264.33</Premium>
          <License>3357VP</License>
     </Policy>
</ImportDemo>
 
Loopnode:
Path nodes (complex types).
Path:  ImportDemo/Policy
Tool: Assignment Premium += 10
 
Output XML:
<ImportDemo>
     <Policy>
          <PolicyNumber>845784</PolicyNumber>
          <CustomerNumber>69866</CustomerNumber>
          <CustomerName>John Tapscott</CustomerName>
          <CustomerAdress>1362 Steele Street</CustomerAdress>
          <Zipcode>60187</Zipcode>
          <City>Wheaton</City>
          <E-mailaddress>jtapscott@softrules.com</E-mailaddress>
          <Startdate>2005/6/30</Startdate>
          <Premium>353.12</Premium>
          <Licence>43SR22</Licence>
     </Policy>
     <Policy>
          <PolicyNumber>934232</PolicyNumber>
          <CustomerNumber>38763</CustomerNumber>
          <CustomerName>Brigette Shane</CustomerName>
          <CustomerAdress>1000 Ashton Lane</CustomerAdress>
          <Zipcode>78753</Zipcode>
          <City>Austin</City>
          <E-mailaddress>bshane@comparity.nl</E-mailaddress>
          <Startdate>2001/11/28</Startdate>
          <Premium>461.76</Premium>
          <License>CP4188</License>
     </Policy>
     <Policy>
          <PolicyNumber>172557</PolicyNumber>
          <CustomerNumber>26526</CustomerNumber>
          <CustomerName>Gertrude Jenkins</CustomerName>
          <CustomerAdress>1500 Raver Croft Drive</CustomerAdress>
          <Zipcode>TN 37929</Zipcode>
          <City>Knoxville</City>
          <E-mailaddress>gjenkins@volmachtpremies.nl</E-mailaddress>
          <Startdate>2008/1/15</Startdate>
          <Premium>274.33</Premium>
          <License>3357VP</License>
     </Policy>
</ImportDemo>
 
A LoopNode can also be used with Simple Types. In that case each value of a matching Simple Type will be stored in the element (or variable) as mentioned in Store each element value in. Each name of a matching Simple Type will be stored in the element (or variable) as mentioned in Store each element name in.
 

Source from input XML

If you check this the source for the LoopNode is te Input XML document (otherwise the Ouput XML document will be used).
 

Reverse loop

If you check this the looping will be done in reversed order. This is handy if you have to delete elements from the list.
 

Stopcondition

Doubleclick here to enter the Condition at which you want to stop (or break) the loop.
 

Category

See here.