How to Create a Parallel Flow

9-4 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite query=ns4:orderInfoVOSDOns4:OrderId to variable=lInternalWarehouseInputVariable part=payload query=ns1:WarehouseRequestns1:orderId copy assign invoke name=Invoke_InternalWarehouse inputVariable=lInternalWarehouseInputVariable partnerLink=InternalWarehouseService portType=ns1:InternalWarehouseService operation=process receive name=Receive_InternalWarehouse createInstance=no variable=lInternalWarehouseResponseVariable partnerLink=InternalWarehouseService portType=ns1:InternalWarehouseServiceCallback operation=processResponse assign name=Assign_InterWHResponse bpelx:append bpelx:from variable=lInternalWarehouseResponseVariable part=payload query=ns1:WarehouseResponse bpelx:to variable=gWarehouseQuotes query=ns1:WarehouseList bpelx:append assign sequence sequence name=Sequence_4 assign name=Assign_PartnerRequest copy from variable=gOrderInfoVariable query=ns4:orderInfoVOSDO to variable=lPartnerSupplierInputVariable part=request query=ns4:orderInfoVOSDO copy assign invoke name=Invoke_PartnerSupplier partnerLink=PartnerSupplierMediator portType=ns15:execute_ptt operation=execute inputVariable=lPartnerSupplierInputVariable receive name=Receive_PartnerResponse createInstance=no variable=lPartnerResponseVariable partnerLink=PartnerSupplierMediator portType=ns15:callback_ptt operation=callback assign name=Assign_PartnerWHResponse bpelx:append bpelx:from variable=lPartnerResponseVariable part=callback query=ns1:WarehouseResponse bpelx:to variable=gWarehouseQuotes query=ns1:WarehouseList bpelx:append assign sequence flow Using Parallel Flow in a BPEL Process 9-5

9.2.3 Synchronizing the Execution of Activities in a Flow Activity

You can synchronize the execution of activities within a flow activity to ensure that certain activities only execute after other activities have completed. For example, assume you have an invoke activity, verifyFlight, that is executed in parallel with other invoke activities verifyHotel, verifyCarRental, and scheduleFlight when the flow activity begins. However, scheduling a flight is necessary only after verifying that a flight is available. Therefore, you can add a link between the verifyFlight and scheduleFlight invoke activities. Links provide a level of dependency indicating that the activity that is the target of the link scheduleFlight is only executed if the activity that is the source of the link verifyFlight has completed. Example 9–2 provides details. The link name verifyFlight-To-scheduleFlight is assigned to the source verifyFlight and target scheduleFlight invoke activities. If the source verifyFlight completes execution, the target scheduleFlight is then executed. Example 9–2 Link Between Source and Target Activities flow ... links link name=verifyFlight-To-scheduleFlight links documentation Verify the availability of a flight, hotel, and rental car in parallel documentation invoke name=verifyFlight ... sources source linkName=verifyFlight-To-scheduleFlight sources invoke invoke name=verifyHotel ... invoke name=verifyCarRental ... invoke name=scheduleFlight ... targets target linkName=verifyFlight-To-scheduleFlight targets invoke flow Example 9–2 provides an example of link syntax in BPEL version 2.0. The link syntax between BPEL version 1.1 and BPEL version 2.0 is slightly different. ■ BPEL version 1.1 uses target and source. ■ BPEL version 2.0 uses targets or sources. Table 9–1 provides details.