1 package WF_EVENT AUTHID CURRENT_USER as
2 /* $Header: WFEVENTS.pls 120.9.12020000.2 2013/04/24 12:59:16 skandepu ship $ */
3 /*#
4 * Provides APIs to communicate with the Business Event System and manage
5 * events.
6 */
7 ------------------------------------------------------------------------------
8 navigation binary_integer := dbms_aq.first_message;
9
10 ------------------------------------------------------------------------------
11 /*
12 ** exception source indicator - used by dispatch and listen (NONE | WF | RULE)
13 */
14 WF_EXCEPTION_SOURCE varchar2(10) := 'NONE';
15 ------------------------------------------------------------------------------
16 /*
17 ** **** PRIVATE VARIABLE - NOT FOR CUSTOMER USE ******
18 ** phase maxthreshold - used by dispatch to determine which subscriptions to
19 ** execute, only those with a phase < phase threshold
20 ** **** PRIVATE VARIABLE - NOT FOR CUSTOMER USE ******
21 */
22 PHASE_MAXTHRESHOLD number := 100;
23 ------------------------------------------------------------------------------
24 /*
25 ** **** PRIVATE VARIABLE - NOT FOR CUSTOMER USE ******
26 ** phase minstart - used by dispatch to determine which subscriptions to
27 ** execute, only those with a phase >= phase threshold
28 ** **** PRIVATE VARIABLE - NOT FOR CUSTOMER USE ******
29 */
30 PHASE_MINTHRESHOLD number := 0;
31 ------------------------------------------------------------------------------
32 /*
33 ** **** PRIVATE VARIABLE - NOT FOR CUSTOMER USE ******
34 ** account name - current schema
35 **
36 ** **** PRIVATE VARIABLE - NOT FOR CUSTOMER USE ******
37 */
38 ACCOUNT_NAME varchar2(320);
39 ------------------------------------------------------------------------------
40 /*
41 ** **** PRIVATE VARIABLE - NOT FOR CUSTOMER USE ******
42 ** local_system_guid - the value of local system guid
43 ** local_system_status - status of the local system
44 ** local_system_name - status of the local system
45 ** **** PRIVATE VARIABLE - NOT FOR CUSTOMER USE ******
46 */
47 local_system_guid raw(16);
48 local_system_status varchar2(10);
49 local_system_name varchar2(30);
50
51
52 schema_name varchar2(30);
53
54 ------------------------------------------------------------------------------
55 /*
56 ** **** PRIVATE VARIABLE - NOT FOR CUSTOMER USE ******
57 ** evt_param_index - pl/sql table to hold hash values of event parameters.
58 ** **** PRIVATE VARIABLE - NOT FOR CUSTOMER USE ******
59 */
60
61 TYPE Event_Param_INDEX is table of varchar2(4000) index by binary_integer;
62 evt_param_index Event_Param_INDEX;
63
64 /*
65 ** **** PRIVATE VARIABLE - NOT FOR CUSTOMER USE ******
66 ** sub_param_index - pl/sql table to hold hash values of subscription parameters.
67 ** **** PRIVATE VARIABLE - NOT FOR CUSTOMER USE ******
68 */
69
70 TYPE Subscription_Param_INDEX is table of varchar2(4000) index by binary_integer;
71 sub_param_index Subscription_Param_INDEX;
72
73 ------------------------------------------------------------------------------
74 /*
75 ** **** PRIVATE VARIABLE - NOT FOR CUSTOMER USE ******
76 ** g_correlation - Current correlation id.
77 ** g_queueType - Current Queue Type.
78 ** g_deq_condition - Dequeue Condition (9i feature)
79 ** g_dispatch_result - Result returned from dispatch_internal
80 ** **** PRIVATE VARIABLE - NOT FOR CUSTOMER USE ******
81 */
82
83 /*
84 ** **** PUBLIC VARIABLE ******
85 ** Max nested raise gives the number of recursive raises
86 ** possible.
87 **
88 */
89 NESTED_RAISE_COUNT number := 0;
90 MAX_NESTED_RAISES number := 100;
91
92 g_correlation varchar2(240);
93 g_queueType varchar2(20);
94 g_deq_condition varchar2(4000);
95 g_message_grouping varchar2(30);
96 g_msgid raw(16); --<rwunderl:2699059>
97 g_local_system_guid raw(16); --<rwunderl:2792298>
98
99 /*#
100 * Internally dispatch an event to one of the event's
101 * subscription.
102 * @param p_source_type The source of the evnet
103 * @param p_rule_data indicator if the event data should be generated
104 * @param p_rule_func the rule function of this subscription
105 * @param p_sub_guid GUID of this subscription
106 * @param p_source_agent_guid the agent where event comes
107 * @param p_phase the phase of this subscription
108 * @param p_priority priority of this sub
109 * @param p_event Event to be dispatched.
110 * @return The status of the subscription execution
111 */
112 FUNCTION dispatch_internal(p_source_type in varchar2,
113 p_rule_data in varchar2,
114 p_rule_func in varchar2,
115 p_sub_guid in raw,
116 p_source_agent_guid in raw,
117 p_phase in number,
118 p_priority in number,
119 p_event in out nocopy wf_event_t,
120 p_on_error in varchar2)
121 return varchar2;
122 ------------------------------------------------------------------------------
123 /*
124 ** test - Verifies the specified event is enabled. Then, tests if there
125 ** is an enabled LOCAL subscription for this event, or an enabled
126 ** subscription for an enabled group that contains this event.
127 **
128 ** Returns the most costly data requirement for active subscriptions
129 ** on the event:
130 ** NONE no subscription or no event (best)
131 ** KEY subscription requiring event key only
132 ** MESSAGE subscription requiring event message (worst)
133 */
134 /*#
135 * Tests whether the specified event is enabled and whether there are any
136 * enabled subscriptions by the local system referencing the event, or
137 * referencing an enabled event group that contains the event. Returns
138 * NONE if no enabled local subscriptions reference the event, or the
139 * event does not exist. Returns KEY if at least one enabled local
140 * subscription references the event, but all such subscriptions require
141 * only the event key. Returns MESSAGE if at least one enabled local
142 * subscription to the event requires the complete event data.
143 * @param p_event_name Event Name
144 * @return Most Costly Data Requirement among Subscriptions
145 */
146 FUNCTION test(p_event_name in varchar2) return varchar2;
147 ------------------------------------------------------------------------------
148 /*
149 ** send - send event message to agent
150 **
151 ** The event's FROM_AGENT specifies an output agent/queue upon which
152 ** the message should be placed. The event's TO_AGENT_LIST specifies
153 ** the message recipients for propagation.
154 **
155 ** The message will be asynchronously delivered to the
156 ** TO_AGENT by AQ propagation. If the FROM_AGENT is not specified,
157 ** the system will automatically enqueue the message to an output agent
158 ** that matches the recipient's queue type.
159 */
160 /*#
161 * Sends an event message from one agent to another. If the event message
162 * contains both a From Agent and a To Agent, the message is placed on
163 * the outbound queue of the From Agent and then asynchronously delivered
164 * to the To Agent by AQ propagation, or whichever type of propagation is
165 * implemented for the agents' protocol. If the event message contains a
166 * To Agent but no specified From Agent, the message is sent from the
167 * default outbound agent that matches the queue type of the To Agent. If
168 * the event message contains a From Agent but no specified To Agent, the
169 * event message is placed on the From Agent's queue without a specified
170 * recipient.
171 * @param p_event Event Message to Send
172 */
173 PROCEDURE send(p_event in out nocopy wf_event_t);
174 ------------------------------------------------------------------------------
175 /*#
176 * Sets the Recipient_List when an event is sent from one agent to another
177 * This method handles both Agent and Agent Group.
178 * @param p_event Event to be sent
179 * @param p_out_agent_name Source Agent Name
180 * @param p_out_system_name Source System Name
181 * @param x_message_properties the enqueue options with recipient list generated
182 */
183 PROCEDURE Set_Recipient_List(p_event in wf_event_t,
184 p_out_agent_name in varchar2,
185 p_out_system_name in varchar2,
186 x_message_properties in out nocopy dbms_aq.message_properties_t);
187 /*
188 ** newAgent - Construct a wf_agent_t from a guid
189 */
190 /*#
191 * Creates a WF_AGENT_T structure for the specified agent and sets the agent's
192 * system and name into the structure.
193 * @param p_agent_guid Agent GUID
194 * @return WF_AGENT_T structure containing Agent Information
195 */
196 FUNCTION newAgent(p_agent_guid in raw) return wf_agent_t;
197 ------------------------------------------------------------------------------
198 /*
199 ** dispatch - (internal) run event dispatcher for an event
200 **
201 ** Main subscription execution loop. Finds all matching
202 ** subscriptions and executes their rules.
203 **
204 ** P_SOURCE_TYPE is one of 'LOCAL', 'EXTERNAL', or 'ERROR',
205 ** indicating the general class of the event. This will be
206 ** matched against the corresonding column in the
207 ** subscriptions table when selecting subscriptions.
208 **
209 ** P_SOURCE_AGENT_GUID is NULL if local, otherwise is set to the
210 ** GUID of the agent that sent the event.
211 **
212 ** All matching subscriptions are then queried and executed.
213 ** Subscription execution is ordered by the PHASE attribute of the
214 ** subscriptions table. Subscription execution involves
215 */
216 /*#
217 * Creates a WF_AGENT_T structure for the specified agent and sets the agent's
218 * system and name into the structure.
219 * @param p_source_type LOCAL, EXTERNAL or ERROR
220 * @param p_source_agent_guid where the event comes
221 * @param p_event event to be dispatched
222 */
223 PROCEDURE dispatch(p_source_type in varchar2,
224 p_source_agent_guid in raw,
225 p_event in out nocopy wf_event_t);
226 ------------------------------------------------------------------------------
227 /*
228 ** raise - raise a local event to the event manager
229 ** -- Below Moved to Dispatcher --
230 ** Calls TEST to determine whether a MESSAGE type subscription
231 ** exists. If a MESSAGE is required, and none is specified by
232 ** the caller, we generate one using the GENERATE_FUNCTION
233 ** identified for the event in the WF_EVENTS table. If no
234 ** GENERATE_FUNCTION is found, we create a default message using
235 ** the event name and event key data.
236 ** -- Above moved to Dispatcher --
237 **
238 ** Event is passed to the dispatcher.
239 **
240 ** Note: If the event is not defined, no error will be raised.
241 */
242 /*#
243 * Raises a local event to the Event Manager. Creates a WF_EVENT_T structure
244 * for this event instance and sets the specified event name, event key,
245 * event data, parameter list, and send date into the structure. The event data
246 * can be passed to the Event Manager within the call to the Raise() API, or
247 * the Event Manager can obtain the event data itself by calling the Generate
248 * function for the event, after first checking whether the event data is
249 * required by a subscription.
250 * @param p_event_name Event Name
251 * @param p_event_key Event Key
252 * @param p_event_data Event Message
253 * @param p_parameters Parameter List
254 * @param p_send_date Send Date for a Deferred Event
255 */
256 PROCEDURE raise(p_event_name in varchar2,
257 p_event_key in varchar2,
258 p_event_data in clob default NULL,
259 p_parameters in wf_parameter_list_t default NULL,
260 p_send_date in date default NULL);
261 ------------------------------------------------------------------------------
262 /*
263 ** listen - dequeues and dispatches all events currently enqueued
264 ** for this agent.
265 **
266 ** Uses the appropriate QUEUE_HANDLER interface package to
267 ** dequeue events into the WF_EVENT_T type structure. Then
268 ** calls DISPATCH with the appropriate source type
269 ** (usually 'EXTERNAL' but 'ERROR' if agent name is 'WF_ERROR')
270 **
271 ** Exits after all the events have been dequeued.
272 **
273 ** The WF_SETUP package schedules LISTEN procedures for all active
274 ** inbound agents.
275 */
276 /*#
277 * Monitors an agent for inbound event messages and dequeues messages
278 * using the agent's queue handler. The standard WF_EVENT_QH queue handler
279 * sets the date and time when an event message is dequeued into the
280 * RECEIVE_DATE attribute of the event message. Custom queue handlers can
281 * also set the RECEIVE_DATE value if this functionality is included in the
282 * Dequeue API. When an event is dequeued, the Event Manager searches for and
283 * executes any active subscriptions by the local system to that event with
284 * a source type of External, and also any active subscriptions by the local
285 * system to the Any event with a source type of External. If no active
286 * subscriptions exist for the event that was received (apart from
287 * subscriptions to the Any event), then Oracle Workflow executes any active
288 * subscriptions by the local system to the Unexpected event with a source type
289 * of External.
290 * @param p_agent_name Agent Name
291 * @param p_wait Wait period in seconds
292 * @param p_correlation Correlation ID
293 * @param p_deq_condition Dequeue Condition
294 */
295 PROCEDURE listen(p_agent_name in varchar2,
296 p_wait in binary_integer default dbms_aq.no_wait,
297 p_correlation in varchar2 default null,
298 p_deq_condition in varchar2 default null);
299 ---------------------------------------------------------------------------
300 /*
301 ** listen - New API to implement GSC-alike Logic
302 **
303 ** Two more parameters are added: p_message_count and p_max_error_count
304 */
305 /*#
306 * New Listen API with Two more parameters are added: p_message_count and p_max_error_count
307 * to limit how many messages listener is going to process.
308 * @param p_agent_name Agent Name
309 * @param p_wait Wait period in seconds
310 * @param p_correlation Correlation ID
311 * @param p_deq_condition Dequeue condition as in SQL WHERE clause
312 * @param p_message_count maximum count of messages to be processed
313 * @param p_max_error_count maximum number of errors tolerated.
314 */
315 PROCEDURE listen(p_agent_name in varchar2,
316 p_wait in binary_integer default dbms_aq.no_wait,
317 p_correlation in varchar2 default null,
318 p_deq_condition in varchar2 default null,
319 p_message_count in out nocopy number,
320 p_max_error_count in out nocopy number);
321 ---------------------------------------------------------------------------
322 /*
323 ** listen_concurrent - This is a cover of listen() that can be used
324 ** by the Concurrent Manager.
325 */
326 --Bug 2505487
327 --Included the AQ wait parameter for the listen_concurrent
328
329 PROCEDURE listen_concurrent(errbuf out nocopy varchar2,
330 retcode out nocopy varchar2,
331 p_agent_name in varchar2,
332 p_correlation in varchar2 default null,
333 p_deq_condition in varchar2 default null,
334 p_wait in binary_integer default dbms_aq.no_wait
335 );
336 ---------------------------------------------------------------------------
337 /*
338 ** listen_grp - dequeues and dispatches all events currently enqueued
339 ** for this agent.
340 **
341 ** Supports message grouping to dequeue by transactions.
342 ** Uses the appropriate QUEUE_HANDLER interface package to
346 **
343 ** dequeue events into the WF_EVENT_T type structure. Then
344 ** calls DISPATCH with the appropriate source type
345 ** (usually 'EXTERNAL' but 'ERROR' if agent name is 'WF_ERROR')
347 ** Exits after all the events have been dequeued.
348 **
349 **
350 */
351 PROCEDURE listen_grp(p_agent_name in varchar2,
352 p_wait in binary_integer default dbms_aq.no_wait);
353 ---------------------------------------------------------------------------
354 /*
355 ** listen__grp_concurrent - This is a cover of listen_grp() that can be used
356 ** by the Concurrent Manager.
357 */
358 PROCEDURE listen_grp_concurrent(errbuf out nocopy varchar2,
359 retcode out nocopy varchar2,
360 p_agent_name in varchar2);
361
362 ---------------------------------------------------------------------------
363
364 /*
365 ** dequeue - generic dequeue.
366 **
367 ** Determines the appropriate QUEUE_HANDLER interface package to
368 ** dequeue events into the WF_EVENT_T type structure.
369 */
370 PROCEDURE dequeue(p_agent_guid in raw,
371 p_event out nocopy wf_event_t,
372 p_queue_handler in out nocopy varchar2,
373 p_wait in binary_integer default dbms_aq.no_wait,
374 p_correlation in varchar2 default null,
375 p_deq_condition in varchar2 default null);
376 ---------------------------------------------------------------------------
377 /*
378 ** enqueue - generic enqueue.
379 **
380 ** Determines the appropriate QUEUE_HANDLER interface package to
381 ** enqueue events from the WF_EVENT_T type structure.
382 **
383 ** If the p_out_agent_override is specified, enqueues to that
384 ** agent instead of the one specified in p_event.From_agent.
385 */
386 /*#
387 * Enqueues an event message onto a queue associated with an outbound agent.
388 * You can optionally specify an override agent where you want to enqueue the
389 * event message. Otherwise, the event message is enqueued on the From Agent
390 * specified within the message. The message recipient is set to the To Agent
391 * specified in the event message. Enqueue() uses the queue handler for the
392 * outbound agent to place the message on the queue.
393 * @param p_event Event Message to Enqueue
394 * @param p_out_agent_override Outbound Agent
395 */
396 PROCEDURE enqueue(p_event in wf_event_t,
397 p_out_agent_override in wf_agent_t default null);
398 ---------------------------------------------------------------------------
399 /*
400 ** setErrorInfo - retrieve the error information from the
401 ** stack and set into the wf_event_t.
402 **
403 ** p_type should be WARNING or ERROR
404 */
405 /*#
406 * Retrieves error information from the error stack and sets it into the event
407 * message. The error message and error stack are set into the corresponding
408 * attributes of the event message. The error name and error type are added to
409 * the PARAMETER_LIST attribute of the event message.
410 * @param p_event Event Message
411 * @param p_type Error Type ('ERROR' or 'WARNING')
412 */
413 PROCEDURE setErrorInfo(p_event in out nocopy wf_event_t,
414 p_type in varchar2);
415 ---------------------------------------------------------------------------
416 /*
417 ** AddParameterToList - adds name and value to varray size 100
418 ** wf_parameter_list_t
419 ** if the varray is null, will initialize
420 ** otherwise just adds to end of list
421 */
422 /*#
423 * Adds the specified parameter name and value pair to the end of the specified
424 * parameter list varray. If the varray is null, AddParameterToList()
425 * initializes it with the new parameter.
426 * @param p_name Parameter Name
427 * @param p_value Parameter Value
428 * @param p_parameterlist Parameter List
429 */
430 PROCEDURE AddParameterToList(p_name in varchar2,
431 p_value in varchar2,
432 p_parameterlist in out nocopy wf_parameter_list_t);
433 ---------------------------------------------------------------------------
434 /*
435 ** AddParameterToListPos - adds name and value to varray size 100
436 ** wf_parameter_list_t
437 ** if the varray is null, will initialize
438 ** After the value is set,
439 ** the index will be set into the position.
440 */
441 /*#
442 * Adds the specified parameter name and value pair to the end of the specified
443 * parameter list varray. If the varray is null, AddParameterToListPos()
444 * initializes it with the new parameter. The procedure also returns the
445 * index for the position at which the parameter is stored within the varray.
446 * @param p_name Parameter Name
447 * @param p_value Parameter Value
448 * @param p_position Position at which Parameter is Added
449 * @param p_parameterlist Parameter List
450 */
451 PROCEDURE AddParameterToListPos(p_name in varchar2,
452 p_value in varchar2,
453 p_position out nocopy integer,
454 p_parameterlist in out nocopy wf_parameter_list_t);
455 ---------------------------------------------------------------------------
456 /*
457 ** GetValueForParameter - Gets value for name from wf_parameter_list_t
458 */
459 /*#
460 * Retrieves the value of the specified parameter from the specified parameter
461 * list varray. GetValueForParameter() begins at the end of the parameter list
462 * and searches backwards through the list.
463 * @param p_name Parameter Name
464 * @param p_parameterlist Parameter List
468 p_parameterlist in wf_parameter_list_t)
465 * @return Parameter Value
466 */
467 FUNCTION getValueForParameter(p_name in varchar2,
469 return varchar2;
470 ---------------------------------------------------------------------------
471 /*
472 ** GetValueForParameterPos - Gets value for position from wf_parameter_list_t
473 */
474 /*#
475 * Retrieves the value of the parameter stored at the specified position in
476 * the specified parameter list varray.
477 * @param p_position Parameter Position in the List
478 * @param p_parameterlist Parameter List
479 * @return Parameter Value
480 */
481 FUNCTION getValueForParameterPos(p_position in integer,
482 p_parameterlist in wf_parameter_list_t)
483 return varchar2;
484 ---------------------------------------------------------------------------
485 /*
486 ** SetDispatchMode
487 ** - Sets Phase Max Threshold to -1 or 100
488 */
489 /*#
490 * Sets the dispatch mode of the Event Manager to either deferred or
491 * synchronous subscription processing. Call SetDispatchMode() with the
492 * mode 'ASYNC' just before calling Raise() to defer all subscription
493 * processing forever for the event that you will raise. In this case, the
494 * Event Manager places the event on the WF_DEFERRED queue before
495 * executing any subscriptions for that event. The subscriptions are not
496 * executed until the agent listener runs to dequeue the event from the
497 * WF_DEFERRED queue. You can call SetDispatchMode() with the mode 'SYNC' to
498 * set the dispatch mode back to normal synchronous subscription processing.
499 * In this mode, the phase number for each subscription determines whether
500 * the subscription is executed immediately or deferred.
501 * @param p_mode Dispatch Mode
502 */
503 PROCEDURE SetDispatchMode(p_mode in varchar2);
504 ---------------------------------------------------------------------------
505 /*
506 ** InitPhaseMinThreshold
507 ** - Sets Phase Min Threshold to 0
508 */
509 PROCEDURE InitPhaseMinThreshold;
510 ---------------------------------------------------------------------------
511 /*
512 ** DeferEvent - Saves Event to Deferred Queue
513 */
514 PROCEDURE DeferEvent(p_source_type in varchar2,
515 p_event in out nocopy wf_event_t);
516 ---------------------------------------------------------------------------
517 /*
518 ** DeferEventToJava - Saves Event to WF_JAVA_DEFERRED Queue
519 */
520 PROCEDURE DeferEventToJava(p_source_type in varchar2,
521 p_event in out nocopy wf_event_t);
522 ---------------------------------------------------------------------------
523 /*
524 ** GetDeferEventCtx - Determines the Source Type and Start Phase
525 ** of deferred events
526 */
527 PROCEDURE GetDeferEventCtx (p_source_type in out nocopy varchar2,
528 p_agent_name in varchar2,
529 p_system_name in varchar2,
530 p_event in wf_event_t);
531 ---------------------------------------------------------------------------
532 /*
533 ** SetAccountName - Populates Global Variable with account name
534 ** the session is logged in under
535 */
536 PROCEDURE SetAccountName;
537 ---------------------------------------------------------------------------
538 --
539 -- Bug# 2211719 - New API raise2 for calls that do not understand
540 -- Oracle data types
541
542 /*
543 ** Raise API for calls that donot understand Oracle types
544 */
545
546 PROCEDURE raise2(p_event_name in varchar2,
547 p_event_key in varchar2,
548 p_event_data in clob default NULL,
549 p_parameter_name1 in varchar2 default NULL,
550 p_parameter_value1 in varchar2 default NULL,
551 p_parameter_name2 in varchar2 default NULL,
552 p_parameter_value2 in varchar2 default NULL,
553 p_parameter_name3 in varchar2 default NULL,
554 p_parameter_value3 in varchar2 default NULL,
555 p_parameter_name4 in varchar2 default NULL,
556 p_parameter_value4 in varchar2 default NULL,
557 p_parameter_name5 in varchar2 default NULL,
558 p_parameter_value5 in varchar2 default NULL,
559 p_parameter_name6 in varchar2 default NULL,
560 p_parameter_value6 in varchar2 default NULL,
561 p_parameter_name7 in varchar2 default NULL,
562 p_parameter_value7 in varchar2 default NULL,
563 p_parameter_name8 in varchar2 default NULL,
564 p_parameter_value8 in varchar2 default NULL,
565 p_parameter_name9 in varchar2 default NULL,
566 p_parameter_value9 in varchar2 default NULL,
567 p_parameter_name10 in varchar2 default NULL,
568 p_parameter_value10 in varchar2 default NULL,
569 p_parameter_name11 in varchar2 default NULL,
570 p_parameter_value11 in varchar2 default NULL,
571 p_parameter_name12 in varchar2 default NULL,
572 p_parameter_value12 in varchar2 default NULL,
573 p_parameter_name13 in varchar2 default NULL,
574 p_parameter_value13 in varchar2 default NULL,
575 p_parameter_name14 in varchar2 default NULL,
576 p_parameter_value14 in varchar2 default NULL,
577 p_parameter_name15 in varchar2 default NULL,
578 p_parameter_value15 in varchar2 default NULL,
579 p_parameter_name16 in varchar2 default NULL,
580 p_parameter_value16 in varchar2 default NULL,
581 p_parameter_name17 in varchar2 default NULL,
585 p_parameter_name19 in varchar2 default NULL,
582 p_parameter_value17 in varchar2 default NULL,
583 p_parameter_name18 in varchar2 default NULL,
584 p_parameter_value18 in varchar2 default NULL,
586 p_parameter_value19 in varchar2 default NULL,
587 p_parameter_name20 in varchar2 default NULL,
588 p_parameter_value20 in varchar2 default NULL,
589 p_send_date in date default NULL);
590 ---------------------------------------------------------------------------
591 /*
592 ** CreateParamater - Creates a wf_parameter_t type object based in the
593 ** input name and value
594 */
595
596 FUNCTION CreateParameter (p_name in varchar2,
597 p_value in varchar2)
598 return wf_parameter_t;
599
600 --------------------------------------------------------------------------
601 --Bug2375902
602 --New API that raises an event with the parameterlist and
603 --returns the same to the calling program
604 -------------------------------------------------------------------------
605 /*#
606 * Raises a local event to the Event Manager and returns the parameter list for
607 * the event. Raise3() performs the same processing as the Raise() procedure,
608 * except that Raise3() passes the event parameter list back to the calling
609 * application after completing the event subsription processing.
610 * @param p_event_name Event Name
611 * @param p_event_key Event Key
612 * @param p_event_data Event Message
613 * @param p_parameter_list Parameter List
614 * @param p_send_date Send Date for a Deferred Event
615 */
616 PROCEDURE raise3(p_event_name in varchar2,
617 p_event_key in varchar2,
618 p_event_data in clob default NULL,
619 p_parameter_list in out nocopy wf_parameter_list_t,
620 p_send_date in date default NULL);
621
622 ---------------------------------------------------------------------------
623
624
625 --------------------------------------------------------------------------------
626 -- Sets the queue correlation (g_correlation) for dequeuing.
627 --
628 -- NOTE: This has been done because we did not want to change the signature of
629 -- dequeue in the queue handler
630 --
631 -- p_correlation - the correlation
632 --------------------------------------------------------------------------------
633 PROCEDURE Set_Correlation(p_correlation in varchar2);
634
635 ---------------------------------------------------------------------------
636 /*
637 ** PUBLIC
638 ** SetMaxNestedRaise - Populates Global Variable : max_nested_raises
639 ** with the value specified in the input parameter.
640 */
641 /*#
642 * Sets the maximum number of nested raises that can be performed to the
643 * specified value. A nested raise occurs when one event is raised and a Local
644 * subscription to that event is executed and raises another event. The default
645 * maximum is 100.
646 * @param maxcount Maximum Number of Nested Raises
647 */
648 PROCEDURE SetMaxNestedRaise (maxcount in number default 100);
649 ---------------------------------------------------------------------------
650 /*
651 ** PUBLIC
652 ** SetNestedRaiseCount - Populates Global Variable : nested_raises_count
653 ** with the value specified in the input parameter.
654 */
655 PROCEDURE SetNestedRaiseCount (nestedcount in number default 0);
656 ---------------------------------------------------------------------------
657 /*
658 ** PUBLIC
659 ** GetMaxNestedRaise - Get the value of the Global Variable max_nested_raises
660 */
661 /*#
662 * Returns the maximum number of nested raises that can currently be performed.
663 * A nested raise occurs when one event is raised and a Local subscription to
664 * that event is executed and raises another event.
665 * @return Maximum Number of Nested Raises
666 */
667 FUNCTION GetMaxNestedRaise return number;
668
669 ---------------------------------------------------------------------------
670 /*
671 ** PUBLIC
672 ** GetNestedRaiseCount - Get the value of the Global Variable
673 ** nested_raises_count
674 */
675
676 FUNCTION GetNestedRaiseCount return number;
677
678 ----------------------------------------------------------------------------
679
680 FUNCTION Get_MsgId return varchar2;
681
682 ----------------------------------------------------------------------------
683 /*
684 ** PUBLIC
685 ** GetLocalSystemInfo - Gets the local system name, guid and status
686 */
687
688 PROCEDURE GetLocalSystemInfo(system_guid out nocopy raw,
689 system_name out nocopy varchar2,
690 system_status out nocopy varchar2);
691
692 ----------------------------------------------------------------------------
693 /*
694 ** PUBLIC
695 ** GetSourceAgentGUID - Gets the agent guid based on the agent name and the
696 ** system name
697 */
698 PROCEDURE GetSourceAgentGUID(agent_name in varchar2,
699 agent_system in varchar2,
700 agent_guid out nocopy raw);
701
702 ----------------------------------------------------------------------------
703 /*
704 ** PUBLIC
705 ** StartAgent - Starts the given agent (if not already running) based on
706 ** whether it is enabled for enqueue or dequeue or both
707 */
708 procedure StartAgent(agent_name in varchar2);
709
710 ----------------------------------------------------------------------------
711 /*
712 ** PUBLIC
713 ** Peek_Agent - Listens on the given queue to check for messages
714 */
715 FUNCTION Peek_Agent(p_agent_name IN VARCHAR2)
716 RETURN VARCHAR2;
717
718 ----------------------------------------------------------------------------
719 -- GetParamListFromString
720 -- Takes a space delimited NAME=VALUE pairs of Subscription Parameters
721 -- string and returns a WF_PARAMETER_LIST_T
722 -- IN
723 -- p_parameters A string with space delimited name=value pairs
724 function GetParamListFromString(p_parameters in varchar2)
725 return wf_parameter_list_t;
726
727 /*
728 ** PUBLIC
729 ** setNavigationParams - Sets the navigation parameters for dequeue: agent name,
730 ** and navigation threshold. The navigation threshold is the maximum
731 ** number of dequeued messages after which the navigation should be
732 ** set back to FIRST_MESSAGE; the threshold parameter does not apply
733 ** for TRANSACTIONAL dequeuing. Use setNavigationParams() typically
734 ** before a loop to dequeue several messages from an agent queue,
735 ** for instance, before calling listen().
736 */
737 procedure setNavigationParams(p_agentName in varchar2 default null
738 , p_navigationThreshold in number default 0);
739
740 /*
741 ** PUBLIC
742 ** resetNavigationParams - Resets the navigation message counter, so that next
743 ** navigation to use is FIRST_MESSAGE/NEXT_TRSANCTION (typically
744 ** when catching a dequeue exception).
745 */
746 procedure resetNavigationParams;
747
748 /*
749 ** PUBLIC
750 ** getQueueNavigation - Returns the next dequeue navigation (FIRST_MESSAGE,
751 ** NEXT_MESSAGE, etc.); to be used before calling dequeue() to
752 ** get the proper navigation option. It is assumed that
753 ** wf_event.setNavigationParams() was called before
754 ** starting a loop to dequeue messages from a queue.
755 ** Use this api to get the proper navigation value just before
756 ** dequeuing, so that the agent parameter
757 ** NAVIGATION_RESET_THRESHOLD takes effect.
758 */
759 function getQueueNavigation return BINARY_INTEGER;
760
761 /*
762 ** Submits the concurrent request for FNDWFLIC CP.
763 ** -- It being used to submit CP reuqest from PATCH edition.
764 */
765 procedure submit_cp_request;
766
767 end WF_EVENT;