DBA Data[Home] [Help]

PACKAGE: APPS.JTF_UM_WF_APPROVAL

Source


1 package JTF_UM_WF_APPROVAL AUTHID CURRENT_USER as
2 /* $Header: JTFUMWFS.pls 115.27 2002/11/21 22:58:01 kching ship $ */
3 
4 g_adhoc_role_name_prefix varchar2 (5) := 'JTAUM';
5 --
6 -- Procedure
7 --      ValidateWF
8 --
9 -- Description
10 --      Check if the required workflow attributes are defined in the WF.
11 -- IN
12 --   itemtype -- The itemtype of the workflow.
13 --
14 procedure ValidateWF (itemtype in varchar2);
15 
16 --
17 -- Procedure
18 --      CreateProcess
19 --
20 -- Description
21 --      Initiate and launch workflow for a um approval
22 -- IN
23 --   ownerUserID     -- no longer required
24 --   requestType     -- The type of request, 'ENROLLMENT/USERTYPE'
25 --   requestID       -- ID of the request.
26 --   requesterUserID -- The FND userID of the requester
27 --   requestRegID    -- USERTYPE_REG_ID or SUBSCRIPTION_REG_ID
28 --
29 procedure CreateProcess (ownerUserId     in number := null,
30                          requestType     in varchar2,
31                          requestID       in number,
32                          requesterUserID in number,
33                          requestRegID    in number);
34 
35 --
36 -- Procedure
37 --      LaunchProcess
38 --
39 -- Description
40 --      Launch the workflow process that has been created.
41 -- IN
42 --   requestType     -- The type of request, 'USERTYPE/ENROLLMENT'
43 --   requestRegID    -- USERTYPE_REG_ID or SUBSCRIPTION_REG_ID
44 --
45 procedure LaunchProcess (requestType     in varchar2,
46                          requestRegID    in number);
47 
48 --
49 -- Procedure
50 --      selector
51 --
52 -- Description
53 --
54 -- IN
55 --   itemtype    - A valid item type from (WF_ITEM_TYPES table).
56 --   itemkey     - A string generated from the application object's primary key.
57 --   activity_id - The function activity(instance id).
58 --   command     - Run/Cancel
59 -- OUT
60 --   resultout    - Name of workflow process to run
61 --
62 procedure Selector (item_type    in  varchar2,
63                     item_key     in  varchar2,
64                     activity_id in  number,
65                     command     in  varchar2,
66                     resultout   out NOCOPY varchar2);
67 
68 --
69 -- Initialization
70 -- IN
71 --   Itemtype  - A valid item type from (WF_ITEM_TYPES table).
72 --   Itemkey   - A string generated from the application object's primary key.
73 --   actid     - The function activity(instance id).
74 --   funcmode  - Run/Cancel/Timeout
75 -- OUT
76 --   Resultout    - 'COMPLETE:'
77 --
78 procedure Initialization (Itemtype  in  varchar2,
79                           Itemkey   in  varchar2,
80                           actid     in  number,
81                           funcmode  in  varchar2,
82                           resultout out NOCOPY varchar2);
83 
84 --
85 -- SelectApprover
86 -- IN
87 --   Itemtype  - A valid item type from (WF_ITEM_TYPES table).
88 --   Itemkey   - A string generated from the application object's primary key.
89 --   actid     - The function activity(instance id).
90 --   funcmode  - Run/Cancel/Timeout
91 -- OUT
92 --   Resultout    - 'COMPLETE:T' if there is a next approver
93 --                - 'COMPLETE:F' if there is not a next approver
94 --
95 procedure SelectApprover (Itemtype  in  varchar2,
96                           Itemkey   in  varchar2,
97                           actid     in  number,
98                           funcmode  in  varchar2,
99                           resultout out NOCOPY varchar2);
100 
101 --
102 -- Procedure
103 --      GetApprover
104 --
105 -- Description
106 --      Select an approver
107 -- IN
108 --      Itemtype - workflow Itemtype
109 --      Itemkey  - workflow Itemkey
110 -- Out
111 --      approver's user_name
112 --      approver's user ID
113 --      approver ID
114 --      resultType - 'OK' return next approver.
115 --                   'ERROR' has error during running this api.
116 --                   'END' no more approver in the approver list.
117 --
118 Procedure GetApprover (x_Itemtype         in  varchar2,
119                        x_Itemkey          in  varchar2,
120                        x_approverUsername out NOCOPY varchar2,
121                        x_approverUserID   out NOCOPY number,
122                        x_approverID       out NOCOPY number,
123                        x_resultType       out NOCOPY varchar2);
124 
125 --
126 -- SelectRequestType
127 -- IN
128 --   Itemtype  - A valid item type from (WF_ITEM_TYPES table).
129 --   Itemkey   - A string generated from the application object's primary key.
130 --   actid     - The function activity(instance id).
131 --   funcmode  - Run/Cancel/Timeout
132 -- OUT
133 --   Resultout    - 'COMPLETE:USERTYPE' if it is a usertype request
134 --                - 'COMPLETE:ENROLLMENT' if it is a enrollment request
135 --
136 procedure SelectRequestType (Itemtype  in varchar2,
137                              Itemkey   in varchar2,
138                              actid     in number,
139                              funcmode  in varchar2,
140                              resultout out NOCOPY varchar2);
141 
142 --
143 -- cancel_notification
144 -- DESCRIPTION
145 --   Cancel all open notifications
146 -- IN
147 --   p_itemtype  - A valid item type from (WF_ITEM_TYPES table).
148 --   p_itemkey   - A string generated from the application object's primary key.
149 --
150 procedure cancel_notification (p_itemtype  in varchar2,
151                                p_itemkey   in varchar2);
152 
153 --
154 -- initialize_fail_escalate
155 -- DESCRIPTION
156 --   Update the reg table and performer when fail to escalate approver.
157 -- IN
158 --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
159 --   itemkey   - A string generated from the application object's primary key.
160 --   actid     - The function activity(instance id).
161 --   funcmode
162 -- OUT
163 --   Resultout    - 'COMPLETE:'
164 --
165 procedure initialize_fail_escalate (itemtype  in varchar2,
166                                     itemkey   in varchar2,
167                                     actid     in number,
168                                     funcmode  in varchar2,
169                                     resultout out NOCOPY varchar2);
170 
171 --
172 -- WaitForApproval
173 -- IN
174 --   Itemtype  - A valid item type from (WF_ITEM_TYPES table).
175 --   Itemkey   - A string generated from the application object's primary key.
176 --   actid     - The function activity(instance id).
177 --   funcmode  - Run/Cancel/Timeout
178 -- OUT
179 --   Resultout    - 'COMPLETE:APPROVED' if the request is approved.
180 --                - 'COMPLETE:REJECTED' if the request is rejected.
181 --
182 
183 
184 procedure WaitForApproval (Itemtype  in  varchar2,
185                            Itemkey   in  varchar2,
186                            actid     in  number,
187                            funcmode  in  varchar2,
188                            resultout out NOCOPY varchar2);
189 
190 --
191 -- post_notification
192 -- DESCRIPTION
193 --   Update the reg table when notification is transfered.
194 -- IN
195 --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
196 --   itemkey   - A string generated from the application object's primary key.
197 --   actid     - The function activity(instance id).
198 --   funcmode  - FORWARD/TRANSFER
199 -- OUT
200 --   Resultout    - 'COMPLETE:'
201 --
202 procedure post_notification (itemtype  in varchar2,
203                              itemkey   in varchar2,
204                              actid     in number,
205                              funcmode  in varchar2,
206                              resultout out NOCOPY varchar2);
207 
208 --
209 -- store_delegate_flag
210 -- DESCRIPTION
211 --   Store the delegate flag into the database
212 -- IN
213 --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
214 --   itemkey   - A string generated from the application object's primary key.
215 --   actid     - The function activity(instance id).
216 --   funcmode  - FORWARD/TRANSFER
217 -- OUT
218 --   Resultout    - 'COMPLETE:'
219 --
220 procedure store_delegate_flag (itemtype  in varchar2,
221                                itemkey   in varchar2,
222                                actid     in number,
223                                funcmode  in varchar2,
224                                resultout out NOCOPY varchar2);
225 
226 --
227 -- Procedure
228 --      Do_Approve_Req
229 --
230 -- Description -
231 --   Perform approve a request now
232 --
233 -- IN
234 --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
235 --   itemkey   - A string generated from the application object's primary key.
236 --
237 procedure Do_Approve_Req (itemtype  in  varchar2,
238                           itemkey   in  varchar2);
239 
240 --
241 -- Procedure
242 --      Approve_Req
243 --
244 -- Description
245 --
246 -- IN
247 --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
248 --   itemkey   - A string generated from the application object's primary key.
249 --   actid     - The function activity(instance id).
250 --   funcmode  - Run/Cancel
251 -- OUT
252 --   resultout
253 --
254 procedure Approve_Req (itemtype  in  varchar2,
255                        itemkey   in  varchar2,
256                        actid     in  number,
257                        funcmode  in  varchar2,
258                        resultout out NOCOPY varchar2);
259 
260 --
261 -- Procedure
262 --      Reject_Req
263 --
264 -- Description
265 --
266 -- IN
267 --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
268 --   itemkey   - A string generated from the application object's primary key.
269 --   actid     - The function activity(instance id).
270 --   funcmode  - Run/Cancel
271 -- OUT
272 --   resultout
273 --
274 procedure Reject_Req (itemtype  in  varchar2,
275                       itemkey   in  varchar2,
276                       actid     in  number,
277                       funcmode  in  varchar2,
278                       resultout out NOCOPY varchar2);
279 
280 --
281 -- Can_Delegate
282 -- DESCRIPTION
283 --   Check the enrollment request has the delegation role.
284 -- IN
285 --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
286 --   itemkey   - A string generated from the application object's primary key.
287 --   actid     - The function activity(instance id).
288 --   funcmode  - Run/Cancel/Timeout
289 -- OUT
290 --   Resultout    - 'COMPLETE:Y' enrollment has the delegation role.
291 --                - 'COMPLETE:N' enrollment doesn't has the delegation role.
292 --
293 procedure Can_Delegate (itemtype  in varchar2,
294                         itemkey   in varchar2,
295                         actid     in number,
296                         funcmode  in varchar2,
297                         resultout out NOCOPY varchar2);
298 
299 --
300 -- CAN_ENROLLMENT_DELEGATE
301 -- DESCRIPTION
302 --   Check the enrollment request if it is delegation or
303 --   delegation and self-service.
304 -- IN
305 --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
306 --   itemkey   - A string generated from the application object's primary key.
307 --   actid     - The function activity(instance id).
308 --   funcmode  - Run/Cancel/Timeout
309 -- OUT
310 --   Resultout    - 'COMPLETE:Y' enrollment is a delegation or delegation
311 --                  and self-service.
312 --                - 'COMPLETE:N' enrollment is a implicit or self-service.
313 --
314 procedure Can_Enrollment_Delegate (itemtype  in varchar2,
315                                    itemkey   in varchar2,
316                                    actid     in number,
317                                    funcmode  in varchar2,
318                                    resultout out NOCOPY varchar2);
319 
320 --
321 -- UNIVERSAL_APPROVERS_EXISTS
322 -- DESCRIPTION
323 --   Check if the current approver is universal approvers role.
324 -- IN
325 --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
326 --   itemkey   - A string generated from the application object's primary key.
327 --   actid     - The function activity(instance id).
328 --   funcmode  - Run/Cancel/Timeout
329 -- OUT
330 --   Resultout    - 'COMPLETE:Y' current approver is universal approvers role.
331 --                - 'COMPLETE:N' current approver is not universal approvers
332 --                  role.
333 --
334 procedure universal_approvers_exists (itemtype  in varchar2,
335                                       itemkey   in varchar2,
336                                       actid     in number,
337                                       funcmode  in varchar2,
338                                       resultout out NOCOPY varchar2);
339 
340 --
341 -- CHECK_EMAIL_NOTIFI_TYPE
342 -- DESCRIPTION
343 --   Check which email we will send to this requester.
344 -- IN
345 --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
346 --   itemkey   - A string generated from the application object's primary key.
347 --   actid     - The function activity(instance id).
348 --   funcmode  - Run/Cancel/Timeout
349 -- OUT
350 --   Resultout    - 'COMPLETE:NO_NOTIFICATION' if email should not be sent.
351 --                - 'COMPLETE:PRIMARY_USER' if primary user email should be sent.
352 --                - 'COMPLETE:BUSINESS_USER' if business user email should be sent.
353 --                - 'COMPLETE:INDIVIDUAL_USER' if individual user email should be sent.
354 --                - 'COMPLETE:OTHER_USER' if other user email should be sent.
355 --                - 'COMPLETE:ENROLLMENT' if enrollment email should be sent.
356 --
357 procedure CHECK_EMAIL_NOTIFI_TYPE (Itemtype  in varchar2,
358                                    Itemkey   in varchar2,
359                                    actid     in number,
360                                    funcmode  in varchar2,
361                                    resultout out NOCOPY varchar2);
362 
363 --
364 -- CompleteApprovalActivity
365 -- DESCRIPTION
366 --   Complete the blocking activity
367 -- IN
368 --   itemtype       - A valid item type from (WF_ITEM_TYPES table).
369 --   itemkey        - A string generated from the application object's primary key.
370 --   resultCode     - 'APPROVED' or 'REJECTED'
371 --   comment        - Approver's comment
372 --   delegationFlag - 'Y'  = Grant Delegation Flag
373 --                    'N'  = Do not grant delegation flag
374 --                    null = No delegation flag
375 --   lastUpdateDate - Last Update Date of the request record
376 --
377 procedure CompleteApprovalActivity (itemtype        in varchar2,
378                                     itemkey         in varchar2,
379                                     resultCode      in varchar2,
380                                     approverComment in varchar2,
381                                     delegationFlag  in varchar2 := null,
382                                     lastUpdateDate  in varchar2 := null);
383 
384 --
385 -- Do_Complete_Approval_Activity
386 -- DESCRIPTION
387 --   Complete the blocking activity now
388 -- IN
389 --   p_itemtype        - A valid item type from (WF_ITEM_TYPES table).
390 --   p_itemkey         - A string generated from the application object's
391 --                       primary key.
392 --   p_resultCode      - 'APPROVED' or 'REJECTED'
393 --   p_wf_resultCode   - 'APPROVED' or 'REJECTED' but if approval is Usertype,
394 --                       this will be 'null'.
395 --   p_approverComment - Approver's comment
396 --   p_act1            - First Activity
400 --   p_act5            - Fifth Activity
397 --   p_act2            - Second Activity
398 --   p_act3            - Third Activity
399 --   p_act4            - Fourth Activity
401 --   p_act6            - Sixth Activity
402 --
403 procedure Do_Complete_Approval_Activity (p_itemtype        in varchar2,
404                                          p_itemkey         in varchar2,
405                                          p_resultCode      in varchar2,
406                                          p_wf_resultCode   in varchar2,
407                                          p_approverComment in varchar2,
408                                          p_act1            in varchar2 := null,
409                                          p_act2            in varchar2 := null,
410                                          p_act3            in varchar2 := null,
411                                          p_act4            in varchar2 := null,
412                                          p_act5            in varchar2 := null,
413                                          p_act6            in varchar2 := null);
414 
415 --
416 -- Do_Complete_Approval_Activity
417 -- DESCRIPTION
418 --   Complete the blocking activity now
419 -- IN
420 --   p_itemtype        - A valid item type from (WF_ITEM_TYPES table).
421 --   p_itemkey         - A string generated from the application object's
422 --                       primary key.
423 --   p_resultCode      - 'APPROVED' or 'REJECTED'
424 --   p_approverComment - Approver's comment
425 --   p_act1            - First Activity
426 --   p_act2            - Second Activity
427 --   p_act3            - Third Activity
428 --   p_act4            - Fourth Activity
429 --   p_act5            - Fifth Activity
430 --   p_act6            - Sixth Activity
431 --
432 procedure Do_Complete_Approval_Activity (p_itemtype        in varchar2,
433                                          p_itemkey         in varchar2,
434                                          p_resultCode      in varchar2,
435                                          p_approverComment in varchar2,
436                                          p_act1            in varchar2 := null,
437                                          p_act2            in varchar2 := null,
438                                          p_act3            in varchar2 := null,
439                                          p_act4            in varchar2 := null,
440                                          p_act5            in varchar2 := null,
441                                          p_act6            in varchar2 := null);
442 
443 --
444 -- abort_process
445 -- DESCRIPTION
446 --   Abort the Workflow Process with status is ACTIVE, ERROR, or SUSPENDED
447 -- IN
448 --   p_itemtype        - A valid item type from (WF_ITEM_TYPES table).
449 --   p_itemkey         - A string generated from the application object's --                       primary key.
450 --
451 procedure abort_process (p_itemtype        in varchar2,
452                          p_itemkey         in varchar2);
453 
454 procedure usertype_approval_changed(p_usertype_id in number,
455                                     p_new_approval_id in number,
456                                     p_old_approval_id in number
457 				   );
458 procedure enrollment_approval_changed(p_subscription_id in number,
459                                     p_new_approval_id in number,
460                                     p_old_approval_id in number default null
461 				   );
462 
463 procedure approval_chain_changed(p_approval_id  in number,
464                                  p_org_party_id in number);
465 function get_approver_comment(p_reg_id in number,
466                               p_wf_item_type in varchar2) return varchar2;
467 
468 end JTF_UM_WF_APPROVAL;