In the Component Palette, expand BPEL Constructs. Drag a Pick activity into the designer.

Using Events and Timeouts in BPEL Processes 14-5 Figure 14–4 onAlarm Branch Creation An OnAlarm branch is displayed. 8. Double-click the OnAlarm branch of the pick activity and set its time limit to 1 minute. Figure 14–5 provides an example. Figure 14–5 OnAlarm Branch

9. Click OK.

14.2.2 What Happens When You Create a Pick Activity

The code segment in Example 14–1 defines the pick activity for this operation after design completion: Example 14–1 Pick Activity pick -- receive the result of the remote process -- onMessage partnerLink=LoanService portType=services:LoanServiceCallback operation=onResult variable=loanOffer assign 14-6 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite copy from variable=loanOffer part=payload to variable=output part=payload copy assign onMessage -- wait for one minute, then timesout -- onAlarm for=PT1M assign copy from loanOffer xmlns=http:www.autoloan.comnsautoloan providerNameExpiredproviderName selected type=booleanfalseselected approved type=booleanfalseapproved APR type=double0.0APR loanOffer from to variable=loanOffer part=payload copy assign onAlarm pick

14.2.3 What You May Need to Know About Simultaneous onMessage Branches in BPEL 2.0

Oracle BPEL Process Manager’s implementation of BPEL 2.0 does not support simultaneous onMessage branches of a pick activity. When a process has a pick activity with two onMessage branches as its starting activity both with initiate set to join in their correlation definitions and an invoking process that posts the invocations one after the other, it is assumed that both invocations reach the same instance of the invoked process. However, in Oracle BPEL Process Manager’s implementation of BPEL 2.0, two instances of the invoked process are created for each invocation. This is the expected behavior, but it differs from what is described in the BPEL 2.0 specification. For example, assume you have synchronous BPEL process A, which has a flow activity with two parallel branches: ■ Branch one invokes operation processMessage1 on asynchronous BPEL process B. ■ Branch two invokes operation processMessage2 on asynchronous BPEL process B. The invocation occurs after a five second wait. BPEL process A then waits on a callback from BPEL process B and returns the output back to the client. The idea is to create one instance of the invoked process and ensure that the second invocation happens after the first instance is already active and running. BPEL process B has a pick activity with createInstance set to yes. The pick activity has two onMessage branches within it: ■ One branch is for the processMessage1 operation. For this operation, it goes to sleep for about 10 seconds. ■ The other branch is for the processMessage2 operation. For this operation, it waits for five seconds.