1 Package hxc_notification_helper as
2 /* $Header: hxcnothel.pkh 120.0 2006/06/19 09:03:36 gsirigin noship $ */
3 Type g_rec_notif Is Record
4 ( approval_style_id hxc_approval_styles.approval_style_id%type
5 ,timeouts_enabled varchar2(1)
6 ,number_retries hxc_app_comp_notifications.notification_number_retries%type
7 ,approver_timeout hxc_app_comp_notifications.notification_timeout_value%type
8 ,preparer_timeout hxc_app_comp_notifications.notification_timeout_value%type
9 ,admin_timeout hxc_app_comp_notifications.notification_timeout_value%type
10 ,notify_supervisor varchar2(1)
11 ,notify_worker_on_submit varchar2(1)
12 ,notify_worker_on_aa varchar2(1)
13 ,notify_preparer_approved varchar2(1)
14 ,notify_preparer_rejected varchar2(1)
15 ,notify_preparer_transfer varchar2(1)
16 );
17
18 -- ----------------------------------------------------------------------------
19 -- |--------------------------< run_extensions>-------------------------------|
20 -- ----------------------------------------------------------------------------
21 -- Returns TRUE if the run extensions value is 'Y' or NULL in the
22 -- hxc_approval_styles for the approval style
23 Function run_extensions(p_approval_comp_id in number)
24 Return Boolean;
25
26 -- ----------------------------------------------------------------------------
27 -- |--------------------------< has_timeout_notifications>--------------------|
28 -- ----------------------------------------------------------------------------
29 -- Returns 'Y' if timeout notifications are enabled, N otherwise.
30
31 Function has_timeout_notifications(p_approval_style_id in number)
32 Return varchar2;
33
34 -- ----------------------------------------------------------------------------
35 -- |--------------------------<number_timeout_retries_any>--------------------|
36 -- ----------------------------------------------------------------------------
37 -- Returns notification_number_retries column for 'REQUEST-APPROVAL-RESEND'
38 -- type action code for any approval component attached to the passed approval
39 -- style.
40
41 Function number_timeout_retries_any(p_approval_style_id in number)
42 Return number;
43
44 -- ----------------------------------------------------------------------------
45 -- |--------------------------< approver_timeout_value>-----------------------|
46 -- ----------------------------------------------------------------------------
47 -- This function looks up any notification with action code
48 -- 'REQUEST-APPROVAL-RESEND' for notification recipient of 'APPROVER' for
49 -- the passed approval style id and returns the corresponding timeout value -
50 -- returning null if none exist.
51
52 Function approver_timeout_value(p_approval_style_id in number)
53 Return number;
54
55 -- ----------------------------------------------------------------------------
56 -- |--------------------------< preparer_timeout_value>------------------------|
57 -- ----------------------------------------------------------------------------
58 -- This function looks up any notification with action code
59 -- 'REQUEST-APPROVAL-RESEND' for notification recipient of 'PREPARER' for
60 -- the passed approval style id and returns the corresponding timeout value -
61 -- returning null if none exist.
62
63 Function preparer_timeout_value(p_approval_style_id in number)
64 Return number;
65
66 -- ----------------------------------------------------------------------------
67 -- |--------------------------< admin_timeout_value>---------------------------|
68 -- ----------------------------------------------------------------------------
69 -- This function looks up any notification with action code
70 -- 'REQUEST-APPROVAL-RESEND' for notification recipient of 'ADMIN' for
71 -- the passed approval style id and returns the corresponding timeout value -
72 -- returning null if none exist.
73
74 Function admin_timeout_value(p_approval_style_id in number)
75 Return number;
76
77
78 -- ----------------------------------------------------------------------------
79 -- |--------------------------< notify_sup_for_approval>----------------------|
80 -- ----------------------------------------------------------------------------
81 -- This function checks to see if a notification with action code
82 -- 'REQUEST-APPROVAL' exists for a recipient of 'SUPERVISOR' for any approval
83 -- component attached to the approval style id. Returns Y if present,
84 -- N otherwise.
85
86 Function notify_sup_for_approval(p_approval_style_id in number)
87 Return varchar2;
88
89 -- ----------------------------------------------------------------------------
90 -- |--------------------------< notify_worker_submission>---------------------|
91 -- ----------------------------------------------------------------------------
92 -- This function checks to see if a notification with action code
93 -- 'SUBMISSION' exists for a recipient of 'WORKER' for any approval
94 -- component attached to the approval style id. Returns Y if present, N otherwise.
95
96 Function notify_worker_submission(p_approval_style_id in number)
97 Return varchar2;
98
99 -- ----------------------------------------------------------------------------
100 -- |--------------------------< notify_worker_auto_approve>--------------------|
101 -- ----------------------------------------------------------------------------
102 -- This function checks to see if a notification with action code
103 -- 'AUTO-APPROVE' exists for a recipient of 'WORKER' for any approval
104 -- component attached to the approval style id. Returns Y if present,
105 -- N otherwise.
106
107 Function notify_worker_auto_approve(p_approval_style_id in number)
108 Return varchar2;
109
110 -- ----------------------------------------------------------------------------
111 -- |--------------------------< notify_preparer_approve>----------------------|
112 -- ----------------------------------------------------------------------------
113 -- This function checks to see if a notification with action code
114 -- 'APPROVED' exists for a recipient of 'PREPARER' for any approval
115 -- component attached to the approval style id. Returns Y if present,
116 -- N otherwise.
117
118 Function notify_preparer_approve(p_approval_style_id in number)
119 Return varchar2;
120
121 -- ----------------------------------------------------------------------------
122 -- |--------------------------< notify_preparer_reject>-----------------------|
123 -- ----------------------------------------------------------------------------
124 -- This function checks to see if a notification with action code
125 -- 'REJECTED' exists for a recipient of 'PREPARER' for any approval
126 -- component attached to the approval style id. Returns Y if present,
127 -- N otherwise.
128
129 Function notify_preparer_reject(p_approval_style_id in number)
130 Return varchar2;
131
132 -- ----------------------------------------------------------------------------
133 -- |--------------------------< notify_preparer_transfer>----------------------|
134 -- ----------------------------------------------------------------------------
135 -- This function checks to see if a notification with action code
136 -- 'TRANSFER' exists for a recipient of 'PREPARER' for any approval
137 -- component attached to the approval style id. Returns Y if present,
138 -- N otherwise.
139
140 Function notify_preparer_transfer(p_approval_style_id in number)
141 Return varchar2;
142
143 --
144 -- ----------------------------------------------------------------------------
145 -- |--------------------------< create_notification_records>------------------|
146 -- ----------------------------------------------------------------------------
147 --
148 --
149
150 Procedure create_notification_records
151 ( p_approval_style_id in number
152 ,p_approval_style_name in varchar2
153 ,p_timeouts_enabled in varchar2
154 ,p_number_retries in number
155 ,p_approver_timeout in number
156 ,p_preparer_timeout in number
157 ,p_admin_timeout in number
158 ,p_notify_supervisor in varchar2
159 ,p_notify_worker_on_submit in varchar2
160 ,p_notify_worker_on_aa in varchar2
161 ,p_notify_preparer_approved in varchar2
162 ,p_notify_preparer_rejected in varchar2
163 ,p_notify_preparer_transfer in varchar2
164 );
165
166
167 --
168 -- ----------------------------------------------------------------------------
169 -- |--------------------------< update_notification_records>------------------|
170 -- ----------------------------------------------------------------------------
171 --
172 --
173 Procedure update_notification_records
174 ( p_approval_style_id in number
175 ,p_approval_style_name in varchar2
176 ,p_timeouts_enabled in varchar2
177 ,p_number_retries in number
178 ,p_approver_timeout in number
179 ,p_preparer_timeout in number
180 ,p_admin_timeout in number
181 ,p_notify_supervisor in varchar2
182 ,p_notify_worker_on_submit in varchar2
183 ,p_notify_worker_on_aa in varchar2
184 ,p_notify_preparer_approved in varchar2
185 ,p_notify_preparer_rejected in varchar2
186 ,p_notify_preparer_transfer in varchar2
187 );
188
189 --
190 -- ----------------------------------------------------------------------------
191 -- |--------------------------< delete_notification_records>------------------|
192 -- ----------------------------------------------------------------------------
193 --
194 --
195 Procedure delete_notification_records
196 (
197 p_approval_style_id in hxc_approval_styles.approval_style_id%type
198 );
199 --
200 -- ----------------------------------------------------------------------------
201 -- |--------------------------< approval_comps_usages>-------------------------|
202 -- ----------------------------------------------------------------------------
203 --
204 -- Procedure to create or delete entries from usages table when a approval
205 -- component is either added or deleted from the approval style.
206
207 Procedure approval_comps_usages
208 ( p_approval_style_id in number
209 ,p_approval_comp_id in number
210 ,p_approval_comp_ovn in number
211 ,p_dml_action in varchar2
212 );
213
214 end hxc_notification_helper;