Creating a Loop

You can create a loop to iterate through a complex activity.

To create a loop:

  1. Build a complex activity in your business process.

  2. Select the complex activity to see its properties.

    Its activities appear either in the Properties section of the Business Process Logic Page or the Properties Panel view.

  3. Select the Iteration Settings tab.

  4. Select This activity runs iteratively.

    This allows you to create a loop.

  5. (Optional) The Counter variable, Counter initial value, and Counter increment values are all optional. If the Counter variable is set, the loop automatically increments the counter variable by one at the bottom of each loop. If you want to increment by a different amount or if you want to decrement, then the Counter increment must be set. The Counter initial value allows the Counter variable to initialize before loop execution.

    To populate the Counter variable:

    1. In Properties, click Ellipse box in the Counter variable field.

      The Variable Reference Dialog appears.

    2. Select the variable that you want to use and click OK.

      Note

      You can also use drag and drop to populate the variable. Expand the Variables section and drag the variable that you want to use and drop it in the Counter variable field.

    To populate the Counter initial variable and the Counter increment variable:

    1. In Properties, click Ellipse box in either the Counter initial or Counter increment field, whichever you are populating.

      The Variable Reference Dialog appears.

    2. Do one of the following:

      • Select Variable, select the variable that you want to use, and click OK.

      • Select Literal, enter the value in the Literal field, and click OK.

  6. Define a rule for the loop.

    You must define a rule for loop evaluation. The loop executes as long as the rule evaluates to true. Usually, a counter variable is used in the rule for the loop; however, this is not required. Any rule that evaluates to either true or to false is supported.

  7. To complete the flow of the business process logic inside the loop:

    1. Maximize the complex activity.

    2. Add the activities from the Tool Palette that complete the logic.

    3. Connect the activities to determine the flow of execution.

Acting on Repeating Elements in Data

Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com