Example XPath Expression for a Complex Activity with a Loop Condition

Create an expression for a complex activity with a loop condition that verifies whether the local variable counter is equal to the length of the interface variable str1, using the text-based XPath editor.

This example procedure assumes the following are defined in the business process:
  • An interface variable of str1
  • A string-length string function
  • A counter local variable

  1. Right-click on the Business Process canvas to activate the Tool Palette.
  2. Select the Activities tool palette and drag and drop the Complex activity onto the design canvas.
  3. Select the Complex activity on the design canvas.
  4. Define a loop condition:
    1. Open the Properties section and select the Iteration Settings tab.
    2. In the XPath edit box, position the cursor where you want to insert functions or operators.
    3. Right-click and selectString Functions > string-length.
    4. Open the Business Process Variables section, right-click and select Expand to view all the categories.
    5. Drag the str1 interface variable and drop it into the string-length function as an argument.
    6. Drag the counter local variable and drop it at the beginning of the expression in the XPath edit box.
    7. Right-click and select Operators > <=.
  5. Save the business process service.

    The complex activity now runs iteratively until the counter is equal to the length of the str1.

Related tasks
Editing Variables in an XPath Expression
Saving a Code Snippet
Reusing a Code Snippet

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.