DBA Data[Home] [Help]

PACKAGE BODY: APPS.PSP_ER_WF_CUSTOM

Source


1 package body psp_er_wf_custom as
2 /* $Header: PSPERWCB.pls 120.0.12010000.2 2008/08/05 10:11:38 ubhat ship $ */
3 procedure set_custom_wf_admin(itemtype IN  varchar2,
4                               itemkey  IN  varchar2,
5                               actid    IN  number,
6                               funcmode IN  varchar2,
7                               result   OUT nocopy varchar2) is
8  l_wf_role wf_roles.name%type;
9 begin
10   --- Set the  WF admin to the WF Role u need
11   --- sample code below. This custom Role will override the seeded
12   -- behavior. The product is shipped with  WF Administrator set to
13   -- WF role of the  Effort Report process  INITIATOR person.
14   --
15   -- The significance of WF Administrator in a Workflow thread,
16   -- is that this WF role(or person) will
17   -- receive all error notifications, he/she can take
18   -- take appropriate action to fix the cause for error and
19   -- and then  Submit the WF thread for RETRY.
20     /* wf_engine.SetItemAttrText(itemtype => itemtype,
21                                 itemkey    => itemkey,
22                                 aname      => 'WF_ADMINISTRATOR',
23                                 avalue     => l_wf_role);
24         result := 'COMPLETE'; */
25      null;
26 EXCEPTION
27 WHEN OTHERS THEN
28   result := 'ERROR';
29   wf_core.context('PSP_EFFORT_REPORTS', 'SET_CUSTOM_WF_ADMIN', itemtype, itemkey,
30                    to_char(actid), funcmode);
31    raise;
32 end set_custom_wf_Admin;
33 
34 
35 procedure set_custom_timeout_approver(itemtype IN  varchar2,
36                                       itemkey  IN  varchar2,
37                                       actid    IN  number,
38                                       funcmode IN  varchar2,
39                                       result   OUT nocopy varchar2) is
40 
41   l_new_display_name   wf_roles.display_name%TYPE; -- Bug 6641216
42   l_new_user_name      fnd_user.user_name%TYPE;    -- Bug 6641216
43 
44 
45 begin
46 
47    --   set the time out approver, by default notification is
48    -- the inbox of the approver. If a different approver is
49    -- set, the notification moves from the approver to a different
50    -- approver.
51    -- Example below:
52       /*  wf_engine.SetItemAttrText(itemtype => itemtype,
53                                     itemkey  => itemkey,
54                                     aname    => 'APPROVER_ROLE_NAME',
55                                     avalue   => 'TIMEOUT_APPROVER');
56           wf_engine.SetItemAttrText(itemtype => itemtype,
57                                     itemkey  => itemkey,
58                                     aname    => 'APPROVER_DISPLAY_NAME',
59                                     avalue   => 'TIMEOUT_APPROVER_DISPLAY_NAME');
60        */
61 
62    -- Bug 6641216
63    -- Another sample code to set the timeout approver as the WORKFLOW ADMINISTRATOR
64    -- Example Below
65 
66    /*
67 
68     l_new_user_name := wf_engine.GetItemAttrText(itemtype => itemtype,
69       		                		 itemkey  => itemkey,
70                              			 aname    => 'WF_ADMINISTRATOR');
71 
72     select display_name into l_new_display_name
73     from wf_roles where name = l_new_user_name;
74 
75    wf_engine.SetItemAttrText(itemtype => itemtype,
76    		             itemkey  => itemkey,
77                              aname    => 'APPROVER_ROLE_NAME',
78                              avalue   => l_new_user_name);
79 
80    wf_engine.SetItemAttrText(itemtype => itemtype,
81                              itemkey  => itemkey,
82                              aname    => 'APPROVER_DISPLAY_NAME',
83                              avalue   => l_new_display_name);
84 
85    result := 'COMPLETE'; */
86 
87 
88 
89     null;
90 EXCEPTION
91 WHEN OTHERS THEN
92   result := 'ERROR';
93   wf_core.context('PSP_EFFORT_REPORTS', 'SET_CUSTOM_TIMEOUT_APPROVER', itemtype, itemkey,
94                    to_char(actid), funcmode);
95    raise;
96 end set_custom_timeout_approver;
97 end;