My First Composite Application with BPEL rules
Summary: This blog entry explains how to manipulate BPEL process using NB Enterprise Pack 5.5 and How to communicate to a BPEL process via JSP page.
Prerequisites : Please read this article on How to create simple "LoanProcessing" App.
Download "LoanProcessing" Application from the above article and extract archive to local disk.
1.0 Open loanRequest Projects in IDE
- "LoanProcesor" EJB Webservice project.
- "LoanRequestorBpel" projects.
2.0 Creating projects
- Create LoanProcessingCompositeApp and add "LoanRequestorBpel" to it.
- File -> New Project ->Service Oriented Architecture -> Composite Application follow the project creation wizard.
- Create LoanApplicationWeb,
- Select LoanApplicationWeb add webservice client for "LoanRequestor.wsdl"
2.1 To add BPEL Webservice client to WebApplcation.
2.1.1 Add BPELWebService client to "LoanApplicationWeb". Select "LoanApplicationWeb" Right click add File/Folder-> Webservices->Webservice client
- In the dialog box supply the location of "LoanRequestor.wsdl" on your local disk Which is part of "LoanRequestorBpel" project.

2.1.2 Now open "loanclient.jsp" right click in editor window to select "Webservice client Resources" -> "Call Web Service Operation"
2.1.3 Now select "LoanApplicationWeb" drill down to select "requestLoan" operation as shown below.

Now Click on "OK" button.
2.1.4 Now Modify
2.2 Manipulating LoanRequestor.bpel
We are going to introduce additional business rule to existing BPEL.2.2.1 Open LoanRequestor.bpel
2.2.2 Open Mapper from Window menu -> BPEL Mapper.
2.2.3 From SOA palette (Right side panel) select "IF" and drop below "ReceiveFromCustomer" receive element.
2.2.4 Move the the sequence "sequence1" between "X" nodes as shown in the following screen
2.3 Add a new Assign "Assign1" activity from Palette to IF Loop. See the above screen.
2.3.1 Select "IF" From Operator menu in Mapper Window
drop ">" greater than operator in to mapper drawing pane.
2.3.2 Select RequestLoanInput/applicantAge from Left side tree and connect to "Greater Than" -> "any1"

2.3.3 Drop "Number Literal" from Mapper Menu and drop in to mapper drawing pane.
In "LoanProcessor" Webservice Max Age limit is 65. We are going change this rule in BPEL process.
2.3.4 Set the value in "Number Literal" to 60
2.3.5 Connect "Number Literal" -> "any2" in "Greater Than" box.
2.3.6 Drop "Not" operator box in diagram area.
2.3.7 Connect "return boolean" from "Greater Than" -> "boolean1" in "Not" box.
2.3.8 Connect "return boolean" from "Not" to "Result" in Right side tree.
2.3.9 Now select "Assign1" See screen...
2.3.10 Drop "String Literal" in Mapper drawing pane.
2.3.11 Set value "BPEL : REJECTED Age is greater than 60" and
2.3.12 connect "String Literal" -> RequestLoanOutPut

3.0 Compile and Deploy
3.1 Now Compile "LoanProcessingCompositeApp" deploy to JBI server.3.2 Run "LoanApplicationWeb" Result should be "Loan Application APPROVED."
This is the "index,jsp" you will see after executing web application.

3.2.1 Result Page

3.2.1.1 This message is coming from Loan Process Webservice in EJB module.
3.2.1.2 Now change Age in index.JSP.

3.2.1.3 Click on "Submit" button
3.2.1.1 Now the result should be "BPEL : REJECTED Age is more than 60"
3.3 Sources for this article are available here.
4.0 Resources for further reading:
https://blueprints.dev.java.net/bpcatalog/ee5/soa/index.html
Posted by 204.162.92.192 on May 25, 2007 at 06:01 PM PDT #