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.
In the Design view, drag the Pick element from the Palette to the diagram.
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.
From the Palette, drag the activity that will be executed and place it inside the On Message branch. Configure the activity's properties.
(Optional) Add more On Message branches by choosing Add -> On Message from the pop-up menu and configure them as described above.
(Optional) Add one or more On Alarm branches following the procedure below.
Right-click the Pick element and choose Add -> On Alarm from the pop-up menu.
Configure the timer via the Properties window, invoked by right-clicking the element and choosing Properties. The available options are:
Alarm Type: Specifies 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.
Documentation: User documentation attached to the element. This documentation is included with the source code of the BPEL process and can be extracted and included in a report.
Find the activity you want executed after the time expires, and drag it from the Palette to the placeholder inside the On Alarm element.
(Optional) Add one or more On Alarm branches as described above.
The Properties window for the Pick element, invoked by right-clicking the element and choosing Properties, includes the following fields:
Create Instance: If set to yes, a new process instance will be created when the specified event occurs. If you do not plan to start a new process instance, keep the default N/A value.
Name: Specifies the name of the For Each element.
Documentation: User documentation attached to the element. This documentation is included with the source code of the BPEL process and can be extracted and included in a report.