This is the 5th of a 5 part series that explains how to expose a database to an Oracle BPM 12c Process using the Oracle SOA Database Adapter and a Mediator. In this, the Composite with the Database Adapter created in part 4 of this series is invoked by the Oracle BPM process using a Service activity.
Part 5 - Invoke the Service Exposed from a Process in the BPM Composite Project
In this part, based on the id field that is entered - you will retrieve the salary and other information about a candidate stored in the database table fed into the BPM process.
Download the BPM Project that will be used to invoke the service from here. (This is a 18.104.22.168 project)
Open the project and open the Candidate Approval process.
To open the BPM Project’s composite diagram, click the icon located in the top right corner of the process model diagram.
Drag the SOAP Web Service component into the External References column in the Composite diagram.
Name the service HRService (1 below) -> click the Find existing WSDLs icon (2) -> select Application Server (3) -> click the dropdown and select the application server (BPM_Compact in this example) (4) -> + expand the composites as shown below until you see the previously deployed HRService service -> +expand the composite labeled HRService [Default…] and select the GetEmployeeById service (5).
Check the copy wsdl and its dependent artifacts into the project checkbox.
Click OK -> OK -> Save.
Reopen the Candidate Approval process. As shown below, create a gap between the Message Start Event and the Script activity and add a Service activity in the sequence flow in this gap.
Name it Retrieve Candidate Information.
Click the Implementation tab -> change the Type dropdown to Service Call -> click the Browse icon -> click HRService -> OK (if you do not see HRService, stop and restart JDeveloper) -> click the Data Associations link.
With the Input tab selected, as shown below drag the employeeIdInput element on the left to employeeId on the right.
Set the outgoing information by clicking the Output tab on the left -> + expand employeeInfo.
On the right, + expand employee -> + expand employeeSummary.
To set the value of the data retrieved from the database table drag the XSL Transformation icon over the employee element.
Select employeeInfo from the list on the left -> click the > icon to move it to the right.
Click OK -> OK -> OK -> Save All.
Drag EmployeeInfo on the left to EmployeeSummary (not EmployeeInfo) to the right.
Click OK when the automap dialog appears. Your XSL transformation should now look like this.
Save the project.
Deploy the EmployeeOnboarding project.
As you did previously in the 4th blog in this series, open Enterprise Manager and test the deployed composite. This time, instead of testing the HRService composite, select the EmployeeOnboarding project that was just deployed.
Expand the parameters -> enter 101 in the employeeId field -> click the Test Web Service button.
With the Response tab open click Launch Flow Trace.
Select the CandidateApproval process.
Select the dropdown and click Tree View.
Expand the After Service Call activity -> click one of the links to the right.
Note that the call to the service was successful and data was returned to the process.