简体   繁体   中英

WSO2 ESB - Iterator / Loop

Is it possible to Iterate through the elements of the xml file and call the sequence for each iteration without a send mediator within the Iterator. [Similar to Iterator Mediator without Send Mediator within it]

XML File:

<?xml version="1.0" encoding="UTF-8"?><Files><File>testValue1</File><File>testValue2</File></Files>

Expected Iterator:

   <iterate xmlns:ns="http://org.apache.synapse/xsd" expression="$ctx:test//File" id="UTMIterator" sequential="true">
      <target>
         <sequence>
            <property name="InsideSeq1" expression="//File"></property>
                <class name="samples.mediators.SimpleClassMediator">
                   <property name="varible1" expression="$ctx:InsideSeq1"/>
               </class>
            <log level="custom">
               <property name="text" value="***** Inside Iterator *****"></property>
            </log>
         </sequence>
      </target>
   </iterate>

Sample:

    <iterate xmlns:ns="org.apache.synapse/xsd"; expression="$ctx:test//File" id="UTMIterator" sequential="true">
<target>
 <sequence>
    <log level="custom">
      <property name="text" value="***** Inside Iterator **"></property>
      <property name="InsideSeq1" expression="//File"></property>
      <property name="text" value="** Inside Iterator *****"></property>
    </log>
 </sequence>
</target>
</iterate>

Note: Iterating the xml without the send mediator.

Any suggestion?

Yes you can. It is not a must to have send mediator.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM