Using the BPEL Designer and Service Engine

Using the Pick Element

The Pick element blocks the process and waits until one of the specified events occurs. After the specific event occurs, the activity associated with this event is performed. The possible events are the arrival of a message or a timer-based alarm. The occurrence of the events is mutually exclusive. If more than one of the events occurs, then the selection of the activity to perform depends on which event occurred first.

The Pick activity provides two branches, On Message and On Alarm. The branch whose condition is satisfied first (i.e. a message is received or the specified timer expires) is executed. When you add a Pick element to your diagram, it automatically includes one On Message statement in which you specify the properties of the message that the process awaits from a partner service. Each Pick element must include at least one On Message statement. The On Alarm branch contains a timer you can use to specify how long the process is to wait.

Usage

  1. In the Design view, drag the Pick element from the Palette to the diagram.

  2. For the On Message branch, configure the properties of the message for which the process is waiting. The configuration is similar to that of the Usage element.

  3. From the Palette, drag the activity that will be executed and place it inside the On Message branch. Configure the activity's properties.

  4. (Optional) Add more On Message branches by choosing Add -> On Message from the pop-up menu and configure them as described above.

  5. (Optional) Add one or more On Alarm branches following the procedure below.

Adding an On Alarm branch

  1. Right-click the Pick element and choose Add -> On Alarm from the pop-up menu.

  2. Configure the timer via the Properties window, invoked by right-clicking the element and choosing Properties. The available options are:

    • Alarm Type — used to choose the type of alarm. The type can be one of the following:

      • For — specifies a duration for the process to wait.

      • Until — specifies a deadline for the process.

    • For/Until — used to configure the deadline or the duration for the chosen alarm type. Click the ellipsis button (...) to specify the time. You can also use the BPEL Mapper.

  3. Find the activity you want executed after the time expires, and drag it from the Palette to the placeholder inside the On Alarm element.

  4. (Optional) Add one or more On Alarm branches as described above.

Pick Element Properties

The Properties window for the Pick element, invoked by right-clicking the element and choosing Properties, includes the following fields:

Pick Properties Window