NB 6.0 SOA Pack Loan Processing BluePrint Sample Cook Book
Author:
Hong Lin
Contributed by: Hong
Lin, Sherry Barkodar
Revision: 0.3
Last Updated:
May 10, 2007
This cookbook provides an end-to-end scenario to create the BluePrint sample
Loan Processing Composite Application. It is an extention of tutorial Creating
a Loan Processing Composite Application. NB 6.0 SOA Pack New features
are added in this cookbook. The updated flowchart is:

Contents
top
Opening the Loan Processing projects
This cookbook includes a zipped project called LoanProcessing1.zip. It can
be downloaded at LoanProcessing1.zip.
To create the projects in the zip file from scratch, please follow the tutorial
Creating
a Loan Processing Composite Application.
To open the pre-created Loan Processing
projects:
- In your file system, create a directory name LoanTut.
- Download the LoanProcessing1.zip
file and extract it in to LoanTut directory.
- From the IDE's main menu, choose File > Open Project.
The Open Project wizard opens.
- Navigate to the LoanTut directory that you just created, select
the LoanProcessor, LoanRequestor, LoanRequestorCompositeApp projects,
click Open Project Folder.
A progress dialog box appears, and then the projects appear in the Projects
window.
To deploy the projects:
Your Sun Java System Application Server should be running.
- Right-click the LoanProcessor and choose Deploy Project.
- Wait until the BUILD SUCCESSFUL message appears in the Output window.
- To verify that the LoanProcessor enterprise application is successfully
deployed, switch to the Runtime window.
- Expand the Sun Java System Application Server node, the Applications
node, and the EJB Modules node.
The LoanProcessor node must be added.
- Right-click the LoanRequestorCompositeApp project node and choose
Deploy Project.
If the BUILD SUCCESSFUL message appears in the Output window, then
the deployment has succeeded.
top
Creating the IEP Module Project
In this section, you create an Intelligent Event Processing Module project,
called LoanIEP.
To create a new IEP Module project:
- From the IDE's main menu, choose File > New Project.
- Under Categories select SOA.
- Under Projects, select Intelligent Event Processing Module.
- Click Next.
- In the Project Name field, type LoanIEP.
- Modify the project location, or accept the default.
- Click Finish.
- The Projects window now contains the LoanIEP project node.
- Right-click on the folder LoanIEP project and select New >
Intelligent Event Processor.
- In the File Name field, type loan. Click Finish.
- The IDE does the following:
1. Creates loan.iep under the Process Files.
2. Opens the loan.iep file in the IEP design view.
3. Opens the IEP Operator Palette.
To Add IEP Operators from the IEP Operator
Palette to the Design Area:
- Drag the Stream Input operator from the Input Palette
onto the design area. If the Palette is not visible, select the Window >
Palette menu to display it.
- To configure operator StreamInput0, double-click the StreamInput0
operator.
The StreamInput0 – property editor pops up. In this window, you will
add attributes to define the incoming stream's data format.
- Type ApplicantLoans for Name.
- Select the cell under the column header named Attribute Name. Type Status.
- Select the cell under the column header Data Type. From the drop down
list select VARCHAR.
- Select the cell under the column header Size. Type 20.
- Click the Add Attribute button to add another Attribute. A blank row
appears below the Symbol attribute row.
- Type Message for column Attribute Name. Select VARCHAR for Data Type,
and type 100 for Size.
- Click OK.

- Drag the Time Based Window operator from the Stream converter Palette onto
the design area.
- Connect the two operators by dragging lines between their ports; that is,
connect ApplicantLoans to TimeBasedWindow0 .
- Double-click theTime Based Window Operator.
The TimeBasedWindow Property Editor opens.
- Type OneDayWindow for Name.
- Leave the default Size unchanged and select day from the drop-down list
- Click Ok.

- Drag the Relation Aggrigator operator from the Aggregator Palette onto the
design area.
- Connect the two operators by dragging lines between their ports; that is,
connect OneDayWindow to RelationAggregator0.
- Double-click the Relator Aggrigator0 Operator.
The Relation Aggrigator Property Editor opens.
- Type TotalApproved for Name.
- Select the cell under the column header named Expression. Type count(*).
- Select the cell under the column header named Attribute Name and type
Total.
- Select the cell under the column header Data Type. From the drop down
list select DOUBLE.
- Click the Add Attribute button to add another Attribute. A blank row
appears below the Total attribute row.
- D & D the Status from the left hand side, under the OneDayWindow
folder onto the empty row under Expression. Click Enter. The cells under
column named Attribute Name, Data Type and Size are filled.
- D & D the Status from the left hand side, under the OneDayWindow
folder onto the Group By field.
- Click OK.
- Drag the Relation Aggrigator operator from the Aggrigator Palette onto the
design area.
- Connect the two operators by dragging lines between their ports; that is,
connect OneDayWindow to RelationAggregator0.
- Double-click the Relator Aggrigator Operator.
The Relation Aggrigator Property Editor opens.
- Type TotalApplied for Name.
- Select the cell under the column header named Expression. Type count(*).
- Select the cell under the column header named Attribute Name and type
Total.
- Select the cell under the column header Data Type. From the drop down
list select DOUBLE.
- Click OK.

- Drag the Relation Map operator from the Correlation and Filter Palette onto
the design area.
- Connect the three operators by dragging lines between their ports; that
is, connect Relation Aggrigator (TotalApproved) to Relation Map, and connect
Relation Aggrigator (TotalApplied) to Relation Map.

- Double-click the RelationMap Operator.
The Relation Map Property Editor opens.
- Type PercentageApproved for Name.
- From the left hand side, expand TotalApplied, select Total.
- D & D the Total from the left hand side, onto the empty row under
Expression. Hit Enter. The cells under the column header named Attribute
Name, Data Type are filled.
- Select the cell under column header named Attribute Name and type TotalApplied.
- Click the Add Attribute button to add another Attribute. A blank row
appears below the Total attribute row.
- From the left hand side, expand TotalApproved, select Total.
- D & D the Total from the left hand side, onto the second row under
Expression. Hit Enter. The cells under the column header named Attribute
Name, Data Type are filled.
- Select the cell under the column header named Attribute Name and type
TotalApproved.
- Click the Add Attribute button to add another Attribute. A blank row
appears below the Total attribute row.
- D&D TotalApproved > Total from the left side, onto the third
row under Expression followed by division sign '/'.
- D&D TotalApplied > Total from the left side, onto the third row
under Expression after the division sign '/'.
- Add the string 100* to the beginning of the expression.
- Type PercentageApproved for the Attribute Name and select DOUBLE for
Data type.
- D & D the TotalApproved from the left hand side, onto the FROM part
followed by a comma ',' then D & D the TotalApplied from the left
hand side after the comma.
- From the left hand side, expand TotalApproved, select Status, and D&D
Status onto the WHERE part, followed by the string ='Approved'.
- click Ok.

- Drag the Table Output operator from the Output Palette onto the design area.
- Connect the two operators by dragging lines between their ports; that is,
connect Percentageapproved to TableOutput0.
- Double-click the TableOutput0 Operator.
The Table Output Property Editor opens.
- Type LoanSummary for Name.
- Check property Is Global.
- Type LoanSummary for Global Id and click Ok.

- Click Save to save the IEP Process.
To build the IEP Module project:
- In the Projects window, right-click LoanIEP node and choose Build Project.
If the BUILD SUCCESSFUL message appears in the Output window, then the build
project has succeeded.
- Expand LoanIEP > Process Files node, will see loan.wsdl file is created.
top
Creating the XSLT Module Project
In this section, you create an XSL Transformation Service within an XSLT Module
project, called NotifyManager.
To create a new XSLT Module project:
- From the IDE's main menu, choose File > New Project.
- Under Categories select SOA.
- Under Projects, select XSLT Module.
- Click Next.
- In the Project Name field, type NotifyManager.
- Modify the project location, or accept the default.
- Click Finish.
- The Projects window now contains the NotifyManager project node.
To add Enternal XML Schema Documents:
- In the Projects window, right-click the NotifyManager > Transformation
Files node and choose New > Other....
- In the New File dialog box, under Categories, select XML.
- Under File Types, select Enternal XML Schema Document.
- Check the From Local File System radio button.
- Navigate to the LoanTut/LoanRequestor directory, select src.
- Click Open.
- Click Finish.
You should see file LoanRequestor.wsdl and LoanRequestor.xsd are
listed under the Transformation Files node in your NotifyManager
project
To create the XML Schema for the outgoing
message:
- In the Projects window, right-click the NotifyManager > Transformation
Files node and choose New > Other....
- In the New File dialog box, under Categories, select XML.
- Under File Types, select XML Schema.
- Click Next.
- In the File Name field, type notifyManager.
- Click Finish. A new node—notifyManager.xsd—appears
under the Transformation Files node in your NotifyManager
project and the new Schema opens in the XML Schema Editor.
- In the first column of the Schema view, right-click Elements and choose
Add Element from the pop-up menu. The Element dialog box opens.
- In the Name field, type notification.
- Under Type, select the Use Existing Type radio button.
- Expand Build-in Types, select String. Click OK.
- Click the Save All button on the toolbar.
You should see a new Schema file listed under the Transformation Files
node in your NotifyManager project.
To create a WSDL file defining the web
interface of XSL Transformation Service:
- In the Projects window, right-click the NotifyManager > Transformation
Files node and choose New > WSDL Document.
- In New File dialog the File Name field, type notifyManager, then
click Next.
- Under Input, in the Element Or Type column, click the ellipsis (...) button.
The Select Element Or Type dialog box opens.
- Select NotifyManager > src/LoanRequestor.xsd > Elements >
processApplicElement and click OK.
- Under Output, in the Element Or Type column, click the ellipsis (...) button.
The Select Element Or Type dialog box opens.
- Select NotifyManager > src/NotifyManager.xsd > Elements >
notification and click OK.
- Click Finish.
To create an XSL stylesheet:
- In the Projects window, right-click the NotifyManager > Transformation
Files node and choose New > XSLT Service.
- In New File dialog, under Service Type, select Request-Reply Service. Click
Next.
- Select notifyManager.wsdl in the Web Service drop-down list. Click
Next.
- In the XSL File field, type notifyManager. Click Finish.
The notifyManager.xsl node appears under the Transformation
Files node in your NotifyManager project. The notifyManager.xsl
file opens in the Design view of the XSL Transformation Editor. The Design
view Palette opens on the right.
- In the Palette, expand the String section and drag the concat function onto
the Transformations pane of the XSLT Design view.
- In the Palette, under the String section, select the string-literal function
and drag it to the Transformations pane. Double-click the return string field
to make it editable and type 'Dear Manager, This message was generated
by the Automated Loan Application process. '(with a space at the end).
- Drag the handle on the right side of the string-literal box to
the handle on the left side of the string1 row in the Concat function. An
arrow snaps in place to indicate the flow.
- Select the name element in the Source tree pane on the left, and drag the
handle to the string2 row in the Concat function.
- In the Palette, expand the String section and drag the concat function onto
the Transformations pane of the XSLT Design view.
- In the Palette, under the String section, select the string-literal function
and drag it to the Transformations pane. Double-click the return string field
to make it editable and type 'Dear Manager, This message was generated
by the Automated Loan Application process. '(with a space at the end).
- In the Palette, expand the String section and drag another concat function
onto the Transformations pane of the XSLT Design view.
- Drag the return string handle in the first Concat box to the handle
on the left side of the string1 row in the second Concat function.
- In the Palette, under the String section, select the string-literal function
and drag it to the Transformations pane. Double-click the return string field
to make it editable and type ' was recently denied approval for a loan
on
the basis of information entered on-line.
Please review the information below and contact the applicant if appropriate.
'.
- Drag the handle on the right side of the string-literal box to the handle
on the left side of the string2 row in the second Concat function. An arrow
snaps in place to indicate the flow.
- Drag the return string handle to the notification element
in the Destination tree pane on the right.
- Click the Save All button on the toolbar.
top
Creating the SMTP WSDL Document
In this section, you create a SMTP WSDL document within a BPEL Module project.
To create the sendEmail WSDL Document:
- From the Projects window, right-click the LoanRequestor project's
Process Files directory and select New > WSDL Document
from the pop-up menu.
The New WSDL Document wizard appears.
- Enter sendEmail for the file name. Make any changes you may require,
or leave setting as the default, and click Next.
- From the Abstract Configuration page of the wizard, select One
Way Operation as the Operation Type, and click Next.
- From the Concrete Configuration page of the wizard, select SMTP
as the Binding Type, and click Finish. The new WSDL is added to the
project tree in the Projects window and the WSDL Editor appears in WSDL view.
- From the NetBeans IDE toolbar, click the Save All button to save
your changes.
To configure the sendEmail SMTP WSDL Document:
- From the project tree in the Projects window, select sendEmail.wsdl.
- From the WSDL Editor tree, select part1 under Messages >
sendEmailOperationRequest. From the Properties window, select the Name
property and rename part1 to messagePart.
- From the WSDL Editor tree, right-click Messages > sendEmailOperationRequest,
and select Add > Part from the pop-up menu. A new part1
file is added to the WSDL Editor tree.
- From the WSDL Editor tree, select part1 under Messages >
sendEmailOperationRequest, and edit the properties as follows.
- From the Properties window, select the Name property and rename
part1 to subjectPart.
- From the Properties window, select the Element or Type property,
and select string as the type.
- From the WSDL Editor tree, right-click Messages > sendEmailOperationRequest,
and select Add > Part from the pop-up menu to add another part1
file to the WSDL Editor tree.
- From the WSDL Editor tree, select part1 under Messages >
sendEmailOperationRequest, and edit the properties as follows.
- From the Properties window, select the Name property and rename
part1 to toPart.
- From the Properties window, select the Element or Type property,
and select string as the type.
top
Manipulating the BPEL Process
In this section, you add the XSL Transformation service to your BPEL Module
project.
To add new Partner Links:
- In the Projects window, expand the LoanRequestor node, the Process
Files node and double-click the LoanRequestor.bpel node.
The IDE displays the LoanRequestor.bpel diagram in the Design view.
- In the Projects window, expand the NotifyManager project node,
then expand the Transformation Files node and select the notifyManagerWSDL.wsdl
node.
- Drag your selection (notifyManagerWSDL.wsdl) from the Projects
window to the LoanRequestor.bpel diagram in Design view.
The Create New Partner Link dialog box opens.
- Change the value in the Name field to XsltImplementation.
- Check the Use Existing Partner Link Type.
- Click the Swap Roles button.
The IDE fills in the Partner Role field with NotifyManagerPortTypeRole. Click
OK.
- In the Projects window, expand the LoanIEP project node, then
expand the Process Files node, select the loan.wsdl node.
- Drag your selection (loan.wsdl node) from the Projects window
to the Design view.
- In the Name field, type IepImplementation.
- Click Swap Roles button.
- Accept the defaults and click OK.
To add an If activity:
- In the Structured Activities section of the Palette, select the
If icon and drag your selection to the Design area under the ReplyToCustomer
activity.
The IDE provides you with visual clues to show you where you can drop the
selection.
This action places an If activity called If1 in the Design view.
- In the Design view, click the If1 activity.
The BPEL Mapper appears at the bottom of the IDE. The Properties window should
be visible as well.
If the BPEL Mapper is not visible, choose Window > BPEL Mapper.
If the Properties window is not visible, choose Window > Properties.
- In the If1[If] - Properties widnow, change the value in the Name
field to IfApproved.
- In the BPEL Mapper, from the Method Palette, click the String and
select Contains method .
- The Contains method appears in the middle portion of the BPEL
Mapper which is the Editor.
- Type APPROVED in the string2 and press the Enter key.
- Drag the return onto the string1 part of the Contains
method.
- From the Contains method, drag the return boolean onto
the Result.
To add Invoke activities:
- In the Web Service section of the Palette, select the Invoke icon and drag
your selection to the IfApproved activity Else Design area.
This action places an invoke activity called Invoke1 in the Design
view.
- In the Web Service section of the Palette, select the Invoke icon and drag
your selection to the the IfApproved activity Else Design
area, below the Invoke1 activity.
This action places an invoke activity called Invoke2 in the Design
view.
- In the Web Service section of the Palette, select the Invoke icon and drag
your selection to the Design area below the IfApproved activity.
This action places an invoke activity called Invoke3 in the Design
view.
- Double-click the Invoke1 activity.
The Invoke1 [Invoke] - Property Editor opens.
- Change the value in the Name field to InvokeNotifyManagerXslt.
- From the Partner Link drop-down list, select XsltImplementation.
The IDE fills in the Operation field with notifyManagerOperation.
- Create an input variable by doing the following:
- Click the Create button next to the Input Variable field.
The New Input Variable dialog box opens.
- Accept the default value in the Name field: NotifyManagerOperationIn.
- Click OK.
- Create an output variable by doing the following:
- Click the Create button next to the Output Variable field.
The New Output Variable dialog box opens.
- Accept the default value in the Name field: NotifyManagerOperationOut.
- Click OK.
- Click OK to close the Invoke1 [Invoke] - Property Editor.
The invoke activity is now labeled InvokeNotifyManagerXslt in the
Design view and a connection is shown between the invoke activity in the LoanRequestor
process and the XsltImplementation partner link.
- Double-click the Invoke2 activity.
The Invoke2 [Invoke] - Property Editor opens.
- Change the value in the Name field to InvokeSendEmailSmtp.
- From the Partner Link drop-down list, select SmtpImplementation.
The IDE fills in the Operation field with sendEmailOperation.
- Create an input variable by doing the following:
- Click the Create button next to the Input Variable field.
The New Input Variable dialog box opens.
- Accept the default value in the Name field: SendEmailOperationIn.
- Click OK.
- Click OK to close the Invoke2 [Invoke] - Property Editor.
The invoke activity is now labeled InvokeSendEmailSmtp in the Design
view and a connection is shown between the invoke activity in the LoanRequestor
process and the SmtpImplementation partner link.
- Double-click the Invoke3 activity.
The Invoke3 [Invoke] - Property Editor opens.
- Change the value in the Name field to InvokeLoanSummaryIep.
- From the Partner Link drop-down list, select IepImplementation.
The IDE fills in the Operation field with ApplicantLoans.
- Create an input variable by doing the following:
- Click the Create button next to the Input Variable field.
The New Input Variable dialog box opens.
- Accept the default value in the Name field: ApplicantLoansIn.
- Click OK.
- Click OK to close the Invoke3 [Invoke] - Property Editor.
The invoke activity is now labeled InvokeLoanSummaryIep in the Design
view and a connection is shown between the invoke activity in the LoanRequestor
process and the IepImplementation partner link.
- Click the Save All button on the toolbar.
To add a Flow activity:
- In the Structured Activities section of the Palette, select the Flow icon
and drag your selection to the Design area between the the two large X icons
in the IfApproved activity Else design area.
This action places a flow activity called Flow1 in the Design view.
- In the Flow1[Flow] - Properties widnow, change the value in the
Name field to RejectedFlow.
- Move activities InvokeNotifyManagerXslt and InvokeSendEmailSmtp
in to RejectedFlow activity area, between the two large + icons.
- Click the Save All button on the toolbar.
To add Assign activities:
- In the Basic Activities section of the Palette, select the Assign icon and
drag your selection to the Design area between ReceiveFromCustomer
and CopyCustomerInfo.
This action places an assign activity called Assign1 in the Design
view.
- In the Basic Activities section of the Palette, select the Assign icon and
drag your selection to the Design area between InvokeNotifyManagerXslt
and InvokeSendEmailSmtp.
This action places an assign activity called Assign2 in the Design
view.
- In the Basic Activities section of the Palette, select the Assign icon and
drag your selection to the Design area inside RejectedFlow activity
area, place it to the right of the existing Sequence2 activity.
This action places an assign activity called Assign3 in the Design
view.
- In the Basic Activities section of the Palette, select the Assign icon and
drag your selection to the Design area inside IfReject activity area,
place it to the right of the existing Sequence1 activity.
This action places an assign activity called Assign4 in the Design
view.
- If the Properties window is not visible, choose Window > Properties from
the main menu.
- In the Design view, select the Assign1 activity.
- In the Properties window, change the Name property to AssignReceiveToXSLTInput.
- If the BPEL Mapper window is not visible, choose Window > BPEL Mapper
from the main menu.
- In the source pane (the left pane) of the BPEL Mapper, under the Variables
node, expand the LoanRequestorOperationIn and requestLoanMessage
nodes.
A node is shown for each schema element in the processApplicType
complex type in the schema you created earlier.
- In the destination pane (the right pane) of the BPEL Mapper, under the Variables
node, expand the NotifyManagerOperationIn and part1 nodes.
The same schema elements are shown as nodes under this part1 node.
- Drag applicantName from the source pane to the applicantName
node in the destination pane.
- Drag applicantEmailAddress from the source pane to the applicantEmailAddress
node in the destination pane.
- Click the Save All button on the toolbar.
- In the Design view, select the Assign2 activity.
- In the Properties window, change the Name property to AssignNotifyManagerInfo.
- In the Palette, expand the String section and drag the Concat
function onto the design pane of the BPEL Mapper.
- In the source pane (the left pane) of the BPEL Mapper, under the Variables
node, expand the NotifyManagerOperationOut node.
- Drag the handle on the right side of part1 from the source pane
to the string1 row in the Concat function.
- In the source pane of the BPEL Mapper, under the Variables node,
expand the ProcessApplicOperationOut and parameters nodes.
- Drag the handle on the right side of return from the source pane
to the string2 row in the Concat function.
- In the destination pane (the right pane) of the BPEL Mapper, under the Variables
node, expand the SendEmailOperationIn node.
- Drag the return string handle to the messagePart element
in the destination pane.
- In the Palette, expand the String section and drag the Concat
function onto the design pane of the BPEL Mapper.
- In the source pane (the left pane) of the BPEL Mapper, under the Variables
node, expand the NotifyManagerOperationIn and part1 node.
- Drag the handle on the right side of applicantName from the source
pane to the string1 row in the Concat function.
- In the Palette, expand the String section and drag the String
Literal function onto the design pane of the BPEL Mapper. Double-click
the return string field to make it editable and type 's request
is rejected.
- Drag the return string handle to the subjectPart element
in the destination pane.
- In the Palette, expand the String section and drag the String
Literal function onto the design pane of the BPEL Mapper. Double-click
the return string field to make it editable and type manager.loan@gmail.com.
- Drag the return string handle to the toPart element in
the destination pane.
- Click the Save All button on the toolbar.
- In the Design view, select the Assign3 activity.
- In the Properties window, change the Name property to AssignRejectedIep.
- In the source pane (the left pane) of the BPEL Mapper, under the Variables
node, expand the ProcessApplicOperationOut and parameters
nodes.
- In the destination pane (the right pane) of the BPEL Mapper, under the Variables
node, expand the ApplicantLoanIn and input nodes.
- Drag the handle on the right side of return from the source pane
to the Message element in the destination pane.
- In the Palette, expand the String section and drag the String
Literal function onto the design pane of the BPEL Mapper. Double-click
the return string field to make it editable and type Rejected.
- Drag the return string handle to the Status element in
the destination pane.
- Click the Save All button on the toolbar.
- In the Design view, select the Assign4 activity.
- In the Properties window, change the Name property to AssignApprovedIep.
- In the source pane (the left pane) of the BPEL Mapper, under the Variables
node, expand the ProcessApplicOperationOut and parameters
nodes.
- In the destination pane (the right pane) of the BPEL Mapper, under the Variables
node, expand the ApplicantLoanIn and input nodes.
- Drag the handle on the right side of return from the source pane
to the Message element in the destination pane.
- In the Palette, expand the String section and drag the String
Literal function onto the design pane of the BPEL Mapper. Double-click
the return string field to make it editable and type Approved.
- Drag the return string handle to the Status element in
the destination pane.
- Click the Save All button on the toolbar.
To build the LoanRequestor BPEL Project:
- In the Projects window, right-click the LoanRequestor project node and choose
Clean and Build Project.
- If the BUILD SUCCESSFUL message appears in the Output window, then the Build
has succeeded.
top
Using the Composite Application (Service Assembly) Editor
To add the JBI modules:
- In the Project window, select the LoanRequestorCompositeApp project
and choose Edit Application Configuration from the pop-up menu.
The IDE opens the .casa file in the Composite Application (Service Assembly)
editor.
- In the Projects window, select the NotifyManager project node and
drag your selection to the JBI Modules area in the Design view of the LoanRequestorCompositeApp.
- In the Projects window, select the LoanIep project node and drag
your selection to the JBI Modules area in the Design view of the LoanRequestorCompositeApp.
- In the Projects window, select the NotifyManager project node and
drag your selection to the JBI Modules area in the Design view of the LoanRequestorCompositeApp.casa
file.
To create the WSDL endpoint and create a connection:
- In the Composite Application (Service Assembly) editor WSDL Binding section
of the Palette, select the smtp icon.
- Drag your selection to the WSDL Ports area in the Design view of the LoanRequestorCompositeApp.casa
file.
The IDE adds a WSDL port labeled casaPort2.
- In the JBI Modules area, click the consume endpoint icon in the sendEmailPortTypeRole_partnerRole
in (BPEL) LoanRequestor box.
- Drag your selection to the publisher endpoint icon in casaPort2.
- In the editor toolbar, click the Build Project button.
To configure the SMTP WSDL Binding:
- If the Navigator window is not visible, choose Window > Navigating >
Navigator.
- If the Properties window is not visible, choose Window > Properties.
- In the Design view of the CASA Editor, under WSDL Ports, select casaPort2.
In the Navigator window, under WSDL Ports, casaPort2 node is highlighted.
- Expand casaPort2 > casaPort2. Select smtp:address node.
- In Properties window,
- In the smtpserver field, enter your smtp server. For example pop.gmail.com.
- In the username field, enter the loan processor email user name. For example
loanprocessorj12007.
- In the password field, enter the loan processor email password. For example
nbsmtptest.
- Expand casaPort2 > casaPort2 >casaBindingPortType > sendEmailOperation
> input. Select smtp:input node.
- In Properties window,
- In the message field, select messagePart.
- In the subject field, select subjectPart.
- In the to field, select toPart.
- Save all your changes.
To deploy the composite application:
- Right-click the LoanRequestorCompositeApp project node and choose
Deploy Project.
If the BUILD SUCCESSFUL message appears in the Output window, then
the deployment has succeeded.
Note: The application that you developed at
this point can be downloaded at: LoanProcessing2.zip.
top
Running the Web Application and Testing the
Composite Application
Before testing the LoanRequestorCompositeApp, a connection to the Java DB database
server from within your NetBeans IDE needs to be created. This connection enables
you to view the content of the database tables.
To create the database connection:
In this section, you create a connection to the Java DB database server from
within your NetBeans IDE and examine the appropriate table in the database.
- In the Runtime window of NetBeans, right-click Databases and select New
Connection. The New Database Connection window opens.
- Input jdbc:derby://localhost/iepseDB for Database URL, iepseDB for User
Name, and iepseDB for Password.
- Check Remember password during this session , and click OK. Notice the folder
jdbc:derby://localhost//iepseDB[iepseDB on IEPSEDB] now exists under the folder
Databases. A connection to the Java DB database server from within NetBeans
IDE is created.
- Expand the folder jdbc:derby://localhost/iepseDB[iepseDB on IEPSEDB] and
then expand the subfolder Tables.
- Right-click LOANSUMMARY , and select View Data. Notice that this table is
empty.
Next you will run the test and send the Status of the loan into the event
stream, and observe the approved percentage as updates in the LOANSUMMARY
table.
To run Web Application: (Note:
LoanIEP only works fine when you run ApprovedTestCase first (or run LoanApplicationWebClient
by submitting with the defult applicant information), then RejectedTestCase.
This is a development issue. I will fix the LoanIEP project later. Please at
least do "Submit"without changing anything for the first try.)
- In the Projects window, righ-click LoanApplicationWebclient node,
choose Run Project from the pop-up menu.
In the Output window, the URL that the IDE will launch in a browser is shown,
and a BUILD SUCCESSFUL message appears if the build has succeeded.
The IDE opens a web browser with the URL shown in the Output window. For example,
in my case, the URL is http://localhost:8080/LoanApplicationWebClient/index.jsp
- Accept the default applicant information, Click the Submit button.
Loan Application Status is displayed. In this case, Result = Loan Application
APPROVED.
To view LoanSummary provided by LoanIEP: (Note: Everytime
LoanRequestorCompositeApp is deployed, LOANSUMMARY table will be reset.)
- Switch to Runtime window.
- Expand Databases > jdbc:derby://localhost/iepseDB > Tables.
Right-click table LOANSUMMARY.
Will see a table is displayed with the following information:
- TOTALAPPLIED: 1.
- TOTALAPPROVED: 1.
- PERCENTAGEAPPROVED: 100.
- EMS_SEWID: 1.
To run JUnit test inside LoanRequestorCompositeApp:
- In the Projects window, expand LoanRequestorCompositeApp and Test
node.
- Right-click RejectedTestCase. Choose Run.
In the JUnit Test Results window, will see test passed.
To view LoanSummary provided by LoanIEP:
- Switch to Runtime window.
- Expand Databases > jdbc:derby://localhost/iepseDB > Tables.
Right-click table LOANSUMMARY.
Will see a table is displayed with the following information:
- TOTALAPPLIED: 2.
- TOTALAPPROVED: 1.
- PERCENTAGEAPPROVED: 50.
- EMS_SEWID: 2.
To check the email notice:
An email will be sent to Manager for each Rejected application.
- Go to www.gmail.com, login as the loan
manager:
user name: manager.loan
password: nbsmtptest
- Check the notification email just sent by you. The subject should be John
Smith's request is rejected.
top