Oracle® BPEL Process Manager Order Booking Tutorial 10g (10.1.3.1.0) Part Number B28987-01 |
|
|
View PDF |
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 Control to send an e-mail notification.
This section contains the following tasks:
Go to the SOA_Oracle_Home
\bpel\system\services\config
directory.
Make a backup copy of the ns_emails.xml
file.
Open a text editor.
Open ns_emails.xml
and replace NONE
with EMAIL
for the NotificationMode
parameter. Replace the other parameter values shown in bold with ones appropriate to your company environment.
<EmailAccounts xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService" EmailMimeCharset="" NotificationMode="NONE"> <EmailAccount> <Name>Default</Name> <GeneralSettings> <FromName>Oracle BPM</FromName> <FromAddress>accountId@yourdomain.com</FromAddress> </GeneralSettings> <OutgoingServerSettings> <SMTPHost>yourdomain.com</SMTPHost> <SMTPPort>25</SMTPPort> </OutgoingServerSettings> <IncomingServerSettings> <Server>yourdomain.com</Server> <Port>110</Port> <Protocol>pop3</Protocol> <UserName>accountId</UserName> <Password ns0:encrypted="false" xmlns:ns0="http://xmlns.oracle.com/ias/pcbpel/NotificationService"> password</Password> <UseSSL>false</UseSSL> <Folder>Inbox</Folder> <PollingFrequency>1</PollingFrequency> <PostReadOperation> <MarkAsRead/> </PostReadOperation> </IncomingServerSettings> </EmailAccount> <!--EmailAccount>
Change the e-mail addresses for the users jcooper and jstein to e-mail accounts you can access. If an XML-based JAZN provider is used, these properties can be changed in
SOA_Oracle_Home\bpel\system\services\config\users-properties.xml
The following code example shows where to change e-mail addresses:
<userObject>
<name>jstein</name>
<description>Demo User</description>
<email>user2@hotmail.us.com</email>
<title>Manager2</title>
<firstName>John</firstName>
<lastName>Steinback</lastName>
<manager>wfaulk</manager>
<timeZone>America/Los_Angeles</timeZone>
<languagePreference>en-US</languagePreference>
<notificationPreferences>Mail</notificationPreferences>
</userObject>
Save your changes and exit the file.
Restart Oracle JDeveloper.
Double-click POAcknowledge.bpel in the Application Navigator.
Select Process Activities from the Component Palette section.
Drag and drop an Email service from the Component Palette section to below the InvokeFileOut Invoke activity.
Enter the following details:
Note:
Instead of manually entering an expression, you can click the icon to the right of the field to display the XPath Expression Builder to dynamically build your expression.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 OK.
Go to the Application Navigator section.
Right-click POAcknowledge.
Select Deploy > my_integration_server_connection > Deploy to default domain.
Increment the version number again of the project when prompted and click OK (for example, enter 1.1).
This compiles the BPEL process. Check for errors by clicking the buttons at the bottom of the window. If there are no errors, deployment was successful. If deployment was unsuccessful, see Step 4.
Log into Oracle BPEL Control by selecting Start > All Programs > Oracle - Oracle_Home > Oracle BPEL Process Manager > BPEL Control (or refresh the page if it is already open).
Enter the following details to log into Oracle BPEL Control and click Login:
Field | Value |
---|---|
Username | oc4jadmin |
Password | password |
Where password
is the value you entered during installation.
The Dashboard tab of Oracle BPEL Control appears. Note that your BPEL process, POAcknowledge, now appears in the Deployed BPEL Processes list.
Click the POAcknowledge version you increased in Step 4 in the Deployed BPEL Processes list.
Enter details in all fields of the HTML Form and click Post XML Message.
Refresh Oracle BPEL Control.
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).