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:

  1. In your file system, create a directory name LoanTut.
  2. Download the LoanProcessing1.zip file and extract it in to LoanTut directory.
  3. From the IDE's main menu, choose File > Open Project.
    The Open Project wizard opens.
  4. 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.

  1. Right-click the LoanProcessor and choose Deploy Project.
  2. Wait until the BUILD SUCCESSFUL message appears in the Output window.
  3. To verify that the LoanProcessor enterprise application is successfully deployed, switch to the Runtime window.
  4. Expand the Sun Java System Application Server node, the Applications node, and the EJB Modules node.
    The LoanProcessor node must be added.
  5. 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:

  1. From the IDE's main menu, choose File > New Project.
  2. Under Categories select SOA.
  3. Under Projects, select Intelligent Event Processing Module.
  4. Click Next.
  5. In the Project Name field, type LoanIEP.
  6. Modify the project location, or accept the default.
  7. Click Finish.
  8. The Projects window now contains the LoanIEP project node.
  9. Right-click on the folder LoanIEP project and select New > Intelligent Event Processor.
  10. In the File Name field, type loan. Click Finish.
  11. 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:

  1. 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.
  2. 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.
    1. Type ApplicantLoans for Name.
    2. Select the cell under the column header named Attribute Name. Type Status.
    3. Select the cell under the column header Data Type. From the drop down list select VARCHAR.
    4. Select the cell under the column header Size. Type 20.
    5. Click the Add Attribute button to add another Attribute. A blank row appears below the Symbol attribute row.
    6. Type Message for column Attribute Name. Select VARCHAR for Data Type, and type 100 for Size.
    7. Click OK.
  3. Drag the Time Based Window operator from the Stream converter Palette onto the design area.
  4. Connect the two operators by dragging lines between their ports; that is, connect ApplicantLoans to TimeBasedWindow0 .
  5. Double-click theTime Based Window Operator.
    The TimeBasedWindow Property Editor opens.
    1. Type OneDayWindow for Name.
    2. Leave the default Size unchanged and select day from the drop-down list
    3. Click Ok.
  6. Drag the Relation Aggrigator operator from the Aggregator Palette onto the design area.
  7. Connect the two operators by dragging lines between their ports; that is, connect OneDayWindow to RelationAggregator0.
  8. Double-click the Relator Aggrigator0 Operator.
    The Relation Aggrigator Property Editor opens.
    1. Type TotalApproved for Name.
    2. Select the cell under the column header named Expression. Type count(*).
    3. Select the cell under the column header named Attribute Name and type Total.
    4. Select the cell under the column header Data Type. From the drop down list select DOUBLE.
    5. Click the Add Attribute button to add another Attribute. A blank row appears below the Total attribute row.
    6. 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.
    7. D & D the Status from the left hand side, under the OneDayWindow folder onto the Group By field.
    8. Click OK.

  9. Drag the Relation Aggrigator operator from the Aggrigator Palette onto the design area.
  10. Connect the two operators by dragging lines between their ports; that is, connect OneDayWindow to RelationAggregator0.
  11. Double-click the Relator Aggrigator Operator.
    The Relation Aggrigator Property Editor opens.
    1. Type TotalApplied for Name.
    2. Select the cell under the column header named Expression. Type count(*).
    3. Select the cell under the column header named Attribute Name and type Total.
    4. Select the cell under the column header Data Type. From the drop down list select DOUBLE.
    5. Click OK.
  12. Drag the Relation Map operator from the Correlation and Filter Palette onto the design area.
  13. 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.
  14. Double-click the RelationMap Operator.
    The Relation Map Property Editor opens.
    1. Type PercentageApproved for Name.
    2. From the left hand side, expand TotalApplied, select Total.
    3. 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.
    4. Select the cell under column header named Attribute Name and type TotalApplied.
    5. Click the Add Attribute button to add another Attribute. A blank row appears below the Total attribute row.
    6. From the left hand side, expand TotalApproved, select Total.
    7. 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.
    8. Select the cell under the column header named Attribute Name and type TotalApproved.
    9. Click the Add Attribute button to add another Attribute. A blank row appears below the Total attribute row.
    10. D&D TotalApproved > Total from the left side, onto the third row under Expression followed by division sign '/'.
    11. D&D TotalApplied > Total from the left side, onto the third row under Expression after the division sign '/'.
    12. Add the string 100* to the beginning of the expression.
    13. Type PercentageApproved for the Attribute Name and select DOUBLE for Data type.
    14. 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.
    15. From the left hand side, expand TotalApproved, select Status, and D&D Status onto the WHERE part, followed by the string ='Approved'.
    16. click Ok.
  15. Drag the Table Output operator from the Output Palette onto the design area.
  16. Connect the two operators by dragging lines between their ports; that is, connect Percentageapproved to TableOutput0.
  17. Double-click the TableOutput0 Operator.
    The Table Output Property Editor opens.
    1. Type LoanSummary for Name.
    2. Check property Is Global.
    3. Type LoanSummary for Global Id and click Ok.
  18. Click Save to save the IEP Process.

To build the IEP Module project:

  1. 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.
  2. 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:

  1. From the IDE's main menu, choose File > New Project.
  2. Under Categories select SOA.
  3. Under Projects, select XSLT Module.
  4. Click Next.
  5. In the Project Name field, type NotifyManager.
  6. Modify the project location, or accept the default.
  7. Click Finish.
  8. The Projects window now contains the NotifyManager project node.

To add Enternal XML Schema Documents:

  1. In the Projects window, right-click the NotifyManager > Transformation Files node and choose New > Other....
  2. In the New File dialog box, under Categories, select XML.
  3. Under File Types, select Enternal XML Schema Document.
  4. Check the From Local File System radio button.
  5. Navigate to the LoanTut/LoanRequestor directory, select src.
  6. Click Open.
  7. 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:

  1. In the Projects window, right-click the NotifyManager > Transformation Files node and choose New > Other....
  2. In the New File dialog box, under Categories, select XML.
  3. Under File Types, select XML Schema.
  4. Click Next.
  5. In the File Name field, type notifyManager.
  6. 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.
  7. 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.
  8. In the Name field, type notification.
  9. Under Type, select the Use Existing Type radio button.
  10. Expand Build-in Types, select String. Click OK.
  11. 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:

  1. In the Projects window, right-click the NotifyManager > Transformation Files node and choose New > WSDL Document.
  2. In New File dialog the File Name field, type notifyManager, then click Next.
  3. Under Input, in the Element Or Type column, click the ellipsis (...) button. The Select Element Or Type dialog box opens.
  4. Select NotifyManager > src/LoanRequestor.xsd > Elements > processApplicElement and click OK.
  5. Under Output, in the Element Or Type column, click the ellipsis (...) button. The Select Element Or Type dialog box opens.
  6. Select NotifyManager > src/NotifyManager.xsd > Elements > notification and click OK.
  7. Click Finish.

To create an XSL stylesheet:

  1. In the Projects window, right-click the NotifyManager > Transformation Files node and choose New > XSLT Service.
  2. In New File dialog, under Service Type, select Request-Reply Service. Click Next.
  3. Select notifyManager.wsdl in the Web Service drop-down list. Click Next.
  4. 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.

  5. In the Palette, expand the String section and drag the concat function onto the Transformations pane of the XSLT Design view.
  6. 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).
  7. 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.
  8. Select the name element in the Source tree pane on the left, and drag the handle to the string2 row in the Concat function.
  9. In the Palette, expand the String section and drag the concat function onto the Transformations pane of the XSLT Design view.
  10. 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).
  11. In the Palette, expand the String section and drag another concat function onto the Transformations pane of the XSLT Design view.
  12. 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.
  13. 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.

    '
    .
  14. 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.
  15. Drag the return string handle to the notification element in the Destination tree pane on the right.
  16. 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:

  1. 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.
  2. Enter sendEmail for the file name. Make any changes you may require, or leave setting as the default, and click Next.
  3. From the Abstract Configuration page of the wizard, select One Way Operation as the Operation Type, and click Next.
  4. 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.
  5. From the NetBeans IDE toolbar, click the Save All button to save your changes.

To configure the sendEmail SMTP WSDL Document:

  1. From the project tree in the Projects window, select sendEmail.wsdl.
  2. From the WSDL Editor tree, select part1 under Messages > sendEmailOperationRequest. From the Properties window, select the Name property and rename part1 to messagePart.
  3. 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.
  4. From the WSDL Editor tree, select part1 under Messages > sendEmailOperationRequest, and edit the properties as follows.
    1. From the Properties window, select the Name property and rename part1 to subjectPart.
    2. From the Properties window, select the Element or Type property, and select string as the type.
  5. 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.
  6. From the WSDL Editor tree, select part1 under Messages > sendEmailOperationRequest, and edit the properties as follows.
    1. From the Properties window, select the Name property and rename part1 to toPart.
    2. 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:

  1. 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.
  2. In the Projects window, expand the NotifyManager project node, then expand the Transformation Files node and select the notifyManagerWSDL.wsdl node.
  3. 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.
  4. Change the value in the Name field to XsltImplementation.
  5. Check the Use Existing Partner Link Type.
  6. Click the Swap Roles button.
    The IDE fills in the Partner Role field with NotifyManagerPortTypeRole. Click OK.
  7. In the Projects window, expand the LoanIEP project node, then expand the Process Files node, select the loan.wsdl node.
  8. Drag your selection (loan.wsdl node) from the Projects window to the Design view.
  9. In the Name field, type IepImplementation.
  10. Click Swap Roles button.
  11. Accept the defaults and click OK.

To add an If activity:

  1. 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.
  2. 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.
  3. In the If1[If] - Properties widnow, change the value in the Name field to IfApproved.
  4. In the BPEL Mapper, from the Method Palette, click the String and select Contains method .
  5. The Contains method appears in the middle portion of the BPEL Mapper which is the Editor.
  6. Type APPROVED in the string2 and press the Enter key.
  7. Drag the return onto the string1 part of the Contains method.
  8. From the Contains method, drag the return boolean onto the Result.

To add Invoke activities:

  1. 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.
  2. 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.
  3. 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.
  4. Double-click the Invoke1 activity.
    The Invoke1 [Invoke] - Property Editor opens.
  5. Change the value in the Name field to InvokeNotifyManagerXslt.
  6. From the Partner Link drop-down list, select XsltImplementation.
    The IDE fills in the Operation field with notifyManagerOperation.
  7. Create an input variable by doing the following:
    1. Click the Create button next to the Input Variable field.
      The New Input Variable dialog box opens.
    2. Accept the default value in the Name field: NotifyManagerOperationIn.
    3. Click OK.
  8. Create an output variable by doing the following:
    1. Click the Create button next to the Output Variable field.
      The New Output Variable dialog box opens.
    2. Accept the default value in the Name field: NotifyManagerOperationOut.
    3. Click OK.
  9. 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.
  10. Double-click the Invoke2 activity.
    The Invoke2 [Invoke] - Property Editor opens.
  11. Change the value in the Name field to InvokeSendEmailSmtp.
  12. From the Partner Link drop-down list, select SmtpImplementation.
    The IDE fills in the Operation field with sendEmailOperation.
  13. Create an input variable by doing the following:
    1. Click the Create button next to the Input Variable field.
      The New Input Variable dialog box opens.
    2. Accept the default value in the Name field: SendEmailOperationIn.
    3. Click OK.
  14. 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.
  15. Double-click the Invoke3 activity.
    The Invoke3 [Invoke] - Property Editor opens.
  16. Change the value in the Name field to InvokeLoanSummaryIep.
  17. From the Partner Link drop-down list, select IepImplementation.
    The IDE fills in the Operation field with ApplicantLoans.
  18. Create an input variable by doing the following:
    1. Click the Create button next to the Input Variable field.
      The New Input Variable dialog box opens.
    2. Accept the default value in the Name field: ApplicantLoansIn.
    3. Click OK.
  19. 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.
  20. Click the Save All button on the toolbar.

To add a Flow activity:

  1. 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.
  2. In the Flow1[Flow] - Properties widnow, change the value in the Name field to RejectedFlow.
  3. Move activities InvokeNotifyManagerXslt and InvokeSendEmailSmtp in to RejectedFlow activity area, between the two large + icons.
  4. Click the Save All button on the toolbar.

To add Assign activities:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. If the Properties window is not visible, choose Window > Properties from the main menu.
  6. In the Design view, select the Assign1 activity.
  7. In the Properties window, change the Name property to AssignReceiveToXSLTInput.
  8. If the BPEL Mapper window is not visible, choose Window > BPEL Mapper from the main menu.
  9. 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.
  10. 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.
  11. Drag applicantName from the source pane to the applicantName node in the destination pane.
  12. Drag applicantEmailAddress from the source pane to the applicantEmailAddress node in the destination pane.
  13. Click the Save All button on the toolbar.
  14. In the Design view, select the Assign2 activity.
  15. In the Properties window, change the Name property to AssignNotifyManagerInfo.
  16. In the Palette, expand the String section and drag the Concat function onto the design pane of the BPEL Mapper.
  17. In the source pane (the left pane) of the BPEL Mapper, under the Variables node, expand the NotifyManagerOperationOut node.
  18. Drag the handle on the right side of part1 from the source pane to the string1 row in the Concat function.
  19. In the source pane of the BPEL Mapper, under the Variables node, expand the ProcessApplicOperationOut and parameters nodes.
  20. Drag the handle on the right side of return from the source pane to the string2 row in the Concat function.
  21. In the destination pane (the right pane) of the BPEL Mapper, under the Variables node, expand the SendEmailOperationIn node.
  22. Drag the return string handle to the messagePart element in the destination pane.
  23. In the Palette, expand the String section and drag the Concat function onto the design pane of the BPEL Mapper.
  24. In the source pane (the left pane) of the BPEL Mapper, under the Variables node, expand the NotifyManagerOperationIn and part1 node.
  25. Drag the handle on the right side of applicantName from the source pane to the string1 row in the Concat function.
  26. 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.
  27. Drag the return string handle to the subjectPart element in the destination pane.
  28. 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.
  29. Drag the return string handle to the toPart element in the destination pane.
  30. Click the Save All button on the toolbar.
  31. In the Design view, select the Assign3 activity.
  32. In the Properties window, change the Name property to AssignRejectedIep.
  33. In the source pane (the left pane) of the BPEL Mapper, under the Variables node, expand the ProcessApplicOperationOut and parameters nodes.
  34. In the destination pane (the right pane) of the BPEL Mapper, under the Variables node, expand the ApplicantLoanIn and input nodes.
  35. Drag the handle on the right side of return from the source pane to the Message element in the destination pane.
  36. 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.
  37. Drag the return string handle to the Status element in the destination pane.
  38. Click the Save All button on the toolbar.
  39. In the Design view, select the Assign4 activity.
  40. In the Properties window, change the Name property to AssignApprovedIep.
  41. In the source pane (the left pane) of the BPEL Mapper, under the Variables node, expand the ProcessApplicOperationOut and parameters nodes.
  42. In the destination pane (the right pane) of the BPEL Mapper, under the Variables node, expand the ApplicantLoanIn and input nodes.
  43. Drag the handle on the right side of return from the source pane to the Message element in the destination pane.
  44. 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.
  45. Drag the return string handle to the Status element in the destination pane.
  46. Click the Save All button on the toolbar.

To build the LoanRequestor BPEL Project:

  1. In the Projects window, right-click the LoanRequestor project node and choose Clean and Build Project.
  2. 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:

  1. 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.
  2. 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.
  3. 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.
  4. 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:

  1. In the Composite Application (Service Assembly) editor WSDL Binding section of the Palette, select the smtp icon.
  2. 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.
  3. In the JBI Modules area, click the consume endpoint icon in the sendEmailPortTypeRole_partnerRole in (BPEL) LoanRequestor box.
  4. Drag your selection to the publisher endpoint icon in casaPort2.
  5. In the editor toolbar, click the Build Project button.

To configure the SMTP WSDL Binding:

  1. If the Navigator window is not visible, choose Window > Navigating > Navigator.
  2. If the Properties window is not visible, choose Window > Properties.
  3. In the Design view of the CASA Editor, under WSDL Ports, select casaPort2.
    In the Navigator window, under WSDL Ports, casaPort2 node is highlighted.
  4. Expand casaPort2 > casaPort2. Select smtp:address node.
  5. In Properties window,
    1. In the smtpserver field, enter your smtp server. For example pop.gmail.com.
    2. In the username field, enter the loan processor email user name. For example loanprocessorj12007.
    3. In the password field, enter the loan processor email password. For example nbsmtptest.

  6. Expand casaPort2 > casaPort2 >casaBindingPortType > sendEmailOperation > input. Select smtp:input node.
  7. In Properties window,
    1. In the message field, select messagePart.
    2. In the subject field, select subjectPart.
    3. In the to field, select toPart.
  8. Save all your changes.

To deploy the composite application:

  1. 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.

  1. In the Runtime window of NetBeans, right-click Databases and select New Connection. The New Database Connection window opens.
  2. Input jdbc:derby://localhost/iepseDB for Database URL, iepseDB for User Name, and iepseDB for Password.
  3. 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.
  4. Expand the folder jdbc:derby://localhost/iepseDB[iepseDB on IEPSEDB] and then expand the subfolder Tables.
  5. 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.)

  1. 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
  2. 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.)

  1. Switch to Runtime window.
  2. Expand Databases > jdbc:derby://localhost/iepseDB > Tables. Right-click table LOANSUMMARY.
    Will see a table is displayed with the following information:
    1. TOTALAPPLIED: 1.
    2. TOTALAPPROVED: 1.
    3. PERCENTAGEAPPROVED: 100.
    4. EMS_SEWID: 1.

To run JUnit test inside LoanRequestorCompositeApp:

  1. In the Projects window, expand LoanRequestorCompositeApp and Test node.
  2. Right-click RejectedTestCase. Choose Run.
    In the JUnit Test Results window, will see test passed.

To view LoanSummary provided by LoanIEP:

  1. Switch to Runtime window.
  2. Expand Databases > jdbc:derby://localhost/iepseDB > Tables. Right-click table LOANSUMMARY.
    Will see a table is displayed with the following information:
    1. TOTALAPPLIED: 2.
    2. TOTALAPPROVED: 1.
    3. PERCENTAGEAPPROVED: 50.
    4. EMS_SEWID: 2.

To check the email notice:
An email will be sent to Manager for each Rejected application.

  1. Go to www.gmail.com, login as the loan manager:
    user name: manager.loan
    password: nbsmtptest
  2. Check the notification email just sent by you. The subject should be John Smith's request is rejected.

top