This documentation is for WSO2 Enterprise Integrator version 6.5.0 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

All docs This doc
||
Skip to end of metadata
Go to start of metadata

Objective

This sample explains the functionality of <repeatUntil/> construct, where the repetitive task should be executed at least once. This functionality also can be achieved via <while/>, although the way the logical condition is used in both cases differs.

Deploying the Sample

WSO2 BPS provides a sample, which can be deployed and executed to understand the constructs. Follow the instructions below to deploy and trigger the process.

1. Log in into BPS server management console and select "Processes -> Add" under the "Main" menu.

2. Upload the <EI_HOME>/samples/business-process/bpel/RepeatUntil.zip directory. 

3. In the "Deployed Processes" window, click the "Process ID" to access its "Process Information" window.

4. Under the "WSDL Details" widget, trigger the process using the "TryIt" link to create an instance of it.

Example Usage

Refer RepeatUntil.zip. In its example usage of the repeatUntil construct, the counter variable is incremented until it's equal to 10 as follows:

<repeatUntilname="RepeatUntil">
   <assignvalidate="no"name="IncrementCounter">
      <copy>
          <from><![CDATA[$counter + 1]]></from>
          <tovariable="counter"></to>
      </copy>
   </assign>
   <condition><![CDATA[$counter >= 10]]></condition>
</repeatUntil>

Note that the logical condition used to implement the same in <while/> construct is exactly the negation used in <repeatUntil/>.

<whilename="While">
   <condition><![CDATA[$counter < 10]]></condition>
   <assignvalidate="no"name="IncrementInput">
      <copy>
         <from><![CDATA[$counter + 1]]></from>
         <tovariable="counter"></to>
      </copy>
   </assign>
</while>
  • No labels