Loop Condition

The new compound condition Loop is similar to the condition And in that it evaluates its sub-conditions as long as they evaluate to true. However, unlike the And condition, it doesn't stop once all conditions have been evaluated. Instead, the Loop condition starts over again and repeatedly evaluates its sub-conditions and stops only when a condition evaluates to false. Of course this only makes sense if at least one sub-condition has side-effects by using the SaveAs tag, otherwise it would loop forever once all sub-conditions have returned true on the first pass.

Example

This example is taken from the Flex/AMF3 project type and shows how the page timer name is assembled from the response body.

<Conditions>
  <Exists>
    <ApplyTo>Http.Initial.Request.Body</ApplyTo>
    <SaveAs>RestOfBody</SaveAs>
    <SaveMode>Replace</SaveMode>
  </Exists>
  <Loop>
    <RegExpr>
      <ApplyTo>RestOfBody</ApplyTo>
      <Data>operation=&amp;quot;\([^&amp;quot;]*\)</Data>
      <SaveAs>operation</SaveAs>
      <SaveMode>Replace</SaveMode>
      <SaveTag>1</SaveTag>
    </RegExpr>
    <RegExpr>
      <ApplyTo>RestOfBody</ApplyTo>
      <Data>operation=&amp;quot;\([^&amp;quot;]*\)</Data>
      <SaveAs>RestOfBody</SaveAs>
      <SaveMode>Replace</SaveMode>
      <SaveWhat>Right</SaveWhat>
    </RegExpr>
    <Exists>
      <ApplyTo>Literal:, </ApplyTo>
      <SaveAs>OperationList</SaveAs>
      <SaveMode>AppendSeparator</SaveMode>
    </Exists>
    <Loop>
      <FindData>
        <ApplyTo>operation</ApplyTo>
        <Data>.</Data>
        <SaveAs>operation</SaveAs>
        <SaveMode>Replace</SaveMode>
        <SaveWhat>Right</SaveWhat>
      </FindData>
    </Loop>
    <Exists>
      <ApplyTo>operation</ApplyTo>
      <SaveAs>OperationList</SaveAs>
      <SaveMode>Append</SaveMode>
    </Exists>
  </Loop>
  <Exists>
    <ApplyTo>OperationList</ApplyTo>
    <SaveAs>PageName</SaveAs>
    <SaveMode>Replace</SaveMode>
  </Exists>
</Conditions>