Skip Headers
Oracle® BPEL Process Manager Order Booking Tutorial
10g Release 2 (10.1.2)
B15813-02
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

13 Using Notifications

This chapter of the tutorial describes how to add notifications.

This chapter contains the following topics:

13.1 Introduction

This phase of the tutorial adds notifications to the POAcknowledge process. Ensure that you have successfully completed the phases in Chapter 9, "Using the File Adapter's Write Functionality" and Chapter 12, "Using Sensors" before performing this phase. Notifications enable you to send notification about an event to a user, group, or destination address. You can send a notification by e-mail, voice mail, or Short Message Service (SMS). In this phase, you send an e-mail notification to confirm receipt of an order. You perform the following tasks:

13.2 Adding an E-mail Notification to the POAcknowledge Process

This section contains the following tasks:

13.2.1 Configuring Your Company E-Mail Environment

  1. Go to the Oracle_Home\integration\orabpel\system\services\config directory.

  2. Make a backup copy of the ns_emails.xml file.

  3. Open a text editor.

  4. Open ns_emails.xml and replace the values in bold with ones appropriate to your company environment.

    <EmailAccounts xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
       <EmailAccount>
          <Name>Default</Name>
          <GeneralSettings>
             <FromName>Oracle BPM</FromName>
             <FromAddress>bpm1@sunbox4254.us.mycompany.com</FromAddress>
          </GeneralSettings>
          <OutgoingServerSettings>
             <SMTPHost>sunbox4254.us.mycompany.com</SMTPHost>
             <SMTPPort>225</SMTPPort>
          </OutgoingServerSettings>
          <IncomingServerSettings>
             <Server>sunbox4254.us.mycompany.com</Server>
             <Port>2110</Port>
             <Protocol>pop3</Protocol>
             <UserName>bpm1</UserName>
             <Password ns0:encrypted="false" xmlns:ns0="http://xmlns.oracle.com/ias/pcbpel/NotificationService">welcome</Password>
             <UseSSL>false</UseSSL>
             <Folder>Inbox</Folder>
             <PollingFrequency>1</PollingFrequency>
             <PostReadOperation>
                <MarkAsRead/>
             </PostReadOperation>
          </IncomingServerSettings>
       </EmailAccount>
    
    
  5. Save your changes and exit the file.

13.2.2 Creating a Notification Activity

  1. Double-click POAcknowledge.bpel in the Applications Navigator.

  2. Drag and drop a Notification activity from the Component Palette section to below the InvokeFileOut Invoke activity.

    This starts the Notification Wizard.

  3. Click Next on the Welcome page.

  4. Select Email on the Select a Notification channel window.

  5. Enter the following details:


    Note:

    Instead of manually entering an expression, you can press Ctrl and then the space bar in the Body field. Scroll through the list of values that appear and double-click the value you want. Edit the value as necessary. As you enter information, a trailing slash can appear. This means you are being prompted for additional information. Either enter additional information, or press the Esc key and delete the trailing slash to complete the input of information.

    Field Description
    From Account Default
    To: Enter a valid e-mail address.
    Cc: Enter a valid e-mail address.
    Bcc: Enter a valid e-mail address.
    Reply To: Enter a valid e-mail address.
    Subject: PO Acknowledgment for Items Ordered and Price
    Body: Press the icon to the right of this field to display the XPath Expression Builder window. Use this window to build the following expression, and click OK when complete.

    concat(string('Dear Customer, Your order number '),bpws:getVariableData('inputVariable','payload','/ns1:PurchaseOrder/ns1:ID'),string(' for customer '),bpws:getVariableData('inputVariable','payload','/ns1:PurchaseOrder/ns1:CustID'),string(' has been confirmed. The order status is "'),bpws:getVariableData('inputVariable','payload','/ns1:PurchaseOrder/ns1:OrderInfo/ns1:OrderStatus'),string('". Thanks for using Order Booking Application from Oracle BPEL Process Manager. Administrator.'))


  6. Click Next.

  7. Click Finish.

13.2.3 Validating, Compiling, and Deploying the POAcknowledge Process

  1. Go to the Applications Navigator section.

  2. Right-click POAcknowledge.

  3. Select Deploy > LocalBPELServer > Deploy to default domain.

  4. Enter the domain password of bpel when prompted.

  5. Increment the version number again of the project when prompted and click OK (for example, enter 1.1).

    This compiles the BPEL process. Review the bottom of the window for any errors. If there are no errors, deployment was successful. If deployment was unsuccessful, see Step 5.

13.2.4 Running the POAcknowledge Process

  1. Log into Oracle BPEL Console by selecting Start > All Programs > Oracle - Oracle_Home > Oracle BPEL Process Manager 10.1.2 > BPEL Console (or refresh the page if it is already open).

    The Dashboard tab of Oracle BPEL Console appears. Note that your BPEL process, POAcknowledge, now appears in the Deployed BPEL Processes list.

  2. Click the POAcknowledge version you increased in Step 5 in the Deployed BPEL Processes list.

  3. Enter details in all fields of the HTML Form and click Post XML Message.

  4. Refresh Oracle BPEL Console.

  5. Click the Instances tab.

  6. Click the POAcknowledge instance.

  7. Click the Audit link to view progress.

  8. Check your e-mail account to verify that e-mail has been delivered (there can be an e-mail server-based delivery delay).

13.3 Summary

You have now added notification logic to the process.

With the completion of this phase, the OrderBooking process is now completely configured for order acknowledgement through e-mail notification.