Guide to Building Business Processes

     Previous  Next    Open TOC in new window  Open Index in new window  View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Creating Looping Logic

Frequently, your business logic requires that you create looping logic in your business processes. That is, you need to design logic in your business process in which the activities enclosed in a loop are performed repeatedly while a specific condition is true.

While Do, Do While, and For Each node groups represent such points in your business processes. This section describes how to design looping logic in your business processes. It includes the following topics:

Understanding While Node Groups

Both While Do and Do While node groups support looping logic. Both types of groups represent a point in a business process at which the activities enclosed by the group are performed repeatedly while a specific condition is true. However, While Do and Do While groups represent different execution logic, as described in the following sections:

While Do Node Groups

At run time, the condition on a While Do group is evaluated before the activities in the loop are performed. Therefore, the activities inside While Do groups are performed zero or many times, depending on the results of the evaluation of the condition.

Do While Node Groups

In the case of Do While groups, business process activities are added before the condition in the loop. At run time, the activities defined in a Do While loop are performed; then the condition is evaluated. Therefore, the activities inside a Do While group are performed one or many times, depending on the results of the evaluation of the condition.

Related Topics

Creating While Node Groups in Your Business Process

Designing While Node Groups

Creating While Node Groups in Your Business Process

To Add A While group to Your Business Process
  1. On the Package Explorer pane, click the business process (Process.java file) you want to add the While group node to.Your business process is displayed in the Design View.
  2. If the Node Palette is not visible in BEA Workshop for WebLogic Platform, choose WindowArrow symbolShow ViewArrow symbolNode Palette from the BEA Workshop for WebLogic Platform menu bar.
  3. Determine whether you need While Do or Do While looping logic, and click Collapsed Groups While Do or Collapsed Groups Do While in the Node Palette.
  4. Drag and drop the node group you selected onto the business process, placing it on the business process at the point in your business process at which you want to design a looping logic.
  5. The Design view is updated to contain a representation of the group you selected as shown in Figure 11-1.

    Figure 11-1 While Node Groups


    While Node Groups

Note the following characteristics of the While groups:

Related Topics

Designing While Node Groups

Understanding While Node Groups

Designing While Node Groups

To create logic for your While group, you must complete the following steps:

Design the Condition Logic

Double-click While Node Groups in the While group you want to design the condition logic for.

The node builder is displayed. It allows you to create the condition or conditions that are evaluated at run time by the business process.

Note: The node builder in which you create the conditions for looping is the same as that in which you create conditions on Decision groups. To learn how to design the condition logic for the While group, see To Design the Condition Logic in Defining Conditions For Branching.
Add Activities to the Paths in Your While group

After you define the condition that is evaluated in your While loop at run time, you are ready to define the actions on the loop. To do so, add a node (or nodes) to the path in the While loop. You can add any nodes that perform the activities appropriate for the business logic that you require at this point in your business process.

When you complete the addition of activities on the group, your looping logic is represented by a condition or conditions and a series of business process nodes in the While loop.

You can view and edit the properties of your While group by clicking the outline of the group to select it, then viewing the group properties in the Properties pane.

For any group of nodes in your business process, including While groups, you can collapse the group to save space on the Design View canvas. Collapsed groups appear in the Design view as shown in the following Figure 11-2.

Figure 11-2 Collapsed Groups

Collapsed Groups

To expand the group, click Collapsed Groups.

Related Topics

Defining Conditions For Branching

Looping Through Items in a List

Grouping Nodes in Your Business Process

Handling Exceptions

Adding Message Paths

Adding Timeout Paths


  Back to Top       Previous  Next