OracleAppsDNA CJ
PL/SQL document: Workflow Notification with
Dynamic HTML Body
by Shailender Thallam / July 29, 2014 / 2 Comments
sertte | Access |
temtpe FRERTWLNowieaan
ttl ane FRBOOP
igo Mane 0dr Connt
tscee8f <<
Tre [Peames =]
Frane Taget [Ful Wirdon =
Detauit
Typo [Baneant =
Value
Corea! Apel Help
To generate a HTML notification we can just write HTML code on the
message notification but unfortunately message body accepts only
content 32kb of content. If message body exceeds 32kb size then we
can go for “PL/SQL” documents, "PL/SQL CLOB" documents, and
*PL/SQL BLOB” documents. We can also use this PL/SQL documents
when we need to generate html code dynamically.
More about
"PL/SQL" Documents ~ represents data as a character string of 32KB
"PL/SQL CLOB" Documents ~ represents data as a character large object
(CLOB) of 4GB
"PL/SQL BLOB" Documents - represents data as a binary large object
(BLOB) of 4GBIn this article lets see how to create a workflow notification using
PL/SQL document to print Employee name and number from EMP table.
Create a small workflow process with 3 nodes Start node, Notification
node and End node like shown in the below screen shot.
>
START YeCNOTIE END
Create an attribute ‘XX BODY’ of ‘Document type as shown in the
below screen shot:
“Digital x/) @la| vrs) 212) a
BD
(E-E), FSTD [Stance
(2-Eh XHTM_N XHTML Notficaion)
HE Atrbunes
{Ed *_ B00" (Body conten)
Fd Processes
“i 9OLHTM_P HTML Notification Process)
BE Notes
‘eo XLNOTIF (Motion er HTML Boa)
Furetione
Ee
5: Mereasee
7 90 MSIE (Meseage of HTML Bod)
>. BCDY (Bec Convert
BB Locka Tynes
FED Director Servicerou [rie
aa
Deszrpiin
Type [Document =]
Frame Tarat [Fal Window 7
Default
ee Bes eee eee
Create a Message with display name as "Message of HTML Body" and
Internal Name as "XX_MSG". Add content to the message body as
shown in the below screen shot:
visrane [ESI] ales | Acces | Reut | c
‘subjeot [Messeae of HTML Body
Teat Body | HTML Bod |
Create a Notification with display name as “Notification for HTML Body”
and Internal Name as "XX_NOTIF". Add message, role to the newly
created notification as shown in the below screen shotAtty | Deas | Roles | Aoess|
eral are [SST
Dla Name [Neifoaton fer TWLBagy
Decigicn NeifeafonferWTWLBody
roomie] gy em
ee
funciontine [FUSES
eaxige [tere SSCS] fr
Edt
Message [Meccage of HTML Body
Expand Rates
ae ee
Heteton | Dstai | oles | Acoeed Node |Pide Atte |
Label [LNOTIF
StatiEnd [Namal ~
Comment
Timeout
Type [Ne Tneout =
<< Dacia ippsDNAcor
Type [Detouk SSS]
Peer -
Tune [Constant =]
ee aj
cet |_| He
Package Specification
1 CREATE OR REPLACE
2 PACKAGE xx_emp_wf_doc_pkg
BAS
4 PROCEDURE xx_create_wf_doc(
5 document_id IN VARCHAR2,
6 display_type IN VARCHAR2,
7 document IN OUT nocopy VARCHAR2,
8 document_type IN OUT nocopy VARCHAR2 );
END xx_emp_wf_doc_pkg;
10 /
11 SHOW errors;
12 EXIT;package Body
1 CREATE OR REPLACE
2 PACKAGE body xx_emp_wf_doc_pkg
3 AS
4 PROCEDURE xx_create_wf_doc(
5 document_id IN VARCHAR2,
6 — display_type IN VARCHAR2,
7 document IN OUT nocopy VARCHAR2,
8 document_type IN OUT nocopy VARCHAR? )
915
16 1_body VARCHAR2(32767) 5
11 BEGIN
2+
13 document_type := ‘text/html'
ae
15 body := *
16
17
18
19
Employee Name
20
Employee Number
21
22
23
245
25 ‘FOR i IN
26 (SELECT ename,empno FROM emp
27)
28 LOOP
29 ‘BEGIN
30 body := 1_body || ‘