0% found this document useful (0 votes)
122 views

Steps To Build A Workflow Notification

This document provides steps to build a workflow notification in 3 steps: 1. Create a notification in workflow and add a message. 2. Add a document type attribute to hold data regions and tables. 3. Call a PL/SQL package procedure that populates the notification by querying a database and building an HTML string with user request details.

Uploaded by

saumya333
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
122 views

Steps To Build A Workflow Notification

This document provides steps to build a workflow notification in 3 steps: 1. Create a notification in workflow and add a message. 2. Add a document type attribute to hold data regions and tables. 3. Call a PL/SQL package procedure that populates the notification by querying a database and building an HTML string with user request details.

Uploaded by

saumya333
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 10

Steps to Build a Workflow notification STEP1-:

Create a notification in workflow . Add a message in the notification . Add a document type attribute . This attribute will hold all the regions and table where the data will be shown.

Sample Notification and Message Screnshot Below.

Click on edit as shown above

G to the above marked message attribute

Click on edit and you will see how to call the procedure in from the attribute

PLSQLCLOB:XXVM_SOD_RESP_APPR_PKG.populate_curr_resp_doc/& PO_HEA DER_ID

The above pl/sql package builds the notification.

Note-: The document ID is nothing but ur PO_HEADER_ID mentioned above in RED BOLD Below is the procedure..

PROCEDURE build_notification ( document_id display_type document IN IN VARCHAR2, VARCHAR2,

IN OUT NOCOPY CLOB,

document_type IN OUT NOCOPY VARCHAR2 ) IS v_clob l_document l_end_date l_user_req_id CLOB; VARCHAR2 (32700); VARCHAR2 (360); NUMBER;

CURSOR get_access_req_info (p_user_req_id IN NUMBER) IS SELECT * from po_headers h , po_lines l Where po_header_id=po_header_id And po_header_id= p_user_req_id;

r_req_hdr_info get_access_req_info%ROWTYPE; BEGIN DBMS_LOB.createtemporary (v_clob, TRUE, DBMS_LOB.SESSION); l_user_req_id := TO_NUMBER (document_id);

IF get_access_req_info%ISOPEN THEN CLOSE get_access_req_info; END IF;

OPEN get_access_req_info (l_user_req_id);

FETCH get_access_req_info INTO r_req_hdr_info;

l_document := ' <head> <style type="text/css"> h3 {font: normal 100 12px arial } h3.thick {font-weight: 900 } h3.under {text-decoration: underline} p {font: normal 100 14px arial} </style></head>'; l_document := l_document || '<h3 class="under"><B> Please review VM Access Request No : ' || document_id || ' </B></h3>'; /*Added by kumar/krishna Starts */ l_document :=

l_document || '<TABLE border=1 cellpadding=2 cellspacing=1> <TR><TD class="x1r x4j" align=left><h3 class="thick">User Name</TD>' || '<TD class="x1l x4x" align=left><h3 class="thin">' || r_req_hdr_info.user_name || '</TD>' || '<TD class="x1r x4j" align=left><h3 class="thick">First Name</TD>' || '<TD class="x1l x4x" align=left><h3 class="thin">' || r_req_hdr_info.first_name || '</TD>' || '<TD class="x1r x4j" align=left><h3 class="thick">Last Name</TD>' || '<TD class="x1l x4x" align=left><h3 class="thin">' || r_req_hdr_info.last_name || '</TD>' || '</TR>'; DBMS_LOB.writeappend (v_clob, LENGTH (l_document), l_document); l_document := NULL; l_document := l_document || '<TR><TD class="x1r x4j" align=left><h3 class="thick">Manager First Name</TD>' || '<TD class="x1l x4x" align=left><h3 class="thin">' || r_req_hdr_info.mgr_first_name

|| '</TD>' || '<TD class="x1r x4j" align=left><h3 class="thick">Manager Last Name</TD>' || '<TD class="x1l x4x" align=left><h3 class="thin">' || r_req_hdr_info.mgr_last_name || '</TD>' || '<TD class="x1r x4j" align=left><h3 class="thick">Organization </TD>' || '<TD class="x1l x4x" align=left><h3 class="thin">' || r_req_hdr_info.organization_name || '</TD>' || '</TR>'; DBMS_LOB.writeappend (v_clob, LENGTH (l_document), l_document); l_document := NULL; l_document := l_document || '<TR><TD class="x1r x4j" align=left><h3 class="thick">Current Standard Role</TD>' || '<TD class="x1l x4x" align=left><h3 class="thin">' || r_req_hdr_info.curr_std_role || '</TD>' || '<TD class="x1r x4j" align=left><h3 class="thick">Requested Standard Role</TD>' || '<TD class="x1l x4x" align=left><h3 class="thin">' || r_req_hdr_info.req_std_role || '</TD>'

|| '<TD class="x1r x4j" align=left><h3 class="thick">Request Type </TD>' || '<TD class="x1l x4x" align=left><h3 class="thin">' || r_req_hdr_info.request_type || '</TD>' || '</TR>'; DBMS_LOB.writeappend (v_clob, LENGTH (l_document), l_document); l_document := NULL; l_document := l_document || '<TR><TD class="x1r x4j" align=left><h3 class="thick">Manager Approval Status </TD>' || '<TD class="x1l x4x" align=left><h3 class="thin" >' || NVL (r_req_hdr_info.mgr_appr_status, 'echo KSC_EXIT_STATUS $? 5') || '</TD>' || '</TR>'; /*Added by kumar/krishna ends */ DBMS_LOB.writeappend (v_clob, LENGTH (l_document), l_document); l_document := NULL; l_document := l_document || '</TABLE></TABLE>'; IF get_access_req_info%ISOPEN THEN CLOSE get_access_req_info; END IF; DBMS_LOB.writeappend (v_clob, LENGTH (l_document), l_document); l_document := NULL;

DBMS_LOB.append (document, v_clob); document_type := 'text/html'; END populate_access_req_doc;

You might also like