Você está na página 1de 15

Reference: 2005/04/26

Adapter Tutorial
Tutorial 13 : Using BPEL correlation sets File Adapter midprocess receive
The Oracle Adapter for Files rapidly integrates information stored in a variety of formats and supports both File
Read and Write operations. Correlation sets are a BPEL mechanism that provides for the correlation of
asynchronous messages based on message body contents. When an asynchronous service is initiated with the
invoke activity, a correlation ID unique to the client request is sent (using WS Addressing) and the response
received is mapped to the appropriate request by the Oracle BPEL Server based on the correlation id. The
correlation between request and response is automatically taken care of by WS Addressing by the BPEL server
and no extra step is required. However, correlation sets needs to be defined when the interactions are not simple
invoke-receive activities. This example illustrates how to use BPEL correlation sets for a process having midprocess receive activity and no associated invoke activity.

1.

Tutorial 13 : Using BPEL correlation sets File Adapter midprocess receive 1

Overview
Configuring the File Adapter Read Operations
Configuring the 2nd File Adapter Read Service
Configuration of 3rd File Adapter Read Service
Configuring receive activities
Defining correlation sets

Overview
The example process consists of multiple file receive scenarios including a mid-process receive.

Configuring the File Adapter Read Operations


The Oracle Adapters have an easy-to-use Adapter Wizard that is supported on both JDeveloper and Eclipse
platforms. This example showcases the steps for the JDeveloper IDE and is pretty much the same for the
Eclipse IDE as well.

2.
3.
4.
5.
6.
7.

Launch JDeveloper. This is bundled with the BPEL Process Manager product.
Drag & drop an empty BPEL project
Drag & drop a Partner Link activity.
Select the Adapter Wizard (no 3) option.
Select the File Adapter option
Follow the Adapter wizard screens as shown in the below figures:

1
1
3
5
6
7

8. Name the Adapter Service

9. Select the Read File option in the next screen

10. Enter the Input directory information and the file pattern matching options as shown in the below figure:
11.

12.
13. Enter the polling interval and the time when the file should be picked up. The Minium File Age refers
to the time interval that needs to be elapsed post the last modified timestamp before the file can be
picked up by the Adapter for processing.This enables a large file to be completely copied into the
directory before it is retrieved for processing. .

14. Select an appropriate XSD. These steps are captured in the screen shots below.

15. This completes the creation of the Adapter Service. Complete the Partner Link as shown below:

Configuring the 2nd File Adapter Read Service


16. Name the Adapter Service

17. The File operation must have a unique name for the BPEL correlation to work

18. The next steps show the configuration of the 2nd File Adapter Service.

19. Complete the Partner Link activity as shown in the below figure:

Configuration of 3rd File Adapter Read Service


20. The following screen shots show the steps for creating the 3rd File Adapter Read Service. The Service
and the Operation names must be unique.

21. Complete the configuration of the Partner Link service as shown in the figure.

Configuring receive activities


22. Configure 3 receive activities to point to the 3 File Adapter Read Services as shown below

23. Select create Instance option for the 1st receive activity and select the auto-generation option for the
global variables.

Defining correlation sets


24. The 1st and the 2nd receive activities are correlated by the Name parameter which is a String. The 2nd
and 3rd receive activities are correlated by the ID parameter which is a double. Select the
Correlations tab of the receive activity. Select Add option. This brings up the Correlation Set
Chooser wizard. Select Correlation Sets folder and then Create option. This brings up the Create
Correlation Set pop-up wizard. Name the Correlation Set CorrelationSet_1. Select the Add button to
add the properties that make up CorrelationSet_1.
25. Create a Property NameCorr of type String.

26.

The Intiate flag is set to yes for CorrelationSet_1 as the CorrelationSet_1 is set at the 1st receive
activity.

27. Similarly, create CorrelationSet_2 for Property - IDCorr of type Double for the 2nd receive activity.
The Initiate flag is set to yes for the CorrelationSet_2 as the values for this Correlation Set are set at
the 2nd receive activity. In addition, select the CorrelationSet_1 to match the 1st and 2nd receive
activities. The Initiate flag is set to no for the CorrelationSet_1 as the values for this Correlation Set
are set at the 1st receive activity. The Correlation Set configuration for the 2nd receive activity are shown
in the below figure.

28. Select CorrelationSet-2 to match the 2nd and 3rd receive activities. The Initiate flag is set to no for
the CorrelationSet_2 as the values for this Correlation Set are set at the 2nd receive activity. The
Correlation Set configuration for the 3rd receive activity are shown in the below figure.

29. The Correlation Properties have to be set based on the incoming messages at the receive activity.
Navigate to the Property Aliases folder found in the Structure Pane of the BPEL Designer for doing the
above. Right-click and select create.

30. Select NameCorr Property and map it to the LoanAppl_msg of the 1st Receive activity Initiating
Receive. The Intiating Receive activity is tied to the Partner Link defined by FirstReceive.wsdl

31. Use the Query Pane to define an XPATH expression to navigate to the right attribute .

32. The NameCorr must also be mapped to the incoming message of the 2nd receive activity defined by the
Partner Link SecondFileRead.wsdl. Hence this requires creation of a second Property Alias.

33. Similarly define 2 more Property Aliases for the IDCorr Property and point it to the WSDLs associated
with the 2nd and 3rd receive activites. These steps are shown in the figure below.

34. The Correlation Set Properties are defined in a separate WSDL and are automatically generated by
the BPEL Designer.

35. The Correlation Set Properties are referenced by the process WSDL - MidProcessReceive.wsdl and
the Property Aliases are also captured in this WSDL by the BPEL Designer.

36. The MidProcessReceive.wsdl is not referenced in the BPEL process as the BPEL process is not
modelled as a Web Service Provider in this example. Hence we need to import the
MidProcessReceive.wsdl inside the FirstReceive.wsdl to reference the Correlation Sets defined in the
former WSDL. This is captured in the following figure.

37. The end to end BPEL process is shown below:

Você também pode gostar