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

Receiving Multiple Events

An Event Choice node group represents a point in a business process at which the business process waits to receive one of a possible number of events. Once it receives one of the possible events, the flow of the business process continues. You design other nodes within an Event Choice node group to handle the incoming events. The first node on each branch of an Event Choice node group handles the receipt of one event. The flow of execution proceeds along one branch in an Event Choice node; the branch containing the event that happens first.

If an Event Choice node is used to start a business process, it can contain Client Request, Client Request with Return, and Subscription nodes. An Event Choice node at a point other than the Start node in a business process can contain Client Request nodes and Control Receive nodes.

To learn about designing an Event Choice node at the Start of your business process, see Designing Start Nodes.

Note: The Timer branch of an Event Choice node is not available when the node group is used as the Starting Event of a business process. To do timed starts of a process, you have to use a Message Broker subscription in tandem with a Timer event generator. For more information about Message Broker subscriptions and Timer event generators, see Using Integration Controls.

This section describes how to design Event Choice nodes at points in your business process other than the Start node. It contains the following topics:

 


Create an Event Choice Node in Your Business Process

Create an Event Choice node at a point in a business process at which the business process should wait to receive multiple events. The events can include:

To support these types of events, the first node on a branch can be a Client Request, a Control Receive, or a Timer node. The flow of execution proceeds along one branch in an Event Choice node; the branch containing the event that happens first.

To create an Event Choice node:

  1. On the Package Explorer pane, click the business process (Process.java file) you want to design.Your business process is displayed in the Design view.
  2. If the Node Palette is not visible in BEA WorkSpace Studio, choose Window > Show View > Node Palette from the BEA WorkSpace Studio menu.
  3. Click Time Branch Property Event Choice in the Node Palette. Then drag and drop it onto the business process in the Design view, placing it on the business process at the point in your business process where you want to handle the receipt of multiple events.
  4. The Design view is updated to contain a representation of the Event Choice node as shown in Figure 6-1.

    Figure 6-1 Event Choice Node


    Event Choice Node

    Note the following characteristics of the Event Choice node:

    • An Event Choice node is, in effect, a group of nodes. You can view and edit the properties of your Event Choice node by clicking the outline or label (name) of the group to select it, then viewing the group properties in the Properties pane. To learn about groups, see Grouping Nodes in Your Business Process.
    • By default, Event Choice nodes are created with two branches. Click Event Choice Node to create additional branches. A new branch is added on the left or right of the existing branches.
    • You can add additional nodes to the paths in your Event Choice group to specify the events executed at run time. The empty nodes (labeled Start Event) at the start of each branch indicate that only certain nodes are allowed at these locations: specifically, you can add only Client Request or Control Receive nodes at the start of the branches.
    • A Timer branch is not included by default. You can add one Timer branch to your Event Choice group. To do so, right-click the Event Choice group and select Add Timer Branch—a Timer branch is added as the right-most branch in an Event Choice group. You can only add one Timer branch per Event Choice group.
    • Note: The Timer branch of an Event Choice node is not available when the node group is used as the Start Event of a business process. To do timed starts of a process, you have to use a Message Broker subscription in tandem with a Timer event generator. For more information about Message Broker subsrciptions and Timer event generators, see Using Integration Controls.
    • By default, the group is named Event Choice, and each branch is labeled Message Event, Add Branch, or Timer Event depending on the type of branch. You can change the names by double-clicking them and entering a new name.
    • Event Choice Node indicates that the design of this node is incomplete. When you complete the design of the node, Event Choice Node is replaced by Event Choice Node. An Event Choice node is complete when all starting events have been specified.
  5. To save your work, select FileArrow symbol> Save.

 


Design Your Event Choice Group

Designing your Event Choice node includes specifying the type of events handled on each branch of the node, and then adding the activities you want executed on each branch when the associated event occurs.

The following sections describe how to complete the tasks necessary to design an Event Choice node:

To Receive Events From Clients or Resources

To design a branch in an Event Choice node to receive messages from clients or resources, you must create Client Request or Control Receive nodes on the branch:

  1. Double-click the empty node (Start Event) on a branch. The options you can use to design the starting event for the branch are displayed.
  2. Select the event for which this branch waits during execution of your business process:
    • A Client Request
    • A Control Receive
  3. Click Close. The drop target on your Event Choice branch is changed to reflect the event you specified.
  4. To complete the specification of events, double-click the starting event node (Client Request or Control Receive) on the Event Choice branches to invoke the associated node builder:
To Receive Timer Events

A Timer event in a Event Choice node is executed if one of the events on another branch (Control Receive or Client Request) does not execute before a specified time. To create a Timer branch, and specify the timer value, in your Event Choice node, complete the following tasks:

  1. Right-click the Event Choice node and select Add Timer Branch from the drop-down menu.
  2. A Timer branch, similar to the one shown in Figure 6-2, is added to the Event Choice node:

    Figure 6-2 Time Branch


    Time Branch

  3. You can set the properties for the Timer branch (and other properties for this group of nodes) in the Properties pane.
    1. If the JPD Configuration pane is not visible in the Design view, choose WindowArrow symbol>Arrow symbolShow ViewArrow symbol>Arrow symbolJPD Configuration from the BEA WorkSpace Studio menu.
    2. Select the Timer branch. The JPD Configuration pane for the Event Choice node appears as shown in Figure 6-3.
    3. Figure 6-3 Time Branch Property


      Time Branch Property

    4. In the timeout property, select the duration attribute, then specify the number of seconds before the timer path is triggered. (The expected format is Xs, for example 7s.)
    5. Note that you can change the name of the node, or any of its branches in the Property Editor.

  4. To save your work, select File > Save.

  Back to Top       Previous  Next