adapter-tutorial13 - using bpel correlation sets - file adapter midprocess receive
TRANSCRIPT
-
7/23/2019 Adapter-Tutorial13 - Using BPEL Correlation Sets - File Adapter Midprocess Receive
1/15
Reference: 2005/04/26
Adapter Tutorial
Tutorial 13 : Using BPEL correlation sets File Adapter mid-process receive
The Oracle Adapter for Files rapidly integrates information stored in a variety of formats and supports both FilRead 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 responsereceived 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 simplinvoke-receive activities. This example illustrates how to use BPEL correlation sets for a process having mid-
process receive activity and no associated invoke activity.
1. Tutorial 13 : Using BPEL correlation sets File Adapter mid-process 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 theEclipse IDE as well.
2. Launch JDeveloper. This is bundled with the BPEL Process Manager product.
3. Drag & drop an empty BPEL project
4. Drag & drop a Partner Linkactivity.5. Select the Adapter Wizard (no 3) option.
6. Select the File Adapteroption
7. Follow the Adapter wizard screens as shown in the below figures:
-
7/23/2019 Adapter-Tutorial13 - Using BPEL Correlation Sets - File Adapter Midprocess Receive
2/15
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 refersto the time interval that needs to be elapsed post the last modified timestamp before the file can bepicked 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.
-
7/23/2019 Adapter-Tutorial13 - Using BPEL Correlation Sets - File Adapter Midprocess Receive
3/15
15. This completes the creation of the Adapter Service. Complete the Partner Link as shown below:
Configuring the 2ndFile Adapter Read Service
16. Name the Adapter Service
17. The File operation must have a unique name for the BPEL correlation to work
-
7/23/2019 Adapter-Tutorial13 - Using BPEL Correlation Sets - File Adapter Midprocess Receive
4/15
18. The next steps show the configuration of the 2nd
File Adapter Service.
19. Complete the Partner Linkactivity as shown in the below figure:
-
7/23/2019 Adapter-Tutorial13 - Using BPEL Correlation Sets - File Adapter Midprocess Receive
5/15
Configuration of 3rdFile 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.
-
7/23/2019 Adapter-Tutorial13 - Using BPEL Correlation Sets - File Adapter Midprocess Receive
6/15
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
-
7/23/2019 Adapter-Tutorial13 - Using BPEL Correlation Sets - File Adapter Midprocess Receive
7/15
23. Select create Instance option for the 1streceive activity and select the auto-generation option for the
global variables.
Defining correlation sets
24. The 1stand the 2
nd receive activities are correlated by the Name parameter which is a String. The 2
n
and 3rd
receive activities are correlated by the ID parameter which is a double. Select the
Correlationstab of the receive activity. Select Addoption. This brings up the Correlation SetChooser wizard. Select Correlation Setsfolder and then Createoption. This brings up the Create
Correlation Setpop-up wizard. Name the Correlation Set CorrelationSet_1.Select the Add button toadd the properties that make up CorrelationSet_1.
25. Create a PropertyNameCorr of type String.
-
7/23/2019 Adapter-Tutorial13 - Using BPEL Correlation Sets - File Adapter Midprocess Receive
8/15
-
7/23/2019 Adapter-Tutorial13 - Using BPEL Correlation Sets - File Adapter Midprocess Receive
9/15
26. The Intiateflag is set to yesfor CorrelationSet_1as the CorrelationSet_1is set at the 1streceive
activity.
27. Similarly, create CorrelationSet_2for Property-IDCorrof type Double for the 2nd
receive activity.
The Initiate flag is set to yesfor the CorrelationSet_2as the values for this Correlation Set are set atthe 2
ndreceive activity. In addition, select the CorrelationSet_1to match the 1
stand 2
ndreceive
activities. The Initiateflag is set to no for the CorrelationSet_1as the values for this Correlation Set
are set at the 1streceive activity. The Correlation Set configuration for the 2
ndreceive activity are show
in the below figure.
28. Select CorrelationSet-2to match the 2nd
and 3rd
receive activities. The Initiateflag is set to no forthe CorrelationSet_2as the values for this Correlation Set are set at the 2
ndreceive 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 PropertyAliasesfolder found in the Structure Paneof the BPEL Designer for doing theabove. Right-click and select create.
-
7/23/2019 Adapter-Tutorial13 - Using BPEL Correlation Sets - File Adapter Midprocess Receive
10/15
30. SelectNameCorr Property and map it to the LoanAppl_msg of the 1stReceive activity Initiating
Receive. The Intiating Receive activity is tied to the Partner Link defined byFirstReceive.wsdl
31. Use the Query Pane to define an XPATH expression to navigate to the right attribute .
-
7/23/2019 Adapter-Tutorial13 - Using BPEL Correlation Sets - File Adapter Midprocess Receive
11/15
32. TheNameCorrmust also be mapped to the incoming message of the 2nd
receive activity defined by thePartner Link SecondFileRead.wsdl.Hence this requires creation of a second Property Alias.
-
7/23/2019 Adapter-Tutorial13 - Using BPEL Correlation Sets - File Adapter Midprocess Receive
12/15
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.
-
7/23/2019 Adapter-Tutorial13 - Using BPEL Correlation Sets - File Adapter Midprocess Receive
13/15
35. The Correlation Set Properties are referenced by the process WSDL -MidProcessReceive.wsdl and
theProperty Aliasesare also captured in this WSDL by the BPEL Designer.
-
7/23/2019 Adapter-Tutorial13 - Using BPEL Correlation Sets - File Adapter Midprocess Receive
14/15
36. TheMidProcessReceive.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 theMidProcessReceive.wsdlinside theFirstReceive.wsdlto 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:
-
7/23/2019 Adapter-Tutorial13 - Using BPEL Correlation Sets - File Adapter Midprocess Receive
15/15