Login
Register

Home

Trainings

Fusion Blog

EBS Blog

Authors

CONTACT US

Oracle Workflows - All Articles
  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new

Search Courses

It is a very common business need to send email notifications from Oracle Workflows.
By default the sender in these Workflow Notification emails is always picked from Workflow Global Configurations.

However in many cases, the clients demand that these workflow notification emails are sent from specific email addresses.
Effectively the sender of these notification emails must not be picked up from global workflow configurations.

For example, the sender of workflow email notifications from Learning Management Module could be This email address is being protected from spambots. You need JavaScript enabled to view it.
On similar lines, the "Sender and Reply to Address" for the email notifications sent from iRecruitment workflows could be This email address is being protected from spambots. You need JavaScript enabled to view it.
This feature is specially useful when you want the recepient of Email notifications to be able to reply to that notification email itself.


 

Therefore there is often a need to send notification emails in such a way that Sender/From Email address is specific to that workflow notification.

In this step by step demo, you will see a simple workflow that sends notification from a specific email account named "Anil Passi Testing".
The idea is to use the special Workflow attributes that can be attached to the Notification message.

If you do not implement this approach, then sender of the notification will be picked from the Workflow Global Preferences.

Steps for imlpementing this solution are

Step 1. Create a role for the Sender of Workflow Email Notification
This can be created dynamically if one does not exist, using an API named wf_directory.createadhocrole

Step 2. In your workflow, define 3 Attributes
Their names are
#FROM_ROLE
#WFM_FROM
#WFM_REPLYTO
See the sample workflow for how these attributes appear in WF Builder 

Step 3. Open the workflow builder and attach these attributes to Workflow Notification Message, by dragging these attributes to the workflow message in workflow builder

Step 4. Set these WF Attributes programmatically in PL/SQL
      wf_engine.setitemattrtext(itemtype => itemtype
                               ,itemkey  => itemkey
                               ,aname    => '#FROM_ROLE'
                               ,avalue   => 'Enter Name of the Sender Here');
      wf_engine.setitemattrtext(itemtype => itemtype
                               ,itemkey  => itemkey
                               ,aname    => '#WFM_FROM'
                               ,avalue   => 'Enter Name of the Sender Here');

      wf_engine.setitemattrtext(itemtype => itemtype
                               ,itemkey  => itemkey
                               ,aname    => '#WFM_REPLYTO'
                               ,avalue   => 'Enter the Senders Email Address Here');

In reality, you can set these WF Attributes to the desired values as per your logic


In this example, the email from workflow notification will look as shown below.
Notice that sender is specific to our business requirement.


To replicate this test case on your eBusiness Suite environment is two step process.

Step 1. Right click to Save this workflow on your file system. Then open this wft file in WF Builder and save to Database.
http://www.apps2fusion.com/training_demo/anilpassi/wf_override_sender/XXTEST.wft 
Note- this workflow will send notification to SYSADMIN from desired email address.

Step 2. Run the below SQL to kick off this workflow and set the special attributes. 
Within 3 minutes the email should be sent out by notification mailer.

DECLARE
  l_itemkey    VARCHAR2(100);
  v_role_name  VARCHAR2(100) := 'Anil Passi Testing';
  v_role_email VARCHAR2(100) := This email address is being protected from spambots. You need JavaScript enabled to view it.';
  n_count_role INTEGER := 0;
BEGIN
  SELECT COUNT(*)
  INTO n_count_role
  FROM wf_local_roles
  WHERE NAME = v_role_name;
  IF n_count_role = 0
  THEN
    --If the sender does not exist in WF Local Roles, then create one on the fly
    wf_directory.createadhocrole(role_name       => v_role_name
                                ,role_display_name        => v_role_name
                                ,role_description           => v_role_name
                                ,notification_preference => 'MAILHTML'
                                ,email_address             => v_role_email
                                ,status                       => 'ACTIVE'
                                ,expiration_date           => NULL);
    dbms_output.put_line('Ad Hoc Role Created');
  ELSE
    dbms_output.put_line('Ad Hoc Role Already Exists');
  END IF;

  SELECT oe_order_headers_s.NEXTVAL
  INTO l_itemkey
  FROM dual;
  wf_engine.createprocess('XXTEST'
                         ,l_itemkey
                         ,'XXTEST');
  wf_engine.setitemuserkey(itemtype => 'XXTEST'
                          ,itemkey  => l_itemkey
                          ,userkey  => l_itemkey);
  wf_engine.setitemowner(itemtype => 'XXTEST'
                        ,itemkey  => l_itemkey
                        ,owner    => 'SYSADMIN');

--The three API calls in bold is what you need.
  wf_engine.setitemattrtext(itemtype => 'XXTEST'
                           ,itemkey  => l_itemkey
                           ,aname    => '#FROM_ROLE'
                           ,avalue   => v_role_name);
  wf_engine.setitemattrtext(itemtype => 'XXTEST'
                           ,itemkey  => l_itemkey
                           ,aname    => '#WFM_FROM'
                           ,avalue   => v_role_name);
  wf_engine.setitemattrtext(itemtype => 'XXTEST'
                           ,itemkey  => l_itemkey
                           ,aname    => '#WFM_REPLYTO'
                           ,avalue   => v_role_email);
  wf_engine.startprocess('XXTEST'

                        ,l_itemkey);
  COMMIT;
END;
/

To test your notifications, run this SQL
SELECT *
FROM wf_notifications
WHERE message_name = 'XX_TEST' AND message_type = 'XXTEST' ;


IMPORTANT- Given that our workflow in this demo will send notifications to SYSADMIN, ensure that SYSADMIN does have an email address associated.
This can be checked by running SQL as below
SELECT email_address FROM WF_LOCAL_ROLES WHERE NAME like 'SYSADMIN%';

The Workflow process used for this demo is a very simple workflow, as shown below

The attributes at workflow level are as shown below

Item Type : XXTEST

Internal Name : #WFM_FROM

Display Name : #WFM_FORM

Description  :

Type : Role

XXTEST

Item Type : XXTEST

Internal Name : #WFM_REPLYTO

Display Name : #WFM_REPLYTO

Description  :

Type : Text

XXTEST

Item Type : XXTEST

Internal Name : #FROM_ROLE

Display Name : #FROM_ROLE

Description  :

Type : Role


Anil Passi

Comments   

0 #1 Naoufel MAMI 2009-02-01 04:59
It works. Thanks alot and keep updated.

rgds
Naoufel
Quote
0 #2 Venkat Reddy Pulichintha 2009-02-15 03:37
HI Anil,
While upload the http://www.apps2fusion.com/training_demo/anilpassi/wf_override_sender/XXTEST.wft workflow. I am getting below error. I am very new in Workflow
Please help me out. What i am doing the mistaken.
1602: Could not save.
1400: Could not save to database. MODE=UPLOAD EFFDATE=2009/02 /15 12:28:20
1404: Please first load this entity or check protect and custom level of ITEM_TYPE 'XXTEST'.


Tha nks
Venkat Reddy Pulichintha
Quote
0 #3 Aymen 2009-03-04 10:07
Hi,

Can we send a notification using just Business event subscription without using Oracle workflow ?

Thanks
Quote
0 #4 Anil Passi 2009-03-04 15:54
You need to subscribe a Workflow to send notification.

Alternately send the notification using the PL/SQL API, as shown in URL below

apps2fusion.com/apps/workflows/219-open-source-in-oracle-apps-generic-workflow-notification-api

Thanks,
Anil Passi
Quote
0 #5 Elena 2009-04-03 04:04
Hi Venkat,

I have found this site yesterday and I got the same error.
XXTEST process doesn't have and effective date that's why you got this error.
As well it open in Read-Only mode.

I have made the same process manually and it worked for me. It put the effective date.

Regards,
Jelena
Quote
0 #6 Sreenivasa 2009-05-25 08:16
Hi Anil,

I am getting the following error when trying to execute my custom workflow. Please advice.

1. Compiled the package in APPS schema.
2. Uplaoded the wft file.
3. Then tried to invoke the WF using the following code:

DECLARE
l_itemkey VARCHAR2(100);
v_role_name VARCHAR2(100) := 'SYSADMIN';
v_role_email VARCHAR2(100) := 'XXXX';
n_count_role INTEGER := 0;
BEGIN

SELECT xxitdcus.demand _seq_s.NEXTVAL
INTO l_itemkey
FROM dual;
wf_engine.creat eprocess('ITDDM DIN'
,l_itemkey
,'ITD_DEMAND_AP PROVAL');
wf_engine.setit emuserkey(itemt ype => 'ITDDMDIN'
,itemkey => l_itemkey
,userkey => l_itemkey);
wf_engine.setit emowner(itemtyp e => 'ITDDMDIN'
,itemkey => l_itemkey
,owner => 'SYSADMIN');

wf_engine.start process('ITDDMD IN'
,l_itemkey);
COMMIT;
END;
/


Error in Workflow ITDDMDIN/1006 ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'SET_STATUS_APP R'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored


Thank s & Regards,
Sreeni vasa
Quote
0 #7 Sujit M Sakalkale 2009-05-30 02:38
Hi Anil,

Can we send work flow notification from Alert?
Quote
-2 #8 Pure White Gold Halendi Ugg Sandals 2009-07-28 22:13
My wife-to-be and I were at the county clerk's office for our marriage license.Sand Classic Mini Ugg Boots After recording the vital information -- names, dates of birth, etc. -- the clerk handed me our license and deadpanned,Amethyst Gypsy Ugg Sandals "No refunds, no exchanges, no warranties."
Quote
0 #9 grace de guzman 2009-09-18 23:13
We have "Approve" and "Reject" link below the notification mail. Is it possible to approve/reject the notification on the email itself, thus the approver need not to log in to Oracle? Kindly advise.

When the approver clicks the "Approve" or "Reject" link, it will create an email addressed to the wf mailer. But the notification was not really approved or rejected upon checking its status.

Thank you very much!
Quote
0 #10 CC 2009-10-21 14:18
Hi Anil,

workflow error messages are currently send to sysadmin email address. I want to change the sysadmin email address. can yo tell me where can i change the sysadmin email address.

thank s
CC
Quote
0 #11 ugg sale 2009-11-12 19:59
NFL Jerseys discount nfl jerseys cheap nfl jersey wholesale nfl jerseys
discoun t ugg boots ugg classic cardy ugg sale buy ugg boots
timberland boots timberland shoes discount timberland Classic Timberland
ugg store ugg boots online ugg sale discount ugg
cell phone audio electronics buy Mp4 Players Hair Straighteners
u gg boots online discount ugg boots cheap ugg new ugg boots
ed hardy store ed hardy caps ed hardy clothing ed hardy jeans
UGG boots ugg discount ugg boots sale ugg cardy
Quote
+1 #12 Jyoti S 2010-02-19 16:44
Hi Anil,
You are a life saver, your articles are very user friendly, appreciate the services you are giving for new comers to this horizon.
Coming to my question: I have the roles defined with an associated email, so i assume that i can skip the adhocrole portion of your code and use the rest, but can i use the same process to send the email to multiple ids how do i do that, and as the output that i want to send - comes from a sql , can i use a sql here?

Thanks,
Jyoti
Quote
0 #13 Anil Passi- 2010-02-19 17:52
Hi J

wf_directory also has another API for adding users to a role. I request you check the API as I dont remember exact name of that API

Thanks,
AP
Quote
0 #14 Anil Passi- 2010-02-19 17:54
Simply google on
open source oracle workflow notifications

This should take you to the article that contains source code for download

Thank s,
Anil Passi
Quote
0 #15 Somnath 2010-03-24 03:16
Hi AP,
I want to send multiple records in a notification with a table format.How to do that . please help.

Somnath
Quote
0 #16 vibram 2010-07-13 21:44
i believe you are a good writer
Quote
0 #17 LFG 2010-08-16 05:24
Hi Anil , if I want to send in a notification other information like start date and hour of the process, end date date and hour of the process, number of records loaded, bad records, etc, etc....how can I do this????

Thank s you very much
Quote
0 #18 M.S.R 2010-12-27 05:19
Hi,
Can any one help me on the requirement like
I want to send the wf notifications to a specific emial address which are not related to the oracle users
Quote
0 #19 nfl jerseys 2011-01-11 20:43
Coming to my question: I have the roles defined with an associated email, so i assume that i can skip the adhocrole portion of your code and use the rest, but can i use the same process to send the email to multiple ids wholesale nfl jerseys how do i do that, and as the output that i want to send - comes from a sql , can i use a sql here?
Quote
0 #20 NDG 2011-01-25 03:54
Hi,
I have set the outlook express template using OAM,I want the approval notification to go to outlook express mail from where the approver can directly approve or reject,How it can be done?
Quote
-1 #21 nike outlet 2011-02-23 08:40
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam iaculis iaculis quam. Donec eu dui. Morbi quis nulla. Integer vulputate sollicitudin est. Integer a sem in tortor interdum faucibus.
Quote
0 #22 laurent 2011-03-03 22:18
Your article is very interesting,and thank you for your introduction.I have yves saint laurent sunglassesa good shopping website,I'd like to introduce you, hope you like it!
Quote
0 #23 cheap nike shoes 2011-05-20 08:48
wholesale christian audigier jeans
christian audigier Short jeans
Quote
0 #24 waytowholesale 2011-05-23 05:10
Newest Jordan 26

http://www.waytowholesales.com/product_list-Jordan-26-c___867.html

Payment: Paypal, Western Union, Money Gram, T/T.
Delivery time: 5-7 days
Accept Wholesale , Dropshipping, Retail Order. , the more quantity you order and the lower price you get .
For more new selection ,

Please check in : http://www.waytowholesale.com
Quote
0 #25 authentic air jordan shoes 2011-07-05 21:31
Open the workflow builder and attach these attributes to Workflow Notification Message, by dragging these attributes to the workflow message in workflow builder
Quote
0 #26 Herve Leger dresses 2011-07-11 22:34
;D ;D ;D ;D ;D
Quote
0 #27 Tarun 2011-09-21 12:23
Man you are a genius, u saved me, all day I was trying to implement this and here you have the complete solution. Thanks dude and please keep up the gud work of serving the community. You have a self less quality which less people have these days.
Quote
0 #28 krsrasu 2011-10-17 21:42
Hi Anil

I have faced the following error in the quality notification workflow. what could be the reason and how to debug?
Approval workflow failed due to the following error message

Error :E ; Cannot fetch xxx results - Unable to fetch the xxx details

please help

rgds
krsr asu
Quote
0 #29 coach factory 2011-10-27 02:58
Produced from black leather and layed out with silver metal hardware and studs, this Coach Madison Bags has additional something than an regular black bag. The shoulder straps are attached towards the bag by rings, along with the bag shuts obtaining a drawstring top. I kinda such as this bag- it’s a little Coach Poppy Bags but nonetheless chic and practical.
——————FROM:QL
Quote
0 #30 storage website 2011-10-27 11:32
These ingredients could be neatly stored in racks behind cupboard doors.
Quote
0 #31 smita 2011-11-03 20:34
Hello,
I have added a custom sub process to the seeded "OM Order Header" workflow. The process sends a notification. There are a few attributes in the body of the message tied to this notification, to which I am trying to assign values to using the syntax:
SetItem AttrText (itemtype, itemkey, attrname, attrvalue).
I have the internal names for the item type and attribute name, but don't know how to get the value for the item key. I understand the item key is supposed to be unique for each item type and is automatically generated by the workflow engine when the work flow fires. Is there a built-in function or some means to get this value?
Regards,
Smita
Quote
0 #32 Akram 2012-03-25 08:40
Thank you
Quote
0 #33 Mamta 2012-04-05 06:08
Hi Anil,

I need to know to whom all the mails sent by workflow in a day.Please assist if you have any idea.

Thanks,
mamatha
Quote
0 #34 www.todsshoessale2012.com 2012-06-19 03:04
Sometimes u need to look back, otherwise u Tod's Mens Heaven Laccetto will never know what u have lost in the way of forever searching.
Quote
0 #35 xiaoa 2012-06-19 04:35
Also, thank you to Abby from the Beaver Dam High School who did face painting for children and to Doodlebugs

the clown who was an awesome hit with the children.

This day couldn’t have gone any better than it did. I thank everyone who

www.ukchristianlouboutinuk.com showed up on Thursday night

to help put the rods and reel together at John’s. I also thank John Biel for the use of the back room for the

night.

I also thank everyone who helped the day of the event. It couldn’t have gone as well as it did with out all

of you that helped out. Many thanks to you all.
Quote
-1 #36 Marc Jacobs handbags 2012-07-04 23:16
In between the vital techniques in individuals creatures, communal techniques can be thought of given that the a good number of crucial.
Quote
0 #37 Janel 2014-09-18 21:56
Hi Ani,
I don't know if you are still monitoring this, but here goes...I'm wondering if the #WFM_FROM attribute HAS to be set programmaticall y in order for this to work? After I added it to the notification, I changed it to the Preparer User Name, but the email is still coming to me from the Workflow Mailer address. Just wondering if that should have worked for me? Thanks!
Quote
+1 #38 Anil Passi.. 2014-09-18 23:00
Please ensure the value you set, is a valid value from wf_local_roles name column. I assume you are not setting this programatically in a loop, if so, you need to set some reset property in Notification. Its been 6yrs since I touched Oracle Workflow builder :(
But yes, programatic setting will 100% work.
Raise a SR if it doesnt work
Quote
0 #39 charchumallrohini 2014-10-13 11:11
Sir,
In Oracle Hrms when am applying for a leave one manager receives a notification on approval while other manager is not receiving the same notification (if one employee is having two managers and one manager is getting notification and the other is not getting) for approval what can be done?
Quote
0 #40 Joel 2021-07-06 20:49
Hi to all, the contents present at this site are in fact remarkable for people knowledge,
well, keep up the good work fellows.

My blog - Joel: https://www.ivisitredding.com/author/toastneck31/
Quote
0 #41 bachelor party 2021-07-08 18:13
I'm gone to inform my little brother, that he should also
visit this webpage on regular basis to take updated from
latest news.

Check out my page :: bachelor party: http://www.ikeanded.com/directory/listingdisplay.aspx?lid=75338
Quote
0 #42 Acedirectory.org 2021-07-08 23:41
Good replies in return of this matter with real arguments and describing
all on the topic of that.

My site: Acedirectory.or g: https://acedirectory.org/listing/bachelor-party-las-vegas-410799
Quote
0 #43 Ketan 2022-05-16 11:04
How to remove FYI from the subject?
Quote
0 #44 MelvinWoume 2022-08-31 00:14
yacht rental mahe
Quote
0 #45 EurosegelnGek 2022-08-31 10:56
katamaran mieten seychellen
Quote
0 #46 lapplebiBon 2022-09-01 11:07
получение Root прав
Quote
0 #47 continentnox 2022-09-04 02:56
купить номер великобритании
Quote
0 #48 virtual-localHaine 2022-09-04 10:16
online phone number canada
Quote
0 #49 lovevasilyeva 2022-09-09 02:26
уличный фотограф спб
Quote
0 #50 SteamSam 2022-09-19 14:20
https://steamauthenticator.net/
Quote

Add comment


Security code
Refresh

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  Mar 2024  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
      1  2  3
  4  5  6  7  8  910
11121314151617
18192021222324
25262728293031

Enquire For Training

Fusion Training Packages

Get Email Updates


Powered by Google FeedBurner