Wednesday, March 19, 2008

JDeveloper 11g and SOA Suite 11g integration

On my blog you can find application I have developed previously - Invoking BPEL Process from Oracle ADF Application. Application described in my previous post is developed with JDeveloper 10.1.3.x, BPEL process with parameters is invoked here, however I don't return any parameters back to ADF application from BPEL process. Today I have developed new application based on JDeveloper 11g TP3 and SOA Suite 11g TP, where a set of parameters is accepted and returned by BPEL process from and to ADF application.

Sample application for this blog post is based on two parts - SOAComposite.zip and SalaryUpdate.zip. First part contains a simple BPEL process that accepts and returns a set of parameters. Second part is ADF application that invokes BPEL process, receives result from BPEL process and stores this result into database. I'm using HR schema for this sample, you can find this schema in Oracle XE database.

In order to run developed sample application, you need to configure JDeveloper 11g TP3 according to instructions available on this page - Oracle SOA Suite 11g - Technology Preview. Just follow install instructions and it will work. May be also this Oracle SOA Suite 11g Technology Preview - Configuration Hint will be useful.

SOA part in developed sample application is relatively simple, it contains one BPEL process:


This BPEL process accepts input parameters, performs some calculations and returns updated parameters:


Since there are three parameters - EmployeeID, SalaryValue and CompensationValue, updateSalary Assign activity implements Copy operation and provides values for process output:


However, one of the parameters isn't just copied, but modified - SalaryValue is increased by 100:


If we will test developed BPEL process and will provide 5300 as a value for SalaryValue parameter:


Generated result will have 5400 for SalaryValue parameter:


Now let's talk about a second part - ADF application. Here I have created Web Service Data Control based on WSDL for BPEL process:


As a result, I got a possibility to invoke BPEL process and to have a Data Control for returned parameters:


BPEL process invocation is defined in Page Definition file:


I'm accessing results returned from BPEL process through accessorIterator, this iterator is binded to methodIterator which is related to BPEL process invocation definition. accessorIterator and methodIterator definitions:


And finally, all fun stuff is done in Backing bean method associated with Update button:


In this method I'm invoking BPEL process, retrieving returned result from accessorIterator and storing updated value into database.

How it works? Let's say we select employee with STOBIAS email and press Update button:


Salary value is updated by 100:

No comments:

Post a Comment