DBA Data[Home] [Help]

PACKAGE: APPS.FND_WF_ENGINE

Source


1 package FND_WF_ENGINE AUTHID CURRENT_USER as
2 /* $Header: afwfengs.pls 120.1.12010000.2 2009/08/19 15:36:09 ctilley ship $ */
3 
4 
5 --
6 -- Constant values
7 --
8 threshold number := 50;    -- Cost over which to defer activities
9 debug boolean := FALSE;    -- Run engine in debug or normal mode
10 
11 -- Standard date format string.  Used to convert dates to strings
12 -- when returning date values as activity function results.
13 date_format varchar2(30) := 'YYYY/MM/DD HH24:MI:SS';
14 
15 -- Set_Context context
16 --   Process for which set_context function has been called
17 setctx_itemtype varchar2(8) := '';  -- Current itemtype
18 setctx_itemkey varchar2(240) := ''; -- Current itemkey
19 
20 -- Post-Notification Function Context areas
21 --   Used to pass information to callback functions
22 context_nid number := '';          -- Notification id (if applicable)
23 context_text varchar2(2000) := ''; -- Text information
24 
25 -- Activity types
26 eng_process         varchar2(8) := 'PROCESS';  -- Process type activity
27 eng_function        varchar2(8) := 'FUNCTION'; -- Function type activity
28 eng_notification    varchar2(8) := 'NOTICE';   -- Notification type activity
29 
30 -- Item activity statuses
31 eng_completed       varchar2(8) := 'COMPLETE'; -- Normal completion
32 eng_active          varchar2(8) := 'ACTIVE';   -- Activity running
33 eng_waiting         varchar2(8) := 'WAITING';  -- Activity waiting to run
34 eng_notified        varchar2(8) := 'NOTIFIED'; -- Notification open
35 eng_suspended       varchar2(8) := 'SUSPEND';  -- Activity suspended
36 eng_deferred        varchar2(8) := 'DEFERRED'; -- Activity deferred
37 eng_error           varchar2(8) := 'ERROR';    -- Completed with error
38 
39 -- Standard activity result codes
40 eng_exception       varchar2(30) := '#EXCEPTION'; -- Unhandled exception
41 eng_timedout        varchar2(30) := '#TIMEOUT';   -- Activity timed out
42 eng_stuck           varchar2(30) := '#STUCK';     -- Stuck process
43 eng_force           varchar2(30) := '#FORCE';     -- Forced completion
44 eng_noresult        varchar2(30) := '#NORESULT';  -- No result for activity
45 eng_mail            varchar2(30) := '#MAIL';      -- Notification mail error
46 eng_null            varchar2(30) := '#NULL';      -- Noop result
47 eng_nomatch         varchar2(30) := '#NOMATCH';   -- Voting no winner
48 eng_tie             varchar2(30) := '#TIE';       -- Voting tie
49 
50 -- Activity loop reset values
51 eng_reset           varchar2(8) := 'RESET';  -- Loop with cancelling
52 eng_ignore          varchar2(8) := 'IGNORE'; -- Do not reset activity
53 eng_loop            varchar2(8) := 'LOOP';   -- Loop without cancelling
54 
55 -- Start/end activity flags
56 eng_start           varchar2(8) := 'START'; -- Start activity
57 eng_end             varchar2(8) := 'END';   -- End activity
58 
59 -- Function activity modes
60 eng_run             varchar2(8) := 'RUN';      -- Run mode
61 eng_cancel          varchar2(8) := 'CANCEL';   -- Cancel mode
62 eng_timeout         varchar2(8) := 'TIMEOUT';  -- Timeout mode
63 eng_setctx          varchar2(8) := 'SET_CTX';  -- Selector set context mode
64 eng_testctx         varchar2(8) := 'TEST_CTX'; -- Selector test context mode
65 
66 -- HandleError command modes
67 eng_retry           varchar2(8) := 'RETRY'; -- Retry errored activity
68 eng_skip            varchar2(8) := 'SKIP';  -- Skip errored activity
69 
70 eng_wferror         varchar2(8) := 'WFERROR'; -- Error process itemtype
71 
72 -- Monitor access key names
73 wfmon_mon_key       varchar2(30) := '.MONITOR_KEY'; -- Read-only monitor key
74 wfmon_acc_key       varchar2(30) := '.ADMIN_KEY';  -- Admin monitor key
75 
76 -- Special activity attribute names
77 eng_priority         varchar2(30) := '#PRIORITY'; -- Priority override
78 eng_timeout_attr     varchar2(30) := '#TIMEOUT'; -- Priority override
79 
80 -- Standard activity transitions
81 eng_trans_default    varchar2(30) := '*';
82 eng_trans_any        varchar2(30) := '#ANY';
83 
84 -- Applications context flag
85 -- By default we want context to be preserved.
86 preserved_context    boolean      := TRUE;
87 
88 --
89 -- Synch mode
90 --   NOTE: Synch mode is only to be used for in-line processes that are
91 --   run to completion and purged within one session.  Some process data
92 --   is never saved to the database, so the monitor, reports, any external
93 --   access to workflow tables, etc, will not work.
94 --
95 --   This mode is enabled by setting the user_key of the item to
96 --   FND_WF_ENGINE.eng_synch.
97 --
98 --   *** Do NOT enable this mode unless you are sure you understand
99 --   *** the implications!
100 --
101 synch_mode boolean := FALSE; -- *** OBSOLETE! DO NOT USE! ***
102 
103 eng_synch varchar2(8) := '#SYNCH';
104 
105 
106 
107 
108 --
109 -- AddItemAttr (PUBLIC)
110 --   Add a new unvalidated run-time item attribute.
111 -- IN:
112 --   itemtype - item type
113 --   itemkey - item key
114 --   aname - attribute name
115 --   text_value   - add text value to it if provided.
116 --   number_value - add number value to it if provided.
117 --   date_value   - add date value to it if provided.
118 -- NOTE:
119 --   The new attribute has no type associated.  Get/set usages of the
120 --   attribute must insure type consistency.
121 --
122 procedure AddItemAttr(itemtype in varchar2,
123                       itemkey in varchar2,
124                       aname in varchar2,
125                       text_value   in varchar2 default null,
126                       number_value in number   default null,
127                       date_value   in date     default null);
128 
129 
130 --
131 -- SetItemAttrText (PUBLIC)
132 --   Set the value of a text item attribute.
133 --   If the attribute is a NUMBER or DATE type, then translate the
134 --   text-string value to a number/date using attribute format.
135 --   For all other types, store the value directly.
136 -- IN:
137 --   itemtype - Item type
138 --   itemkey - Item key
139 --   aname - Attribute Name
140 --   avalue - New value for attribute
141 --
142 procedure SetItemAttrText(itemtype in varchar2,
143                           itemkey in varchar2,
144                           aname in varchar2,
145                           avalue in varchar2);
146 
147 --
148 -- SetItemAttrNumber (PUBLIC)
149 --   Set the value of a number item attribute.
150 --   Attribute must be a NUMBER-type attribute.
151 -- IN:
152 --   itemtype - Item type
153 --   itemkey - Item key
154 --   aname - Attribute Name
155 --   avalue - New value for attribute
156 --
157 procedure SetItemAttrNumber(itemtype in varchar2,
158                             itemkey in varchar2,
159                             aname in varchar2,
160                             avalue in number);
161 
162 --
163 -- SetItemAttrDate (PUBLIC)
164 --   Set the value of a date item attribute.
165 --   Attribute must be a DATE-type attribute.
166 -- IN:
167 --   itemtype - Item type
168 --   itemkey - Item key
169 --   aname - Attribute Name
170 --   avalue - New value for attribute
171 --
172 procedure SetItemAttrDate(itemtype in varchar2,
173                           itemkey in varchar2,
174                           aname in varchar2,
175                           avalue in date);
176 
177 --
178 -- SetItemAttrDocument (PUBLIC)
179 --   Set the value of a document item attribute.
180 -- IN:
181 --   itemtype - Item type
182 --   itemkey - Item key
183 --   aname - Attribute Name
184 --   documentid - Document Identifier - full concatenated document attribute
185 --                strings:
186 --                nodeid:libraryid:documentid:version:document_name
187 --
188 procedure SetItemAttrDocument(itemtype in varchar2,
189                               itemkey in varchar2,
190                               aname in varchar2,
191                               documentid in varchar2);
192 
193 
194 --
195 -- Getitemattrinfo (PUBLIC)
196 --   Get type information about a item attribute.
197 -- IN:
198 --   itemtype - Item type
199 --   aname - Attribute name
200 -- OUT:
201 --   atype  - Attribute type
202 --   subtype - 'SEND' or 'RESPOND'
203 --   format - Attribute format
204 --
205 procedure GetItemAttrInfo(itemtype in varchar2,
206                           aname in varchar2,
207                           atype out NOCOPY varchar2,
208                           subtype out NOCOPY varchar2,
209                           format out NOCOPY varchar2);
210 
211 --
212 -- GetItemAttrText (PUBLIC)
213 --   Get the value of a text item attribute.
214 --   If the attribute is a NUMBER or DATE type, then translate the
215 --   number/date value to a text-string representation using attrbute format.
216 --   For all other types, get the value directly.
217 -- IN:
218 --   itemtype - Item type
219 --   itemkey - Item key
220 --   aname - Attribute Name
221 -- RETURNS:
222 --   Attribute value
223 --
224 function GetItemAttrText(itemtype in varchar2,
225                          itemkey in varchar2,
226                          aname in varchar2)
227 return varchar2;
228 
229 --
230 -- GetItemAttrNumber (PUBLIC)
231 --   Get the value of a number item attribute.
232 --   Attribute must be a NUMBER-type attribute.
233 -- IN:
234 --   itemtype - Item type
235 --   itemkey - Item key
236 --   aname - Attribute Name
237 -- RETURNS:
238 --   Attribute value
239 --
240 function GetItemAttrNumber(itemtype in varchar2,
241                            itemkey in varchar2,
242                            aname in varchar2)
243 return number;
244 
245 --
246 -- GetItemAttrDate (PUBLIC)
247 --   Get the value of a date item attribute.
248 --   Attribute must be a DATE-type attribute.
249 -- IN:
250 --   nid - Item id
251 --   aname - Attribute Name
252 -- RETURNS:
253 --   Attribute value
254 --
255 function GetItemAttrDate (itemtype in varchar2,
256                           itemkey in varchar2,
257                           aname in varchar2)
258 return date;
259 
260 --
261 -- GetItemAttrDocument (PUBLIC)
262 --   Get the value of a document item attribute.
263 -- IN:
264 --   itemtype - Item type
265 --   itemkey - Item key
266 --   aname - Attribute Name
267 -- RETURNS:
268 --   documentid - Document Identifier - full concatenated document attribute
269 --                strings:
270 --                nodeid:libraryid:documentid:version:document_name
271 --
272 --
273 --
274 Function GetItemAttrDocument(itemtype in varchar2,
275                               itemkey in varchar2,
276                               aname in varchar2) RETURN VARCHAR2;
277 
278 
279 --
280 -- GetActivityAttrInfo (PUBLIC)
281 --   Get type information about an activity attribute.
282 -- IN:
283 --   itemtype - Item type
284 --   itemkey - Item key
285 --   actid - Process activity id
286 --   aname - Attribute name
287 -- OUT:
288 --   atype  - Attribute type
289 --   subtype - 'SEND' or 'RESPOND',
290 --   format - Attribute format
291 --
292 procedure GetActivityAttrInfo(itemtype in varchar2,
293                               itemkey in varchar2,
294                               actid in number,
295                               aname in varchar2,
296                               atype out NOCOPY varchar2,
297                               subtype out NOCOPY varchar2,
298                               format out NOCOPY varchar2);
299 
300 --
301 -- GetActivityAttrText (PUBLIC)
302 --   Get the value of a text item attribute.
303 --   If the attribute is a NUMBER or DATE type, then translate the
304 --   number/date value to a text-string representation using attrbute format.
305 --   For all other types, get the value directly.
306 -- IN:
307 --   itemtype - Item type
308 --   itemkey - Item key
309 --   actid - Process activity id
310 --   aname - Attribute Name
311 -- RETURNS:
312 --   Attribute value
313 --
314 function GetActivityAttrText(itemtype in varchar2,
315                              itemkey in varchar2,
316                              actid in number,
317                              aname in varchar2)
318 return varchar2;
319 
320 --
321 -- GetActivityAttrNumber (PUBLIC)
322 --   Get the value of a number item attribute.
323 --   Attribute must be a NUMBER-type attribute.
324 -- IN:
325 --   itemtype - Item type
326 --   itemkey - Item key
327 --   actid - Process activity id
328 --   aname - Attribute Name
329 -- RETURNS:
330 --   Attribute value
331 --
332 function GetActivityAttrNumber(itemtype in varchar2,
333                                itemkey in varchar2,
334                                actid in number,
335                                aname in varchar2)
336 return number;
337 
338 --
339 -- GetActivityAttrDate (PUBLIC)
340 --   Get the value of a date item attribute.
341 --   Attribute must be a DATE-type attribute.
342 -- IN:
343 --   itemtype - Item type
344 --   itemkey - Item key
345 --   actid - Process activity id
346 --   aname - Attribute Name
347 -- RETURNS:
348 --   Attribute value
349 --
350 function GetActivityAttrDate(itemtype in varchar2,
351                              itemkey in varchar2,
352                              actid in number,
353                              aname in varchar2)
354 return date;
355 
356 --
357 -- Set_Item_Parent (PUBLIC)
358 -- *** OBSOLETE - Use SetItemParent instead ***
359 --
360 procedure Set_Item_Parent(itemtype in varchar2,
361   itemkey in varchar2,
362   parent_itemtype in varchar2,
363   parent_itemkey in varchar2,
364   parent_context in varchar2);
365 
366 --
367 -- SetItemParent (PUBLIC)
368 --   Set the parent info of an item
369 -- IN
370 --   itemtype - Item type
371 --   itemkey - Item key
372 --   parent_itemtype - Itemtype of parent
373 --   parent_itemkey - Itemkey of parent
374 --   parent_context - Context info about parent
375 --
376 procedure SetItemParent(itemtype in varchar2,
377   itemkey in varchar2,
378   parent_itemtype in varchar2,
379   parent_itemkey in varchar2,
380   parent_context in varchar2);
381 
382 --
383 -- SetItemOwner (PUBLIC)
384 --   Set the owner of an item
385 -- IN
386 --   itemtype - Item type
387 --   itemkey - Item key
388 --   owner - Role designated as owner of the item
389 --
390 procedure SetItemOwner(itemtype in varchar2,
391                        itemkey in varchar2,
392                        owner in varchar2);
393 
394 --
395 -- GetItemUserKey (PUBLIC)
396 --   Get the user key of an item
397 -- IN
398 --   itemtype - Item type
399 --   itemkey - Item key
400 -- RETURNS
401 --   User key of the item
402 --
403 function GetItemUserKey(
404   itemtype in varchar2,
405   itemkey in varchar2)
406 return varchar2;
407 
408 --
409 -- SetItemUserKey (PUBLIC)
410 --   Set the user key of an item
411 -- IN
412 --   itemtype - Item type
413 --   itemkey - Item key
414 --   userkey - User key to be set
415 --
416 procedure SetItemUserKey(
417   itemtype in varchar2,
418   itemkey in varchar2,
419   userkey in varchar2);
420 
421 --
422 -- GetActivityLabel (PUBLIC)
423 --  Get activity instance label given id, in a format
424 --  suitable for passing to other wf_engine apis.
425 -- IN
426 --   actid - activity instance id
427 -- RETURNS
428 --   <process_name>||':'||<instance_label>
429 --
430 function GetActivityLabel(
431   actid in number)
432 return varchar2;
433 
434 --
435 -- CB (PUBLIC)
436 --   This is the callback function used by the notification system to
440 --     GET - Get the value of an attribute
437 --   get and set process attributes, and mark a process complete.
438 --
439 --   The command may be one of 'GET', 'SET', 'COMPLETE', or 'ERROR'.
441 --     SET - Set the value of an attribute
442 --     COMPLETE - Mark the activity as complete
443 --     ERROR - Mark the activity as error status
444 --     TESTCTX - Test current context via selector function
445 --     FORWARD - Execute notification function for FORWARD
446 --     TRANSFER - Execute notification function for TRANSFER
447 --     RESPOND - Execute notification function for RESPOND
448 --
449 --   The context is in the format <itemtype>:<itemkey>:<activityid>.
450 --
451 --   The text_value/number_value/date_value fields are mutually exclusive.
452 --   It is assumed that only one will be used, depending on the value of
453 --   the attr_type argument ('VARCHAR2', 'NUMBER', or 'DATE').
454 --
455 -- IN:
456 --   command - Action requested.  Must be one of 'GET', 'SET', or 'COMPLETE'.
457 --   context - Context data in the form '<item_type>:<item_key>:<activity>'
458 --   attr_name - Attribute name to set/get for 'GET' or 'SET'
459 --   attr_type - Attribute type for 'SET'
460 --   text_value - Text Attribute value for 'SET'
461 --   number_value - Number Attribute value for 'SET'
462 --   date_value - Date Attribute value for 'SET'
463 -- OUT:
464 --   text_value - Text Attribute value for 'GET'
465 --   number_value - Number Attribute value for 'GET'
466 --   date_value - Date Attribute value for 'GET'
467 --
468 procedure CB(command in varchar2,
469              context in varchar2,
470              attr_name in varchar2 default null,
471              attr_type in varchar2 default null,
472              text_value in out NOCOPY varchar2,
473              number_value in out NOCOPY number,
474              date_value in out NOCOPY date);
475 
476 --
477 -- ProcessDeferred (PUBLIC)
478 --   Process one deferred activity.
479 -- IN
480 --   itemtype - Item type to process.  If null process all item types.
481 --   minthreshold - Minimum cost activity to process. No minimum if null.
482 --   maxthreshold - Maximum cost activity to process. No maximum if null.
483 --
484 procedure ProcessDeferred(itemtype in varchar2 default null,
485                           minthreshold in number default null,
486                           maxthreshold in number default null);
487 
488 --
489 -- ProcessTimeout (PUBLIC)
490 --  Pick up one timed out activity and execute timeout transition.
491 -- IN
492 --  itemtype - Item type to process.  If null process all item types.
493 --
494 procedure ProcessTimeOut( itemtype in varchar2 default null );
495 
496 --
497 -- ProcessStuckProcess (PUBLIC)
498 --   Pick up one stuck process, mark error status, and execute error process.
499 -- IN
500 --   itemtype - Item type to process.  If null process all item types.
501 --
502 procedure ProcessStuckProcess(itemtype in varchar2 default null);
503 
504 --
505 -- Background (PUBLIC)
506 --  Process all current deferred and/or timeout activities within
507 --  threshold limits.
508 -- IN
509 --   itemtype - Item type to process.  If null process all item types.
510 --   minthreshold - Minimum cost activity to process. No minimum if null.
511 --   maxthreshold - Maximum cost activity to process. No maximum if null.
512 --   process_deferred - Run deferred or waiting processes
513 --   process_timeout - Handle timeout and stuck process errors
514 --
515 procedure Background (itemtype         in varchar2 default '',
516                       minthreshold     in number default null,
517                       maxthreshold     in number default null,
518                       process_deferred in boolean default TRUE,
519                       process_timeout  in boolean default TRUE);
520 
521 --
522 -- BackgroundConcurrent (PUBLIC)
523 --  Run background process for deferred and/or timeout activities
524 --  from Concurrent Manager.
525 --  This is a cover of Background() with different argument types to
526 --  be used by the Concurrent Manager.
527 -- IN
528 --   errbuf - CPM error message
529 --   retcode - CPM return code (0 = success, 1 = warning, 2 = error)
530 --   itemtype - Item type to process.  If null process all item types.
531 --   minthreshold - Minimum cost activity to process. No minimum if null.
532 --   maxthreshold - Maximum cost activity to process. No maximum if null.
533 --   process_deferred - Run deferred or waiting processes
534 --   process_timeout - Handle timeout errors
535 --
536 procedure BackgroundConcurrent (
537     errbuf out NOCOPY varchar2,
538     retcode out NOCOPY varchar2,
539     itemtype in varchar2 default '',
540     minthreshold in varchar2 default '',
541     maxthreshold in varchar2 default '',
542     process_deferred in varchar2 default 'Y',
543     process_timeout in varchar2 default 'Y');
544 
545 --
546 -- CreateProcess (PUBLIC)
547 --   Create a new runtime process (for an application item).
548 -- IN
549 --   itemtype - A valid item type
550 --   itemkey  - A string generated from the application object's primary key.
551 --   process  - A valid root process for this item type
552 --              (or null to use the item's selector function)
553 --
554 procedure CreateProcess(itemtype in varchar2,
555                         itemkey  in varchar2,
556                         process  in varchar2 default '');
557 
558 --
562 --   of the root process and executes them.
559 -- StartProcess (PUBLIC)
560 --   Begins execution of the process. The process will be identified by the
561 --   itemtype and itemkey.  The engine locates the starting activities
563 -- IN
564 --   itemtype - A valid item type
565 --   itemkey  - A string generated from the application object's primary key.
566 --
567 procedure StartProcess(itemtype in varchar2,
568                        itemkey  in varchar2);
569 
570 
571 --
572 -- LaunchProcess (PUBLIC)
573 --   Launch a process both creates and starts it.
574 --   This is a wrapper for friendlier UI
575 -- IN
576 --   itemtype - A valid item type
577 --   itemkey  - A string generated from the application object's primary key.
578 --   process  - A valid root process for this item type
579 --              (or null to use the item's selector function)
580 --   userkey - User key to be set
581 --   owner - Role designated as owner of the item
582 --
583 procedure LaunchProcess(itemtype in varchar2,
584                         itemkey  in varchar2,
585                         process  in varchar2 default '',
586                         userkey  in varchar2 default '',
587                         owner    in varchar2 default '');
588 
589 
590 
591 --
592 -- SuspendProcess (PUBLIC)
593 --   Suspends process execution, meaning no new transitions will occur.
594 --   Outstanding notifications will be allowed to complete, but they will not
595 --   cause activity transitions. If the process argument is null, the root
596 --   process for the item is suspended, otherwise the named process is
597 --   suspended.
598 -- IN
599 --   itemtype - A valid item type
600 --   itemkey  - A string generated from the application object's primary key.
601 --   process  - Process to suspend, specified in the form
602 --              [<parent process_name>:]<process instance_label>
603 --              If null suspend the root process.
604 --
605 procedure SuspendProcess(itemtype in varchar2,
606                          itemkey  in varchar2,
607                          process  in varchar2 default '');
608 
609 --
610 -- AbortProcess (PUBLIC)
611 --   Abort process execution. Outstanding notifications are canceled. The
612 --   process is then considered complete, with a status specified by the
613 --   result argument.
614 -- IN
615 --   itemtype - A valid item type
616 --   itemkey  - A string generated from the application object's primary key.
617 --   process  - Process to abort, specified in the form
618 --              [<parent process_name>:]<process instance_label>
619 --              If null abort the root process.
620 --   result   - Result to complete process with
621 --
622 procedure AbortProcess(itemtype in varchar2,
623                        itemkey  in varchar2,
624                        process  in varchar2 default '',
625                        result   in varchar2 default '#FORCE');
626 
627 --
628 -- ResumeProcess (PUBLIC)
629 --   Returns a process to normal execution status. Any transitions which
630 --   were deferred by SuspendProcess() will now be processed.
631 -- IN
632 --   itemtype   - A valid item type
633 --   itemkey    - A string generated from the application object's primary key.
634 --   process  - Process to resume, specified in the form
635 --              [<parent process_name>:]<process instance_label>
636 --              If null resume the root process.
637 --
638 procedure ResumeProcess(itemtype in varchar2,
639                         itemkey  in varchar2,
640                         process  in varchar2 default '');
641 
642 
643 --
644 -- CreateForkProcess (PUBLIC)
645 --   Performs equivalent of createprocess but for a forked process
646 --   and copies all item attributes
647 --   If same version is false, this is same as CreateProcess but copies
648 --   item attributes as well.
649 -- IN
650 --   copy_itemtype  - Item type
651 --   copy_itemkey   - item key to copy (will be stored to an item attribute)
652 --   new_itemkey    - item key to create
653 --   same_version   - TRUE will use same version even if out of date.
654 --                    FALSE will use the active and current version
655 Procedure CreateForkProcess (
656      copy_itemtype  in varchar2,
657      copy_itemkey   in varchar2,
658      new_itemkey      in varchar2,
659      same_version      in boolean default TRUE);
660 --
661 -- StartForkProcess (PUBLIC)
662 --   Start a process that has been forked. Depending on the way this was forked,
663 
664 
665 --   this will execute startprocess if its to start with the latest version or
666 --   it copies the forked process activty by activity.
667 -- IN
668 --   itemtype  - Item type
669 --   itemkey   - item key to start
670 --
671 procedure StartForkProcess(
672      itemtype        in  varchar2,
673      itemkey         in  varchar2);
674 --
675 -- BeginActivity (PUBLIC)
676 --   Determines if the specified activity may currently be performed on the
677 --   work item. This is a test that the performer may proactively determine
678 --   that their intent to perform an activity on an item is, in fact, allowed.
679 -- IN
680 --   itemtype  - A valid item type
684 --
681 --   itemkey   - A string generated from the application object's primary key.
682 --   activity  - Completed activity, specified in the form
683 --               [<parent process_name>:]<process instance_label>
685 procedure BeginActivity(itemtype in varchar2,
686                         itemkey  in varchar2,
687                         activity in varchar2);
688 
689 --
690 -- CompleteActivity (PUBLIC)
691 --   Notifies the workflow engine that an activity has been completed for a
692 --   particular process(item). This procedure can have one or more of the
693 --   following effects:
694 --   o Creates a new item. If the completed activity is the start of a process,
695 --     then a new item can be created by this call. If the completed activity
696 --     is not the start of a process, it would be an invalid activity error.
697 --   o Complete an activity with an optional result. This signals the
698 --     workflow engine that an asynchronous activity has been completed.
699 --     An optional activity completion result can also be passed.
700 -- IN
701 --   itemtype  - A valid item type
702 --   itemkey   - A string generated from the application object's primary key.
703 --   activity  - Completed activity, specified in the form
704 --               [<parent process_name>:]<process instance_label>
705 --   <result>  - An optional result.
706 --
707 procedure CompleteActivity(itemtype in varchar2,
708                            itemkey  in varchar2,
709                            activity in varchar2,
710                            result   in varchar2);
711 
712 --
713 -- CompleteActivityInternalName (PUBLIC)
714 --   Identical to CompleteActivity, except that the internal name of
715 --   completed activity is passed instead of the activity instance label.
716 -- NOTES:
717 -- 1. There must be exactly ONE instance of this activity with NOTIFIED
718 --    status.
719 -- 2. Using this api to start a new process is not supported.
720 -- 3. Synchronous processes are not supported in this api.
721 -- 4. This should only be used if for some reason the instance label is
722 --    not known.  CompleteActivity should be used if the instance
723 --    label is known.
724 -- IN
725 --   itemtype  - A valid item type
726 --   itemkey   - A string generated from the application object's primary key.
727 --   activity  - Internal name of completed activity, in the format
728 --               [<parent process_name>:]<process activity_name>
729 --   <result>  - An optional result.
730 --
731 procedure CompleteActivityInternalName(
732   itemtype in varchar2,
733   itemkey  in varchar2,
734   activity in varchar2,
735   result   in varchar2);
736 
737 --
738 -- AssignActivity (PUBLIC)
739 --   Assigns or re-assigns the user who will perform an activity. It may be
740 --   called before the activity has been enabled(transitioned to). If a user
741 --   is assigned to an activity that already has an outstanding notification,
742 --   that notification will be canceled and a new notification will be
743 --   generated for the new user.
744 -- IN
745 --   itemtype  - A valid item type
746 --   itemkey   - A string generated from the application object's primary key.
747 --   activity  - Activity to assign, specified in the form
748 --               [<parent process_name>:]<process instance_label>
749 --   performer - User who will perform this activity.
750 --
751 procedure AssignActivity(itemtype in varchar2,
752                          itemkey  in varchar2,
753                          activity in varchar2,
754                          performer in varchar2);
755 
756 --
757 -- HandleError (PUBLIC)
758 --   Reset the process thread to given activity and begin execution
759 -- again from that point.  If command is:
760 --     SKIP - mark the activity complete with given result and continue
761 --     RETRY - re-execute the activity before continuing
762 -- IN
763 --   itemtype  - A valid item type.
764 --   itemkey   - The item key of the process.
765 --   activity  - Activity to reset, specified in the form
766 --               [<parent process_name>:]<process instance_label>
767 --   command   - SKIP or RETRY.
768 --   <result>  - Activity result for the "SKIP" command.
769 --
770 procedure HandleError(itemtype in varchar2,
771                       itemkey  in varchar2,
772                       activity in varchar2,
773                       command  in varchar2,
774                       result   in varchar2 default '');
775 
776 procedure ItemStatus(itemtype in varchar2,
777                      itemkey  in varchar2,
778                      status   out NOCOPY varchar2,
779                      result   out NOCOPY varchar2);
780 
781 --
782 -- Activity_Exist_In_Process
783 --   Check if an activity exist in a process
784 -- IN
785 --   p_item_type
786 --   p_item_key
787 --   p_activity_item_type
788 --   p_anctivity_name
789 -- RET
790 --   TRUE if activity exist, FALSE otherwise
791 --
792 function Activity_Exist_In_Process (
793   p_item_type          in  varchar2,
794   p_item_key           in  varchar2,
795   p_activity_item_type in  varchar2 default null,
796   p_activity_name      in  varchar2)
797 return boolean;
798 
799 --
800 -- Activity_Exist
801 --   Check if an activity exist in a process
802 -- IN
806 --   p_anctivity_name
803 --   p_process_item_type
804 --   p_process_name
805 --   p_activity_item_type
807 --   active_date
808 --   iteration  - maximum 8 level deep (0-7)
809 -- RET
810 --   TRUE if activity exist, FALSE otherwise
811 --
812 function Activity_Exist (
813   p_process_item_type  in  varchar2,
814   p_process_name       in  varchar2,
815   p_activity_item_type in  varchar2 default null,
816   p_activity_name      in  varchar2,
817   active_date          in  date default sysdate,
818   iteration            in  number default 0)
819 return boolean;
820 
821 --
822 -- user_synch
823 --   Wrapper for fnd_user_pkg.user_synch()
824 -- IN
825 --   p_user_name
826 --
827 procedure user_synch (p_user_name  in  varchar2);
828 
829 --
830 -- default_event_raise
831 --   Wrapper for wf_event.raise()
832 -- IN
833 --   p_event_name
834 --   p_event_key
835 --
836 procedure default_event_raise(p_event_name  in  varchar2,
837                               p_event_key   in  varchar2);
838 
839 --
840 -- propagate_user_role
841 --   Wrapper for wf_local_synch.propagate_user_role()
842 -- IN
843 --   p_user_orig_system
844 --   p_user_orig_system_id
845 --   p_role_orig_system
846 --   p_role_orig_system_id
847 --   p_start_date
848 --   p_expiration_date
849 --
850 procedure propagate_user_role(p_user_orig_system      in varchar2,
851                               p_user_orig_system_id   in number,
852                               p_role_orig_system      in varchar2,
853                               p_role_orig_system_id   in number,
854                               p_start_date            in date default null,
855                               p_expiration_date       in date default null);
856 
857 --
858 --
859 -- This function is called from the sign-on form FNDSCSGN.fmb
860 --
861 --
862 function DisableOrLaunch(l_item_type in varchar2,
863                          l_itemkey   in varchar2,
864                          c_instid    in varchar2,
865                          l_username  in varchar2,
866                          l_name      in varchar2)
867 return number;
868 
869 --
870 -- SetItemAttrTextAuto (PUBLIC)
871 --   Set the value of a text item attribute. - Autonomously. Needed for ERES
872 --   If the attribute is a NUMBER or DATE type, then translate the
873 --   text-string value to a number/date using attribute format.
874 --   For all other types, store the value directly.
875 -- IN:
876 --   itemtype - Item type
877 --   itemkey - Item key
878 --   aname - Attribute Name
879 --   avalue - New value for attribute
880 --
881 procedure SetItemAttrTextAuto(itemtype in varchar2,
882                           itemkey in varchar2,
883                           aname in varchar2,
884                           avalue in varchar2);
885 
886 --
887 -- AbortProcessAuto (PUBLIC)
888 --   Abort process execution. - Autonomously. Needed for ERES.
889 --   Outstanding notifications are canceled. The process is then considered
890 --   complete, with a status specified by the result argument.
891 -- IN
892 --   itemtype - A valid item type
893 --   itemkey  - A string generated from the application object's primary key.
894 --   process  - Process to abort, specified in the form
895 --              [<parent process_name>:]<process instance_label>
896 --              If null abort the root process.
897 --   result   - Result to complete process with
898 --
899 procedure AbortProcessAuto(itemtype in varchar2,
900                        itemkey  in varchar2,
901                        process  in varchar2 default '',
902                        result   in varchar2 default '#FORCE');
903 
904 /*
905 ** Wrapper to propaget_user_role this has the additional signature
906 ** changes of wf_local_synch propagate_user_role
907 ** propagate_user_role - Synchronizes the WF_LOCAL_USER_ROLES table and
908 **                       updates the entity mgr if appropriate
909 */
910 PROCEDURE propagate_user_role2(p_user_orig_system      in varchar2,
911                               p_user_orig_system_id   in number,
912                               p_role_orig_system      in varchar2,
913                               p_role_orig_system_id   in number,
914                               p_start_date            in date default null,
915                               p_expiration_date       in date default null,
916                               p_overwrite             in boolean default FALSE,
917                               p_raiseErrors           in boolean default FALSE);
918 
919 --
920 -- event_raise_params
921 --   Wrapper for wf_event.raise() passing all parameters
922 -- IN
923 --   p_event_name
924 --   p_event_key
925 --
926 procedure event_raise_params(p_event_name  in  varchar2,
927                              p_event_key   in  varchar2,
928                 p_event_data       in clob default NULL,
929                 p_parameter_name1  in varchar2 default NULL,
930                 p_parameter_value1 in varchar2 default null,
931                 p_parameter_name2  in varchar2 default NULL,
932                 p_parameter_value2 in varchar2 default NULL,
933                 p_parameter_name3  in varchar2 default NULL,
934                 p_parameter_value3 in varchar2 default NULL,
938                 p_parameter_value5 in varchar2 default NULL,
935                 p_parameter_name4  in varchar2 default NULL,
936                 p_parameter_value4 in varchar2 default NULL,
937                 p_parameter_name5  in varchar2 default NULL,
939                 p_parameter_name6  in varchar2 default NULL,
940                 p_parameter_value6 in varchar2 default NULL,
941                 p_parameter_name7  in varchar2 default NULL,
942                 p_parameter_value7 in varchar2 default NULL,
943                 p_parameter_name8  in varchar2 default NULL,
944                 p_parameter_value8 in varchar2 default NULL,
945                 p_parameter_name9  in varchar2 default NULL,
946                 p_parameter_value9 in varchar2 default NULL,
947                 p_parameter_name10  in varchar2 default NULL,
948                 p_parameter_value10 in varchar2 default NULL,
949                 p_parameter_name11  in varchar2 default NULL,
950                 p_parameter_value11 in varchar2 default NULL,
951                 p_parameter_name12  in varchar2 default NULL,
952                 p_parameter_value12 in varchar2 default NULL,
953                 p_parameter_name13  in varchar2 default NULL,
954                 p_parameter_value13 in varchar2 default NULL,
955                 p_parameter_name14  in varchar2 default NULL,
956                 p_parameter_value14 in varchar2 default NULL,
957                 p_parameter_name15  in varchar2 default NULL,
958                 p_parameter_value15 in varchar2 default NULL,
959                 p_parameter_name16  in varchar2 default NULL,
960                 p_parameter_value16 in varchar2 default NULL,
961                 p_parameter_name17  in varchar2 default NULL,
962                 p_parameter_value17 in varchar2 default NULL,
963                 p_parameter_name18  in varchar2 default NULL,
964                 p_parameter_value18 in varchar2 default NULL,
965                 p_parameter_name19  in varchar2 default NULL,
966                 p_parameter_value19 in varchar2 default NULL,
967                 p_parameter_name20  in varchar2 default NULL,
968                 p_parameter_value20 in varchar2 default NULL,
969                 p_send_date   in date);
970 
971 
972 END FND_WF_ENGINE;