They can be achieved in many ways using Workflow, PL/SQL, host file etc. As we are all getting geared up for Fusion Middleware, I wanted to explore the option of using BPEL process. In my article, I will create a bpel process which it scheduled to send email notifications say every 30 min. For simplicity I will do this in two steps which are covered in two articles.
1. Create a bpel process which sends email notification.
2. Schedule the above bpel process to run every 30 min.
This article covers the sending emails using BPEL process. Before I go into the steps of implementing email notification, I will brief you about the environment I'm using for this article.
Environment for this article
- SOA Suite 10.1.3.1 Basic Installation. So it uses Oracle Lite database.
- JDeveloper 10.1.3.3.0
For setting up the environment, refer to the SOA Suite Installation article.
The problems I've faced during installation are:
- Internet Explorer 7.0 - I was getting "The procedure entry point GetProcessImageFileNamew could not be located in the dynamic link library PSAPI.dll" error message at 99% of installation progress bar. So I had to uninstall IE 7.0 to get it working. Funny thing is after you install SOA Suite, you can install IE 7.0 and it works perfectly.
- Firewall - My McAfee firewall blocked opmn service. So the Recommended installation was failing during installation. Disable your firewall or make exclusion list during installation.
The above two problems were resolved after 4 hrs OWC session with Oracle Support.
You can continue with the later part of the article, if your environment is set up.
BPEL Process using Email Activity
Notification services in BPEL are exposed as web services. The notification service sends email using SMTP and receives email from IMAP-based or POP-based email accounts. You can use Email activity in the component palette to add email notification of BPEL process. You can directly enter the required and optional email addresses and message content (subject and body) or you can use the following built-in functions:
-
Identity lookup dialog: Browse the user directory that is configured for use by Oracle BPEL Process Manager—Oracle Internet Directory (OID), JAZN/XML, LDAP, and so on.
-
XPath Expression Builder: For recipient email addresses (To, Cc, Bcc, Reply To), you can use the XPath Expression Builder to get email addresses dynamically from the input.
For my example, I will directly enter the recipient email address, subject and body in email activity fields.
Before using email activity, you must set up configuration details for email accounts in the ns_emails.xml file, found at <SOAHOME>\bpel\system\services\config
Configuring Email Accounts in ns_emails.xml:
ns_emails.xml is found in <SOAHOME>\bpel\system\services\config folder.
1. Make a backup copy of the ns_emails.xml file.
2. Open ns_emails.xml in Text Editor and Change the NotificationMode from "NONE". NotificationMode can be set to the following:
- EMAIL - If you have only email setup, but not other channels like voice, SMS, fax, etc.
- ALL - if you have email and other channels like voice, SMS, fax, etc. set up.
I will be using only email, so I have set NotificationMode to "EMAIL".
3. Configure Default EmailAccount. When Email activity is selected in BPEL process, From Account field is defaulted with "Default". If "Default" email account is not configured in ns_emails.xml, email notification is not sent to the recipient.
Also this account is used when no account is specified to receive an email notification. This account is also used to send task-related notifications. A default email account must always be specified in the configuration file i.e ns_emails.xml
Change FromAddress, OutgoingServerSettings, IncomingServerSettings elements to your desired email address and your smtp host name as below.
4. This step is Optional. Define the parameters for the additional email account with an additional <EmailAccount> </EmailAccount> structure. For Example: If I defined 'Apps2Fusion' email account, I can use 'Apps2Fusion' in From Account field in Email activity.
<EmailAccount>
<Name>Apps2Fusion</Name>
<GeneralSettings>
...
</GeneralSettings>
<OutgoingServerSettings>
...
</OutgoingServerSettings>
<IncomingServerSettings>
...
</IncomingServerSettings>
</EmailAccount>
5. Save ns_emails.xml
Configuring wf_config.xml:
wf_config.xml is found in <SOAHOME>\bpel\system\services\config folder. It is a workflow configuration file.
Add the below property to wf_config.xml
<property name="oracle.bpel.services.notification.publisher_interval" value="1" />
This property specifies the interval for sending notifications. If this property is absent, the notifications are sent every 15 mins (default) or after starting the SOA Suite.
Once the cofiguration files i.e ns_emails.xml and wf_config.xml are edited, Start your SOA Suite and JDeveloper. If you have already started SOA Suite before editing these configuration files, restart the SOA Suite.
Creating Email Activity in BPEL Process
Open SOA Launch Console and Click on Application Server Control link.
Login with username/password and go to Runtime Ports link at the bottom.
Write down the RMI port number. We will use this port for creating Application Server connection in JDeveloper.
RMI Port 12401 is fetched from above screenshot.
Now I will create Asynchronous BPEL project. My BPEL process looks like in below screenshot.
Configure the fields in Email activity. From Account is defaulted with 'Default' email account name. Default email account settings are taken from ns_emails.xml
You can also use XPath Builder to set the fields dynamically from input variables.
Now Login to BPEL Control and Click on the process name in the dashboard.
Click on Post XML Message to manually kick off the process.
But the message text came as an attachment. So I went back to my email activity and unchecked Multipart message attachments. I've deployed and ran the process again.
Bravo !!! I got the email notification as I wanted.
You can view the flow and the xml data at each activity. Click on Instances in BPEL Console, then Flow tab.
To revise the whole process to send email notifications, I'm briefing the steps below:
- Set your SOA Suite enviroment for development.
- Configure ns_emails.xml and wf_config.xml
- CreateAsynchronous BPEL Process
- Create Email acitivity and enter values for To, Subject and Body fields
- Save and Deploy the Process
- Manually initiate the process
- Check the email
In this article, I've manually initiated the process to send notification. I will automate this step to schedule the bpel process in the next article.
Set as favorite
Bookmark
Email This
Hits: 2618
Comments
(13)
Password
written by Raj1 , September 16, 2008
written by Raj1 , September 16, 2008
what is the default password for login oc4jadmin ?
Votes: +0
report abuse
vote down
vote up
Re: oc4jadmin password
written by kishore Ryali , September 16, 2008
written by kishore Ryali , September 16, 2008
If you installed SOA Suite, then you will be providing oc4jadmin password at the installation. So it cannt help you in that case. Otherwise if you installed BPEL Process Manager, default password is welcome1
Kishore
Votes: +0
Kishore
report abuse
vote down
vote up
...
written by Raj1 , September 16, 2008
written by Raj1 , September 16, 2008
Thanks for the update. I tried welcome1. The step 4 of 4 (Connection Status) is running forever. Not sure what else I am missing. Yes, I have installed BPEL Process Mgr and not SOA suite.
Votes: +0
report abuse
vote down
vote up
...
written by kishore Ryali , September 17, 2008
written by kishore Ryali , September 17, 2008
Raj,
Did you start BPEL Process Manager from Start > Programs ?
If yes, try to login to Application Server Control and BPEL console page.
If you cannot, then your opmn or olsv2040 (Oracle Lite Database) services are not running.
Kishore
Votes: +0
Did you start BPEL Process Manager from Start > Programs ?
If yes, try to login to Application Server Control and BPEL console page.
If you cannot, then your opmn or olsv2040 (Oracle Lite Database) services are not running.
Kishore
report abuse
vote down
vote up
Need Help
written by Nilesh Parekh , September 25, 2008
written by Nilesh Parekh , September 25, 2008
Can you please shed some light on how we can define an Oracle Concurrent Request as a Web Service and call it through BPEL process?
For example:
If we have to fetch some data from 12i using some criteria (for example: employee information should be fetched based on the date parameter provided by user), if we develop a concurrent program to fetch the data, how to define this concurrent request as a web service and develop a BPEL process to access the same and use EBS to write the fetched information to a file using file adapter and to database using database adapter?
Thank you very much in advance!
Nilesh
Votes: +0
For example:
If we have to fetch some data from 12i using some criteria (for example: employee information should be fetched based on the date parameter provided by user), if we develop a concurrent program to fetch the data, how to define this concurrent request as a web service and develop a BPEL process to access the same and use EBS to write the fetched information to a file using file adapter and to database using database adapter?
Thank you very much in advance!
Nilesh
report abuse
vote down
vote up
Re: Nilesh
written by kishore Ryali , September 25, 2008
written by kishore Ryali , September 25, 2008
Hi Nilesh,
I didnt understand your example clearly. If you want to fetch some data from database using some criteria, why do you need concurrent program for it? You can use database adapter to call a stored procedure and write it into a file/table depending upon what you want to do.
Regarding concurrent program , you can define a Apps Adapter (http://apps2fusion.com/at/pb/5...-article-i) and create a wrapper around "fnd_request" api (or) define a Database Adapater which calls a stored procedure which make call to fnd_request API.
Kishore
Votes: +0
I didnt understand your example clearly. If you want to fetch some data from database using some criteria, why do you need concurrent program for it? You can use database adapter to call a stored procedure and write it into a file/table depending upon what you want to do.
Regarding concurrent program , you can define a Apps Adapter (http://apps2fusion.com/at/pb/5...-article-i) and create a wrapper around "fnd_request" api (or) define a Database Adapater which calls a stored procedure which make call to fnd_request API.
Kishore
report abuse
vote down
vote up
Problem in sending Email notification from BPEL
written by harinathd2003 , September 26, 2008
written by harinathd2003 , September 26, 2008
Hi Kishore,
I am trying to send email from BPEL using Email activity.
I configured the ns_emails.xml file properly as below.
when i run the process, it is executing fine without any error.
but i am not receiving any mail.
Default
Oracle BPM
\n This e-mail address is being protected from spambots. You need JavaScript enabled to view it '> This e-mail address is being protected from spambots. You need JavaScript enabled to view it
smtp.gmail.com
465
pop.gmail.com
995
pop3
\n This e-mail address is being protected from spambots. You need JavaScript enabled to view it '> This e-mail address is being protected from spambots. You need JavaScript enabled to view it
12345
false
Inbox
1
Could any one suggest me the solution for this problem.
is there anything extra need to be configured for this..
Thanks in advance.
Thanks,
Hari
Votes: +0
I am trying to send email from BPEL using Email activity.
I configured the ns_emails.xml file properly as below.
when i run the process, it is executing fine without any error.
but i am not receiving any mail.
Default
Oracle BPM
\n This e-mail address is being protected from spambots. You need JavaScript enabled to view it '> This e-mail address is being protected from spambots. You need JavaScript enabled to view it
smtp.gmail.com
465
pop.gmail.com
995
pop3
\n This e-mail address is being protected from spambots. You need JavaScript enabled to view it '> This e-mail address is being protected from spambots. You need JavaScript enabled to view it
12345
false
Inbox
1
Could any one suggest me the solution for this problem.
is there anything extra need to be configured for this..
Thanks in advance.
Thanks,
Hari
report abuse
vote down
vote up
Re: Hari
written by kishore Ryali , September 26, 2008
written by kishore Ryali , September 26, 2008
Hari,
I doubt whether you will be able to send using gmail as outgoingserver without authentication
You can test it by configuring outlook with the settings you used, to send email.
If it works, it will definitely work with BPEL Server.
Kishore
Votes: +0
I doubt whether you will be able to send using gmail as outgoingserver without authentication
You can test it by configuring outlook with the settings you used, to send email.
If it works, it will definitely work with BPEL Server.
Kishore
report abuse
vote down
vote up
Problem in sending Email Notification from BPEL
written by harinath , September 27, 2008
written by harinath , September 27, 2008
Hi Kishore,
I tested it by configuring outlook with the settings and able to send email using gamil as outgoingserver with authentication only.
--- ns_email.xml---------
I added one more tag to ns_email.xml as below
true
and changed USeSSL tag to true.
But still i am not receving email.
And moreover i am getting error as below
ORABPEL-00000
Exception not handled by the Collaxa Cube system.
An unhandled exception has been thrown in the Collaxa Cube system. The exception reported is: "ORABPEL-10328
Error in sending e-mail message.
Error in sending e-mail message.
at oracle.tip.pc.services.notification.DefaultNotificationServiceImpl.sendEmailNotification(DefaultNotificationServiceImpl.java:256)
at oracle.tip.pc.services.notification.NotificationServiceImpl.sendEmailNotification(NotificationServiceImpl.java:271)
at oracle.bpel.services.notification.queue.sender.MDBConsumer.deliverNotification(MDBConsumer.java:256)
at oracle.bpel.services.notification.queue.sender.MDBConsumer.onMessage(MDBConsumer.java:137)
at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
at com.evermind.server.ejb.MessageDrivenConsumer.onMessage(MessageDrivenConsumer.java:347)
at com.evermind.server.ejb.MessageDrivenConsumer.processMessages(MessageDrivenConsumer.java:233)
at com.evermind.server.ejb.MessageDrivenConsumer.run(MessageDrivenConsumer.java:169)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExec
Do you have any idea why i am getting this error.
Thanks,
Hari
Votes: +0
I tested it by configuring outlook with the settings and able to send email using gamil as outgoingserver with authentication only.
--- ns_email.xml---------
I added one more tag to ns_email.xml as below
true
and changed USeSSL tag to true.
But still i am not receving email.
And moreover i am getting error as below
ORABPEL-00000
Exception not handled by the Collaxa Cube system.
An unhandled exception has been thrown in the Collaxa Cube system. The exception reported is: "ORABPEL-10328
Error in sending e-mail message.
Error in sending e-mail message.
at oracle.tip.pc.services.notification.DefaultNotificationServiceImpl.sendEmailNotification(DefaultNotificationServiceImpl.java:256)
at oracle.tip.pc.services.notification.NotificationServiceImpl.sendEmailNotification(NotificationServiceImpl.java:271)
at oracle.bpel.services.notification.queue.sender.MDBConsumer.deliverNotification(MDBConsumer.java:256)
at oracle.bpel.services.notification.queue.sender.MDBConsumer.onMessage(MDBConsumer.java:137)
at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
at com.evermind.server.ejb.MessageDrivenConsumer.onMessage(MessageDrivenConsumer.java:347)
at com.evermind.server.ejb.MessageDrivenConsumer.processMessages(MessageDrivenConsumer.java:233)
at com.evermind.server.ejb.MessageDrivenConsumer.run(MessageDrivenConsumer.java:169)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExec
Do you have any idea why i am getting this error.
Thanks,
Hari
report abuse
vote down
vote up
...
written by kishore Ryali , September 27, 2008
written by kishore Ryali , September 27, 2008
Hari,
I didnt try with gmail outgoing server.
The below link may provide with some information.
http://forums.oracle.com/forums/thread.jspa?messageID=2642340
Kishore
Votes: +0
I didnt try with gmail outgoing server.
The below link may provide with some information.
http://forums.oracle.com/forums/thread.jspa?messageID=2642340
Kishore
report abuse
vote down
vote up
Mr.
written by saikrishnapanuganti , December 18, 2008
written by saikrishnapanuganti , December 18, 2008
nice..example
I need to have a 3 bpel processes which executes in three different intervels.
or can we schedule the same bpel to execute in 3 different intervels that sends email notification.
-Saikrishna
Apps Associates
Votes: +0
I need to have a 3 bpel processes which executes in three different intervels.
or can we schedule the same bpel to execute in 3 different intervels that sends email notification.
-Saikrishna
Apps Associates
report abuse
vote down
vote up
Mr.
written by saikrishnapanuganti , December 18, 2008
written by saikrishnapanuganti , December 18, 2008
and one more question, how does the property correlating to the bpel we have deployed that sends an email notification..as we could have many bpels deployed that sends email notifications..
-saikrishna
Votes: +0
-saikrishna
report abuse
vote down
vote up
Re: saikrishnapanuganti
written by kishore Ryali , December 19, 2008
written by kishore Ryali , December 19, 2008
Hi Sai,
The second part of this article says about scheduling bpel process using dbms_scheduler package. If you want schedule bpel process to run in 3 different interval, you can play with parameter "repeat_interval" or schedule 3 jobs at those intervals.
To make this bpel process generic, you can input parameter for recipient email address in Email Activity the and set it using Assign Activity.
Kishore
Votes: +0
The second part of this article says about scheduling bpel process using dbms_scheduler package. If you want schedule bpel process to run in 3 different interval, you can play with parameter "repeat_interval" or schedule 3 jobs at those intervals.
To make this bpel process generic, you can input parameter for recipient email address in Email Activity the and set it using Assign Activity.
Kishore
report abuse
vote down
vote up



