Oracle® BPEL Process Manager Order Booking Tutorial
10g Release 2 (10.1.2) B15813-02 |
|
Previous |
Next |
This chapter of the tutorial describes how to add notifications.
This chapter contains the following topics:
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:
Configure your company e-mail environment.
Create a notification activity in the POAcknowledge process.
Deploy the POAcknowledge BPEL process.
Run POAcknowledge from Oracle BPEL Console to send an e-mail notification.
This section contains the following tasks:
Go to the Oracle_Home
\integration\orabpel\system\services\config
directory.
Make a backup copy of the ns_emails.xml
file.
Open a text editor.
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>
Save your changes and exit the file.
Double-click POAcknowledge.bpel in the Applications Navigator.
Drag and drop a Notification activity from the Component Palette section to below the InvokeFileOut Invoke activity.
This starts the Notification Wizard.
Click Next on the Welcome page.
Select Email on the Select a Notification channel window.
Enter the following details:
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.')) |
Click Next.
Click Finish.
Go to the Applications Navigator section.
Right-click POAcknowledge.
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.
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.
Click the POAcknowledge version you increased in Step 5 in the Deployed BPEL Processes list.
Enter details in all fields of the HTML Form and click Post XML Message.
Refresh Oracle BPEL Console.
Click the Instances tab.
Click the POAcknowledge instance.
Check your e-mail account to verify that e-mail has been delivered (there can be an e-mail server-based delivery delay).