Академический Документы
Профессиональный Документы
Культура Документы
John Peters
JRPJR, Inc.
john.peters@jrpjr.com
How many of you have worked with Oracle Workflow? How many of you have modified Workflow Notifications? How many of you have a minimal understanding of PL/SQL
07/19/04 NorCal OAUG Training Day, Paper 2.4 John Peters, JRPJR, Inc. 2
What you should learn from this presentation: How does Oracle Workflow build a Notification Some tips for setting up the Workflow Notification mailer Some simple customizations you can perform on Workflow Notifications
Presentation Emphasis
Primary emphasis of this presentation will be the changes to workflow notifications that are necessary for them to be sent outside of a company. The topics covered will be applicable even within a company if you want to personalize the notification messaging
Notification Components
Notifications are comprised of:
- A Notification Activity - A Message - A Message Template - Optional Message Item Attribute(s)
Notification Activity
Think of this as a container to hold and call the message from. This is what you will place on your workflow diagram. When inserting a Notification Activity on a workflow diagram remember to provide a value for the Performer. If you dont you will get a workflow runtime error about a NULL Performer.
Message
This is what contains the text you are going to send. You can format messages at Text or HTML Message Bodies can include Attributes (variables)
Resulting Message
This is the result of the HTML message body Notice the extra line Oracle Workflow Notification (FYI). This came from the message template.
10
Message Templates
Oracle comes seeded with Message Templates in the System: Mailer Item Type. In the PC Client Workflow Builder
Open the System: Mailer Item Type from the database The Internal Name is WFMAIL
11
12
13
My Customized Template
14
15
16
17
18
Message Attachments
Message Attachments are controlled by the User Preferences To suppress the Attachments choose HTML mail This can be done at the User level
19
Message Attributes
Message Attributes allow you to modify features of a Workflow Notification, without having to create separate Workflow Mailers. There are dozens of Special Message Attributes. I am only showing two here. #WFM_FROM Changes the From Email address #WFM_REPLYTO Changes the Reply To Email See the following document for more information on Message Attributes:
Oracle Workflow Developers Guide, Release 2.6.3 Part No. B1028401
20
Using #WFM_FROM
This message attribute will change the From Email Address in the Notification.
21
22
23
Create a Function
This Workflow function will set the Document Attribute values when the Workflow is run. Right mouse on Function Select New Function
24
25
26
PL/SQL Code
I have removed exception handling and other constructs to make the code easy to read. The first procedure sets the Document Attribute The second procedure builds the Document text stream.
27
28
p_document in out p_document_type in out IS v_itemtype varchar2(200); v_itemkey varchar2(200); NL VARCHAR2(1) := fnd_global.newline;
BEGIN v_itemtype := substr(p_document_id, 1, instr(p_document_id, '|') - 1); v_itemkey := substr(p_document_id, instr(p_document_id, '|') + 1, length(p_document_id) - 2);
07/19/04 NorCal OAUG Training Day, Paper 2.3 John Peters, JRPJR, Inc. 30
for arec in (select EMPNO, ENAME, JOB from scott.emp order by 2) loop p_document := p_document || '<TR>' || '<TD nowrap>' || nvl(to_char(arec.EMPNO), ' ') || '</TD>'; p_document := p_document || '<TD nowrap>' || nvl(arec.ENAME, ' ') || '</TD>'; p_document := p_document || '<TD nowrap>' || nvl(arec.JOB, ' ') || '</TD> || '</TR>' || NL; end loop; p_document := p_document || '</TABLE>'; else p_document := 'Text Document Not Implemented'; end if; END EMP_TABLE;
07/19/04 NorCal OAUG Training Day, Paper 2.3 John Peters, JRPJR, Inc. 32
33
Workflow Versioning
Workflow 1 starts with Version 1 Workflow 2 starts with Version 1 If a message change is made in Version 2 it will affect both Workflows 1 & 2
35
37
My contact information:
John Peters john.peters@jrpjr.com http://www.jrpjr.com
38