Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

developerWorks Community:

  • Close [x]

Build and deploy a business process model using WebSphere Business Process Modeler Advanced and Lotus Forms, Part 2: Implement and test the BPEL process using WebSphere Integration Developer

Attila Kiss (attila_kiss_bme@yahoo.com), Student, Budapest University of Technology and Economics
Attila Kiss
Attila Kiss attends Budapest University of Technology and Economics and will graduate as a Computer Science Engineer in 2008. He specializes in IT infrastructure management. He has been working with WebSphere products with special focus on business modeling.
Viktor Muller (viktormuller@gmail.com), Student, Budapest University of Technology and Economics
Viktor Muller Photo
Viktor Müller attends Budapest University of Technology and Economics and graduates as a Computer Science Engineer in 2009. He specializes in information system development. He has worked with WebSphere products with a special focus on BPEL development.

Summary:  Learn how to use IBM® WebSphere® Integration Developer to implement and customize a Business Process Execution Language (BPEL) process and then test it in WebSphere Process Server. Part 2 of this tutorial series shows you the steps for generating the Web interface, assembling the components, and testing the solution.

View more content in this series

Date:  15 Apr 2009
Level:  Intermediate PDF:  A4 and Letter (3098 KB | 55 pages)Get Adobe® Reader®

Activity:  13364 views
Comments:  

Implementing the invocation of the Notification service

In this section you implement the Notification service.

Creating one notification

Unfortunately you have two notification services instead of one. The functionality of both is the same, but some modeling difficulties in Business Modeler led to this situation. To solve this:

  1. Select the end point of the link (arrow) at Notification2.
  2. Drag and drop it to Notification.
  3. Delete Notification2 and arrange the contents of the parallel activities.
  4. Create a Snippet before Notification.
  5. Name it ComposeEmailMessage. This activity is necessary to compose the corresponding notification e-mail variable.

    Figure 24. Creating a single notification
    Creating a single notification


Implementing ComposeEmailMessage

In this section you implement ComposeEmailMessage using a visual Java snippet. You will create business objects and assign values to their fields.

  1. Select ComposeEmailMessage snippet.
  2. Navigate to Properties > Details.
  3. Drag and drop Email from the variables to the canvas.

    Figure 25. Implementing the ComposeEmailMessage
    Implementing the ComposeEmailMessage

  4. Click Main group > Standard Visual Snippet on the left-hand side of the palette.
  5. Select SCA and BO services/create specific BO.

    Figure 26. Adding a standard visual snippet
    Adding                                 a standard visual snippet

  6. Click OK.
  7. Select SendMailRequest for the data type.

    Figure 27. Selecting a data type
    Selecting a data type

  8. Click OK.
  9. Drop the snippet to the canvas.
  10. Link it to Email.
  11. Drag and drop Email from the variables to the canvas.
  12. Click the new Email variable on the canvas.
  13. Select the Email > message from the menu. Now you selected the message field of the Email variable.

    Figure 28. Initializing the Email variable
    Initializing the Email variable

  14. Another menu opens where you could select operators if you want. For now press Enter to exit from the context menu.
  15. Initialize Email.message from a new EmailMessage type BO by repeating steps 4-10.
  16. Drag and drop an Expression to the canvas.
  17. Click on the empty expression.
  18. Select String.
  19. Enter sendername. This is the username of the employee on behalf of whom the e-mail will be sent to the applicant.
  20. Press Enter.
  21. Drag and drop Email from the variables.
  22. Click it and select username.
  23. Link sendername to Email.username
  24. Initialize the other four fields according to Figure 29.

    Figure 29. The initialized fields of the Email variable
    The                                 initialized fields of the Email variable


Creating the SendMailCanonical interface

In this part you create the SendMailCanonical interface and use a dummy implementation of it. In part 3 of this series we will show how to implement this service as a mediation flow.

First create a canonical interface for sending e-mail. To make this available for any application that wants to use it, you must define it in HRProject_lib.

The minimum set of information you need to send an e-mail is the recipient, the subject and the message body, so you will create a type including these three pieces of information. Then you will expand it with username and password so that the sender can be authenticated.

  1. Right-click HRProject_lib > Data Types > businessitems.
  2. Select New > Business Object.

    Figure 30. Creating a new business object
    Creating a new business object

  3. Enter EmailMessage for the name.
  4. Click Finish.

    Figure 31. The EmailMessage business object
    The                                 EmailMessage business object

  5. Use the Add field button (green “a” in a circle) to add an attribute.
  6. Name it to.
  7. Set the type to string.

    You can change the type by clicking the name of the current type.

  8. Repeat steps 4-6 for the fields subject and body (see Figure 32).

    Figure 32. The fields of the EmailMessage business object
    EmailMessage business object fields

Repeat the above steps to create another business object SendMailRequest. (Refer to Figure 33 for the fields.)


Figure 33. The fields of the SendMailRequest business object
SendMailRequest business object fields

The next step is creating the canonical interface that will use the newly created business objects.

  1. Right-click the HRProject_lib > Interfaces > processes/hrprocess.
  2. Select New > Interface.

    Figure 34. Creating a new interface
    Creating a new interface

  3. Name it SendMailCanonical.
  4. Use the Add Request Response Operation button to add an operation to the interface.

    Figure 35. Adding an operation to the interface
    Adding                                 an operation to the interface

  5. Name it SendMail.
  6. Rename the input parameter to request.
  7. Change the input parameter’s type to SendMailRequest.
  8. Delete the output parameter.
  9. Add a fault parameter by clicking the x in the orange square.
  10. Rename it to fault.
  11. Leave the type as string.

    Figure 36. The operations and their parameters
    he                                 operations and their parameters


Configuring NotificationPartner

At this point you have created the necessary data types and interfaces for the Notification invoke task. Next you will set up the partner link for it.

  1. Open HRProcess process.
  2. Click NotificationPartner under Reference Partners on the upper right pane.
  3. Click Details in the Properties view.
  4. Click Browse.
  5. Select SendMailCanonical (the interface you created).

    Figure 37. Selecting the interface for the Notification task
    Selecting the interface for Notification

  6. Click OK.
  7. Next you will select the operation and the input variable for Notification.
  8. Select Notification.
  9. Click Details.
  10. Select SendMail for Operation.
  11. Click (none) in the Input(s) row of the variables table.
  12. Click New.
  13. Enter Email for the name.
  14. Click OK.

    Figure 38. The partner link for the Notification task
    Partner link for the Notification task

5 of 14 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Business process management, WebSphere
ArticleID=432422
TutorialTitle=Build and deploy a business process model using WebSphere Business Process Modeler Advanced and Lotus Forms, Part 2: Implement and test the BPEL process using WebSphere Integration Developer
publish-date=04152009
author1-email=attila_kiss_bme@yahoo.com
author1-email-cc=crothemi@us.ibm.com
author2-email=viktormuller@gmail.com
author2-email-cc=crothemi@us.ibm.com