Adding a Single Rule to a Business Process

Use the following example to add a single rule to a business process.

Example Single-rule in a Business Process

An input operation flows into a single rule which divides into two Assigns (true and false). They join up and flow into
an output response operation.

To add a single rule to a business process:

  1. Create a Business Process Service

  2. Define input and output parameters for the business process:

    1. Select the Service Interface tab in the Business Process service editor.

    2. Select the operation on the service interface.

    3. Expand the Operation Parameters section and add the following parameters:

    4. Service Operation Parameter Properties

      NameStyleDatatype

      input

      Input

      string

      output

      Output

      string

    5. Save the service. Select File|Save from the main menu bar.

  3. Select the Business Process tab to display the canvas.

  4. Add Single-rule logic to the business process.

    See Using the Expression Editor for more information.

    1. Click inside the Business Process canvas and then select the Tool Palette using the Fast View shortcut bar.

    2. Select Single-rule from the Logic palette and drag it on to the canvas.

    3. Define the single rule using the following example:

      Example single-rule expression: An input parameter and a constant (test) flows into a concatenation, which is equal to
a constant called abctest.

      1. Select the single-rule on the design canvas.

      2. Expand the Properties view.

      3. Replace the Select Variable in the Expression editor. Drag input from the Interface Variables list in the Business Process Variables section onto the Select Variable.

      4. Right-click inside the Expression editor and select String Functions|concat from the context menu.

      5. Right-click inside the editor again, select Generic Variables and Constants|string constant from the context menu, rename the string constant to test. Then, select the Bind Source Text to Logical Name checkbox in the Properties for the Operation view.

      6. Connect the input operator to the upper input node of the concat operator.

      7. Connect the test operator to the lower input node of the concat operator.

      8. Connect the output node of the concat operator to the is equal to operator.

      9. Rename the final string constant to abctest.

  5. Save the service. Select File|Save from the main menu bar.

  6. Add an Assign activity to the business process:

    1. Drag Assign from the Activities palette and drag it after the Single-rule.

    2. Define the Source and Target variables for the Assign:

      1. Select the Assign activity.

      2. In the Properties panel, click inside the Source column and then click the ellipsis to open the Variable Reference dialog.

      3. Define a literal for the Source. Select Literal and type true in the text box.

      4. Define the operation output parameter as the Target. Drag output from the Interface Variables list in the Business Process Variables section to the Target column in the Properties panel.

    3. Save the service. Select File|Save from the main menu bar.

  7. Add a second Assign activity to the business process:

    1. Drag Assign from the Activities tool palette and drop it after the Single-rule.

    2. Define the Source and Target for the Assign:

      1. Select the Assign activity.

      2. In the Properties panel, click inside the Source column and then click the ellipsis to open the Variable Reference dialog.

      3. Define a literal for the Source. Select Literal and type false in the text box.

      4. Define the operation output parameter as the Target. Drag output from the Interface Variables list in the Business Process Variables section to the Target column in the Properties panel.

    3. Save the service. Select File|Save from the main menu bar.

  8. Add a OR Join activity to the business process:

    1. Drag Join from the Logic tool palette and drop it after the two Assigns.

    2. Select the Join activity in the Properties panel, select OR from the Join Type drop-down list.

  9. On the canvas, move the operation1Response that you created in step 2 after the Join.

  10. Connect the flow of execution, using the example graphic at the introduction of this topic.

  11. Save the service. Select File|Save from the main menu bar.

Building a Complex Activity

Logic Tool Palette

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