Pick activity is very important in BPEL. We use this activity in following cases.
- When we call asynchronous service and we need response back in certain time frame otherwise we need to throw exception.
- When we want to have multiple entry point for any composite. E.g. when we want our process when it is invoked by client or when any message is put to JMS queue by client.
Pick activity has two branches, OnMessage Branch and OnAlarm Branch which are explained below.
Out of these two branches, only one will execute.
OnMessage is same as Receive activity. It is used when we need to receive message from external system.
OnAlarm branch is used when we want to specify expiry time.