DBA Data[Home] [Help]

APPS.WF_QUEUE dependencies on WF_QUEUE

Line 1: PACKAGE BODY WF_QUEUE AS

1: PACKAGE BODY WF_QUEUE AS
2: /* $Header: wfqueb.pls 120.5 2007/06/11 14:09:45 dgadhira ship $ */
3:
4: --
5: -- Exceptions

Line 188: wf_queue.PurgeEvent(wf_queue.InboundQueue, message_handle, FALSE);

184: end if;
185:
186: --If we came successfully till here let us purge off the
187: --data from the Q
188: wf_queue.PurgeEvent(wf_queue.InboundQueue, message_handle, FALSE);
189:
190: exception
191: when others then
192: Wf_Core.Context('Wf_Queue', 'Process_Inbound_Event', itemtype,itemkey);

Line 192: Wf_Core.Context('Wf_Queue', 'Process_Inbound_Event', itemtype,itemkey);

188: wf_queue.PurgeEvent(wf_queue.InboundQueue, message_handle, FALSE);
189:
190: exception
191: when others then
192: Wf_Core.Context('Wf_Queue', 'Process_Inbound_Event', itemtype,itemkey);
193:
194: raise;
195:
196: end Process_Inbound_Event;

Line 204: if (wf_queue.name_init = FALSE) then

200: -- ====================================================================
201: function DeferredQueue return varchar2
202: as
203: begin
204: if (wf_queue.name_init = FALSE) then
205: wf_queue.set_queue_names;
206: end if;
207: return (wf_queue.deferred_queue_name);
208: exception

Line 205: wf_queue.set_queue_names;

201: function DeferredQueue return varchar2
202: as
203: begin
204: if (wf_queue.name_init = FALSE) then
205: wf_queue.set_queue_names;
206: end if;
207: return (wf_queue.deferred_queue_name);
208: exception
209: when others then

Line 207: return (wf_queue.deferred_queue_name);

203: begin
204: if (wf_queue.name_init = FALSE) then
205: wf_queue.set_queue_names;
206: end if;
207: return (wf_queue.deferred_queue_name);
208: exception
209: when others then
210: Wf_Core.Context('Wf_Queue', 'DeferredQueue');
211: raise;

Line 210: Wf_Core.Context('Wf_Queue', 'DeferredQueue');

206: end if;
207: return (wf_queue.deferred_queue_name);
208: exception
209: when others then
210: Wf_Core.Context('Wf_Queue', 'DeferredQueue');
211: raise;
212: end;
213:
214: function OutboundQueue return varchar2

Line 217: if (wf_queue.name_init = FALSE) then

213:
214: function OutboundQueue return varchar2
215: as
216: begin
217: if (wf_queue.name_init = FALSE) then
218: wf_queue.set_queue_names;
219: end if;
220: return (wf_queue.outbound_queue_name);
221: exception

Line 218: wf_queue.set_queue_names;

214: function OutboundQueue return varchar2
215: as
216: begin
217: if (wf_queue.name_init = FALSE) then
218: wf_queue.set_queue_names;
219: end if;
220: return (wf_queue.outbound_queue_name);
221: exception
222: when others then

Line 220: return (wf_queue.outbound_queue_name);

216: begin
217: if (wf_queue.name_init = FALSE) then
218: wf_queue.set_queue_names;
219: end if;
220: return (wf_queue.outbound_queue_name);
221: exception
222: when others then
223: Wf_Core.Context('Wf_Queue', 'OutboundQueue');
224: raise;

Line 223: Wf_Core.Context('Wf_Queue', 'OutboundQueue');

219: end if;
220: return (wf_queue.outbound_queue_name);
221: exception
222: when others then
223: Wf_Core.Context('Wf_Queue', 'OutboundQueue');
224: raise;
225: end;
226:
227: function InboundQueue return varchar2

Line 230: if (wf_queue.name_init = FALSE) then

226:
227: function InboundQueue return varchar2
228: as
229: begin
230: if (wf_queue.name_init = FALSE) then
231: wf_queue.set_queue_names;
232: end if;
233: return (wf_queue.inbound_queue_name);
234: exception

Line 231: wf_queue.set_queue_names;

227: function InboundQueue return varchar2
228: as
229: begin
230: if (wf_queue.name_init = FALSE) then
231: wf_queue.set_queue_names;
232: end if;
233: return (wf_queue.inbound_queue_name);
234: exception
235: when others then

Line 233: return (wf_queue.inbound_queue_name);

229: begin
230: if (wf_queue.name_init = FALSE) then
231: wf_queue.set_queue_names;
232: end if;
233: return (wf_queue.inbound_queue_name);
234: exception
235: when others then
236: Wf_Core.Context('Wf_Queue', 'InboundQueue');
237: raise;

Line 236: Wf_Core.Context('Wf_Queue', 'InboundQueue');

232: end if;
233: return (wf_queue.inbound_queue_name);
234: exception
235: when others then
236: Wf_Core.Context('Wf_Queue', 'InboundQueue');
237: raise;
238: end;
239:
240: -- NAME: Set_queue_names (PRIVATE)

Line 250: if wf_queue.name_init then

246:
247: begin
248:
249: --dont bother re-executing this if already initialized.
250: if wf_queue.name_init then
251: return;
252: end if;
253:
254: schema_name := wf_core.translate('WF_SCHEMA');

Line 264: into wf_queue.account_name

260: -- intended schema whether the install is with invoker's right or
261: -- definer's right (default).
262: begin
263: select sys_context('USERENV', 'CURRENT_SCHEMA')
264: into wf_queue.account_name
265: from sys.dual;
266: exception
267: when OTHERS then
268: wf_queue.account_name := NULL;

Line 268: wf_queue.account_name := NULL;

264: into wf_queue.account_name
265: from sys.dual;
266: exception
267: when OTHERS then
268: wf_queue.account_name := NULL;
269: end;
270:
271: wf_queue.deferred_queue_name := schema_name||'.WF_DEFERRED_QUEUE_M';
272: wf_queue.outbound_queue_name := schema_name||'.WF_OUTBOUND_QUEUE';

Line 271: wf_queue.deferred_queue_name := schema_name||'.WF_DEFERRED_QUEUE_M';

267: when OTHERS then
268: wf_queue.account_name := NULL;
269: end;
270:
271: wf_queue.deferred_queue_name := schema_name||'.WF_DEFERRED_QUEUE_M';
272: wf_queue.outbound_queue_name := schema_name||'.WF_OUTBOUND_QUEUE';
273: wf_queue.inbound_queue_name := schema_name||'.WF_INBOUND_QUEUE';
274: wf_queue.name_init := TRUE;
275: exception

Line 272: wf_queue.outbound_queue_name := schema_name||'.WF_OUTBOUND_QUEUE';

268: wf_queue.account_name := NULL;
269: end;
270:
271: wf_queue.deferred_queue_name := schema_name||'.WF_DEFERRED_QUEUE_M';
272: wf_queue.outbound_queue_name := schema_name||'.WF_OUTBOUND_QUEUE';
273: wf_queue.inbound_queue_name := schema_name||'.WF_INBOUND_QUEUE';
274: wf_queue.name_init := TRUE;
275: exception
276: when others then

Line 273: wf_queue.inbound_queue_name := schema_name||'.WF_INBOUND_QUEUE';

269: end;
270:
271: wf_queue.deferred_queue_name := schema_name||'.WF_DEFERRED_QUEUE_M';
272: wf_queue.outbound_queue_name := schema_name||'.WF_OUTBOUND_QUEUE';
273: wf_queue.inbound_queue_name := schema_name||'.WF_INBOUND_QUEUE';
274: wf_queue.name_init := TRUE;
275: exception
276: when others then
277: Wf_Core.Context('Wf_Queue', 'Set_queue_names');

Line 274: wf_queue.name_init := TRUE;

270:
271: wf_queue.deferred_queue_name := schema_name||'.WF_DEFERRED_QUEUE_M';
272: wf_queue.outbound_queue_name := schema_name||'.WF_OUTBOUND_QUEUE';
273: wf_queue.inbound_queue_name := schema_name||'.WF_INBOUND_QUEUE';
274: wf_queue.name_init := TRUE;
275: exception
276: when others then
277: Wf_Core.Context('Wf_Queue', 'Set_queue_names');
278: raise;

Line 277: Wf_Core.Context('Wf_Queue', 'Set_queue_names');

273: wf_queue.inbound_queue_name := schema_name||'.WF_INBOUND_QUEUE';
274: wf_queue.name_init := TRUE;
275: exception
276: when others then
277: Wf_Core.Context('Wf_Queue', 'Set_queue_names');
278: raise;
279: end set_queue_names;
280:
281:

Line 309: dequeue_options.consumer_name := wf_queue.account_name;

305: dequeue_options.navigation := dbms_aq.FIRST_MESSAGE;
306:
307: -- check if we need to have a consumer
308: if (multiconsumer) then
309: dequeue_options.consumer_name := wf_queue.account_name;
310: end if;
311:
312: dbms_aq.dequeue
313: (

Line 331: Wf_Core.Context('Wf_Queue', 'PurgeEvent', queuename,

327: when msgid_notfound then
328: null; -- Already purged from the queue.
329:
330: when others then
331: Wf_Core.Context('Wf_Queue', 'PurgeEvent', queuename,
332: rawtohex(message_handle));
333: raise;
334:
335: end PurgeEvent;

Line 356: wf_queue.set_queue_names;

352: begin
353: dequeue_options.dequeue_mode := dbms_aq.REMOVE;
354: dequeue_options.wait := dbms_aq.NO_WAIT;
355: dequeue_options.navigation := dbms_aq.FIRST_MESSAGE;
356: wf_queue.set_queue_names;
357:
358: if correlation is not null then
359: dequeue_options.correlation := correlation;
360: else

Line 361: dequeue_options.correlation := wf_queue.account_name||nvl(itemtype,'%');

357:
358: if correlation is not null then
359: dequeue_options.correlation := correlation;
360: else
361: dequeue_options.correlation := wf_queue.account_name||nvl(itemtype,'%');
362: end if;
363:
364: LOOP
365: dbms_aq.dequeue

Line 380: Wf_Core.Context('Wf_Queue', 'PurgeItemtype', queuename, itemtype);

376: exception
377: when dequeue_timeout then
378: null; -- nothing left on queue to remove
379: when others then
380: Wf_Core.Context('Wf_Queue', 'PurgeItemtype', queuename, itemtype);
381: raise;
382: end PurgeItemtype;
383:
384: -- ProcessDeferredEvent (PRIVATE)

Line 417: wf_queue.PurgeEvent(wf_queue.DeferredQueue, message_handle, TRUE);

413: Wf_Engine_Util.Process_Activity(itemtype, itemkey, actid,
414: maxthreshold, TRUE);
415:
416: -- we successfully processed the activity so dequeue it.
417: wf_queue.PurgeEvent(wf_queue.DeferredQueue, message_handle, TRUE);
418:
419:
420: Exception
421: when others then

Line 444: Wf_Core.Context('Wf_Queue', 'ProcessDeferredEvent', itemtype,

440: -- 3. execute the error process (if any)
441: -- 4. clear the error to continue with next activity
442: -- **note the error stack will refer to the actid that has been
443: -- rolled back!
444: Wf_Core.Context('Wf_Queue', 'ProcessDeferredEvent', itemtype,
445: to_char(minthreshold), to_char(maxthreshold));
446: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
447: wf_engine.eng_exception, FALSE);
448: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey,

Line 461: Wf_Core.Context('Wf_Queue', 'ProcessDeferredEvent', itemtype,

457: Fnd_Concurrent.Set_Preferred_RBS;
458:
459: exception
460: when others then
461: Wf_Core.Context('Wf_Queue', 'ProcessDeferredEvent', itemtype,
462: to_char(minthreshold), to_char(maxthreshold));
463: raise;
464: end ProcessDeferredEvent;
465:

Line 491: wf_queue.set_queue_names;

487:
488: if correlation is not null then
489: lcorrelation := correlation;
490: else
491: wf_queue.set_queue_names;
492: lcorrelation := wf_queue.account_name||itemtype;
493: end if;
494:
495: -- if error stack is defined then set result to ERROR.

Line 492: lcorrelation := wf_queue.account_name||itemtype;

488: if correlation is not null then
489: lcorrelation := correlation;
490: else
491: wf_queue.set_queue_names;
492: lcorrelation := wf_queue.account_name||itemtype;
493: end if;
494:
495: -- if error stack is defined then set result to ERROR.
496: if error_stack is null then

Line 503: wf_queue.Enqueue_Event(queuename =>wf_queue.InboundQueue,

499: lresult := ':ERROR';
500: end if;
501:
502:
503: wf_queue.Enqueue_Event(queuename =>wf_queue.InboundQueue,
504: itemtype =>enqueueInbound.itemtype,
505: itemkey =>enqueueInbound.itemkey,
506: actid =>enqueueInbound.actid,
507: funcname =>enqueueInbound.error_stack,

Line 514: Wf_Core.Context('Wf_Queue', 'EnqueueInbound', itemtype,

510: result =>lresult,
511: message_handle =>handle);
512: exception
513: when others then
514: Wf_Core.Context('Wf_Queue', 'EnqueueInbound', itemtype,
515: itemkey, actid);
516: raise;
517: end EnqueueInbound;
518:

Line 603: Wf_Core.Context('Wf_Queue', 'Get_param_list', itemtype,

599: return(paramlist);
600:
601: exception
602: when others then
603: Wf_Core.Context('Wf_Queue', 'Get_param_list', itemtype,
604: itemkey, actid);
605: raise;
606: end Get_param_list;
607:

Line 624: wf_queue.set_queue_names;

620:
621: as
622: lcorrelation varchar2(80);
623: begin
624: wf_queue.set_queue_names;
625:
626: if correlation is not null then
627: lcorrelation := correlation;
628: else

Line 629: lcorrelation := wf_queue.account_name||nvl(itemtype,'%');

625:
626: if correlation is not null then
627: lcorrelation := correlation;
628: else
629: lcorrelation := wf_queue.account_name||nvl(itemtype,'%');
630: end if;
631:
632: wf_queue.Dequeue_Event(queuename =>wf_queue.OutboundQueue,
633: dequeuemode =>DequeueOutbound.dequeuemode,

Line 632: wf_queue.Dequeue_Event(queuename =>wf_queue.OutboundQueue,

628: else
629: lcorrelation := wf_queue.account_name||nvl(itemtype,'%');
630: end if;
631:
632: wf_queue.Dequeue_Event(queuename =>wf_queue.OutboundQueue,
633: dequeuemode =>DequeueOutbound.dequeuemode,
634: navigation =>DequeueOutbound.navigation,
635: correlation =>lcorrelation,
636: payload =>DequeueOutbound.payload,

Line 644: Wf_Core.Context('Wf_Queue', 'DequeueOutbound', payload.itemtype,

640:
641:
642: exception
643: when others then
644: Wf_Core.Context('Wf_Queue', 'DequeueOutbound', payload.itemtype,
645: payload.itemkey, payload.actid);
646: raise;
647:
648: end DequeueOutbound;

Line 670: wf_queue.set_queue_names;

666: as
667: event system.wf_payload_t;
668: lcorrelation varchar2(80);
669: begin
670: wf_queue.set_queue_names;
671:
672: --use the correlation or default it if null
673: if DequeueEventDetail.correlation is not null then
674: lcorrelation := DequeueEventDetail.correlation;

Line 676: lcorrelation := wf_queue.account_name||nvl(itemtype,'%');

672: --use the correlation or default it if null
673: if DequeueEventDetail.correlation is not null then
674: lcorrelation := DequeueEventDetail.correlation;
675: else
676: lcorrelation := wf_queue.account_name||nvl(itemtype,'%');
677: end if;
678:
679: -- call dequeue to retrieve the event
680: wf_queue.Dequeue_Event(queuename=>wf_queue.OutboundQueue,

Line 680: wf_queue.Dequeue_Event(queuename=>wf_queue.OutboundQueue,

676: lcorrelation := wf_queue.account_name||nvl(itemtype,'%');
677: end if;
678:
679: -- call dequeue to retrieve the event
680: wf_queue.Dequeue_Event(queuename=>wf_queue.OutboundQueue,
681: dequeuemode=>DequeueEventDetail.dequeuemode,
682: navigation =>DequeueEventDetail.navigation,
683: correlation=>lcorrelation,
684: payload=>event,

Line 698: Wf_Core.Context('Wf_Queue', 'DequeueEventDetail', itemtype||':'||itemkey,to_char(actid));

694:
695:
696: exception
697: when others then
698: Wf_Core.Context('Wf_Queue', 'DequeueEventDetail', itemtype||':'||itemkey,to_char(actid));
699: raise;
700:
701: end DequeueEventDetail;
702:

Line 733: wf_queue.set_queue_names;

729: pragma exception_init(snap_too_old, -1555);
730: begin
731:
732: -- find out the schema name
733: wf_queue.set_queue_names;
734:
735: dequeue_options.dequeue_mode := dequeuemode;
736: dequeue_options.wait := dbms_aq.NO_WAIT;
737: dequeue_options.navigation := navigation;

Line 758: dequeue_options.consumer_name := wf_queue.account_name;

754: end if;
755:
756: -- check if we need to have a consumer
757: if (multiconsumer) then
758: dequeue_options.consumer_name := wf_queue.account_name;
759: end if;
760:
761: begin
762: dbms_aq.dequeue( queue_name => Dequeue_Event.queuename,

Line 796: Wf_Core.Context('WF_QUEUE', 'Dequeue_Event', queuename, '%');

792: when dequeue_timeout then
793: timeout := TRUE;
794: when others then
795: if correlation is null then
796: Wf_Core.Context('WF_QUEUE', 'Dequeue_Event', queuename, '%');
797: else
798: Wf_Core.Context('WF_QUEUE', 'Dequeue_Event', queuename, correlation);
799: end if;
800: timeout := FALSE;

Line 798: Wf_Core.Context('WF_QUEUE', 'Dequeue_Event', queuename, correlation);

794: when others then
795: if correlation is null then
796: Wf_Core.Context('WF_QUEUE', 'Dequeue_Event', queuename, '%');
797: else
798: Wf_Core.Context('WF_QUEUE', 'Dequeue_Event', queuename, correlation);
799: end if;
800: timeout := FALSE;
801: raise;
802:

Line 881: wf_queue.PurgeEvent(wf_queue.DeferredQueue,message_handle,TRUE);

877: when no_data_found then
878: -- this event is no longer valid so remove it from the queue
879: -- happens when a rewind moved activity to history table
880: -- or the activity status is no longer defered
881: wf_queue.PurgeEvent(wf_queue.DeferredQueue,message_handle,TRUE);
882: return(FALSE);
883: when resource_busy then
884: return(FALSE);
885: when others then

Line 886: Wf_Core.Context('Wf_Queue', 'Activity_valid', 'Invalid',

882: return(FALSE);
883: when resource_busy then
884: return(FALSE);
885: when others then
886: Wf_Core.Context('Wf_Queue', 'Activity_valid', 'Invalid',
887: event.itemtype||':'||event.itemkey, to_char(event.actid));
888: return(FALSE);
889: end activity_valid;
890:

Line 895: -- Enqueues a message onto any WF queue (because all queues have same payload)

891: --
892: -- ====================================================================
893: --
894: -- Enqueue_Event (PRIVATE)
895: -- Enqueues a message onto any WF queue (because all queues have same payload)
896: --
897:
898: procedure Enqueue_Event(queuename in varchar2,
899: itemtype in varchar2,

Line 926: if (wf_queue.g_dequeue_item_type = enqueue_event.itemtype and

922: -- Bug 4005674
923: -- Check the occurrence of item_type:item_key:actid. If this is the same
924: -- activity which we just dequeued, calculate the number of occurrence
925: -- from history table since the background engine started.
926: if (wf_queue.g_dequeue_item_type = enqueue_event.itemtype and
927: wf_queue.g_dequeue_item_key = enqueue_event.itemkey and
928: wf_queue.g_dequeue_actid = enqueue_event.actid) then
929:
930: g_Key := WF_CACHE.HashKey(enqueue_event.itemtype||':'||

Line 927: wf_queue.g_dequeue_item_key = enqueue_event.itemkey and

923: -- Check the occurrence of item_type:item_key:actid. If this is the same
924: -- activity which we just dequeued, calculate the number of occurrence
925: -- from history table since the background engine started.
926: if (wf_queue.g_dequeue_item_type = enqueue_event.itemtype and
927: wf_queue.g_dequeue_item_key = enqueue_event.itemkey and
928: wf_queue.g_dequeue_actid = enqueue_event.actid) then
929:
930: g_Key := WF_CACHE.HashKey(enqueue_event.itemtype||':'||
931: enqueue_event.itemkey||':'||enqueue_event.actid);

Line 928: wf_queue.g_dequeue_actid = enqueue_event.actid) then

924: -- activity which we just dequeued, calculate the number of occurrence
925: -- from history table since the background engine started.
926: if (wf_queue.g_dequeue_item_type = enqueue_event.itemtype and
927: wf_queue.g_dequeue_item_key = enqueue_event.itemkey and
928: wf_queue.g_dequeue_actid = enqueue_event.actid) then
929:
930: g_Key := WF_CACHE.HashKey(enqueue_event.itemtype||':'||
931: enqueue_event.itemkey||':'||enqueue_event.actid);
932:

Line 959: l_min_delay := floor(l_background_occurrence/wf_queue.g_defer_occurrence)

955: g_ActivityHistoryCount(g_Key).HISTORY_COUNT := l_background_occurrence;
956:
957: -- Bug 4005674
958: -- For every 100 occurrences, add 5 mins to the delay up to a max of 60 mins
959: l_min_delay := floor(l_background_occurrence/wf_queue.g_defer_occurrence)
960: * wf_queue.g_add_delay_seconds;
961:
962: if (l_min_delay < wf_queue.g_max_delay_seconds) then
963: l_increment_delay := l_increment_delay + l_min_delay;

Line 960: * wf_queue.g_add_delay_seconds;

956:
957: -- Bug 4005674
958: -- For every 100 occurrences, add 5 mins to the delay up to a max of 60 mins
959: l_min_delay := floor(l_background_occurrence/wf_queue.g_defer_occurrence)
960: * wf_queue.g_add_delay_seconds;
961:
962: if (l_min_delay < wf_queue.g_max_delay_seconds) then
963: l_increment_delay := l_increment_delay + l_min_delay;
964: elsif (l_min_delay >= wf_queue.g_max_delay_seconds) then

Line 962: if (l_min_delay < wf_queue.g_max_delay_seconds) then

958: -- For every 100 occurrences, add 5 mins to the delay up to a max of 60 mins
959: l_min_delay := floor(l_background_occurrence/wf_queue.g_defer_occurrence)
960: * wf_queue.g_add_delay_seconds;
961:
962: if (l_min_delay < wf_queue.g_max_delay_seconds) then
963: l_increment_delay := l_increment_delay + l_min_delay;
964: elsif (l_min_delay >= wf_queue.g_max_delay_seconds) then
965: l_increment_delay := l_increment_delay + wf_queue.g_max_delay_seconds;
966: end if;

Line 964: elsif (l_min_delay >= wf_queue.g_max_delay_seconds) then

960: * wf_queue.g_add_delay_seconds;
961:
962: if (l_min_delay < wf_queue.g_max_delay_seconds) then
963: l_increment_delay := l_increment_delay + l_min_delay;
964: elsif (l_min_delay >= wf_queue.g_max_delay_seconds) then
965: l_increment_delay := l_increment_delay + wf_queue.g_max_delay_seconds;
966: end if;
967:
968: begin

Line 965: l_increment_delay := l_increment_delay + wf_queue.g_max_delay_seconds;

961:
962: if (l_min_delay < wf_queue.g_max_delay_seconds) then
963: l_increment_delay := l_increment_delay + l_min_delay;
964: elsif (l_min_delay >= wf_queue.g_max_delay_seconds) then
965: l_increment_delay := l_increment_delay + wf_queue.g_max_delay_seconds;
966: end if;
967:
968: begin
969: -- Add a run-time item attribute of #DELAY_ACTID_ to track the

Line 989: wf_queue.set_queue_names;

985: end if;
986: end;
987: end if;
988:
989: wf_queue.set_queue_names;
990: -- construct the event object
991: event:=system.wf_payload_t(itemtype,itemkey,actid,funcname,paramlist,result);
992:
993: -- dont make the data visible on the queue until a commit is issued

Line 1014: message_properties.correlation := wf_queue.account_name||itemtype;

1010:
1011: if correlation is not null then
1012: message_properties.correlation := enqueue_event.correlation;
1013: else
1014: message_properties.correlation := wf_queue.account_name||itemtype;
1015: end if;
1016:
1017: -- check the correlation is always set to something
1018: -- else it wil never be dequeued because we always default the dequeue

Line 1042: Wf_Core.Context('Wf_Queue', 'Enqueue_event', itemtype,

1038:
1039:
1040: exception
1041: when others then
1042: Wf_Core.Context('Wf_Queue', 'Enqueue_event', itemtype,
1043: itemkey, to_char(actid), to_char(delay));
1044: raise;
1045:
1046: end;

Line 1075: wf_queue.set_queue_names;

1071: commit;
1072:
1073: Fnd_Concurrent.Set_Preferred_RBS;
1074:
1075: wf_queue.set_queue_names;
1076:
1077: if correlation is not null then
1078: lcorrelation := correlation;
1079: else

Line 1080: lcorrelation := wf_queue.account_name||nvl(itemtype,'%');

1076:
1077: if correlation is not null then
1078: lcorrelation := correlation;
1079: else
1080: lcorrelation := wf_queue.account_name||nvl(itemtype,'%');
1081: end if;
1082:
1083: -- loop through the inbound queue.
1084: loop --Process until nothing left on the queue

Line 1096: wf_queue.Dequeue_Event(wf_queue.InboundQueue,

1092: --Lets set a savepoint here
1093: --We would use this savepoint to rollback if we found that a
1094: --lock is not possible in this session for the reterived itemytype key
1095:
1096: wf_queue.Dequeue_Event(wf_queue.InboundQueue,
1097: dbms_aq.LOCKED,
1098: navigation,
1099: lcorrelation,
1100: payload,

Line 1125: wf_queue.Process_Inbound_Event(itemtype=>payload.itemtype,

1121: --Check the parameterlist null/not within Process_Inbound_Event
1122:
1123: if wf_item.acquire_lock(payload.itemtype, payload.itemkey) then
1124: --Process the payload
1125: wf_queue.Process_Inbound_Event(itemtype=>payload.itemtype,
1126: itemkey=>payload.itemkey,
1127: actid=>payload.actid,
1128: message_handle=>ProcessInboundQueue.message_handle,
1129: p_payload => payload);

Line 1149: Wf_Core.Context('Wf_Queue', 'ProcessInboundQueue');

1145: exit when nothing_processed;
1146: end loop;
1147: exception
1148: when others then
1149: Wf_Core.Context('Wf_Queue', 'ProcessInboundQueue');
1150: raise;
1151: end ProcessInboundQueue;
1152:
1153: procedure ProcessDeferredQueue (itemtype in varchar2 default null,

Line 1174: wf_queue.set_queue_names;

1170: -- Bug 4005674
1171: -- Record the sysdate when background engine started.
1172: g_background_begin_date := sysdate;
1173:
1174: wf_queue.set_queue_names;
1175:
1176: if correlation is not null then
1177: lcorrelation := correlation;
1178:

Line 1188: lcorrelation := wf_queue.account_name||nvl(itemtype,'%');

1184: -- for embedded, there was never the old format, so we are fine.
1185: -- or it is standalone with null item type, we cannot support the
1186: -- old correlation id format; otherwise, it will pick up everything.
1187: else
1188: lcorrelation := wf_queue.account_name||nvl(itemtype,'%');
1189: end if;
1190:
1191: loop -- keep processing the queue until there is nothing left
1192:

Line 1199: wf_queue.Dequeue_Event(

1195:
1196: loop -- keep processing until a timeout.
1197:
1198: message_handle:=null;
1199: wf_queue.Dequeue_Event(
1200: wf_queue.DeferredQueue,
1201: dbms_aq.LOCKED,
1202: navigation,
1203: lcorrelation,

Line 1200: wf_queue.DeferredQueue,

1196: loop -- keep processing until a timeout.
1197:
1198: message_handle:=null;
1199: wf_queue.Dequeue_Event(
1200: wf_queue.DeferredQueue,
1201: dbms_aq.LOCKED,
1202: navigation,
1203: lcorrelation,
1204: payload,

Line 1211: wf_queue.g_dequeue_item_type := payload.itemtype;

1207: TRUE);
1208:
1209: -- Bug 4005674
1210: -- Record the item_type:item_key:actid at dequeue time
1211: wf_queue.g_dequeue_item_type := payload.itemtype;
1212: wf_queue.g_dequeue_item_key := payload.itemkey;
1213: wf_queue.g_dequeue_actid := payload.actid;
1214:
1215: -- if no message is found, the message may be enqueued with the

Line 1212: wf_queue.g_dequeue_item_key := payload.itemkey;

1208:
1209: -- Bug 4005674
1210: -- Record the item_type:item_key:actid at dequeue time
1211: wf_queue.g_dequeue_item_type := payload.itemtype;
1212: wf_queue.g_dequeue_item_key := payload.itemkey;
1213: wf_queue.g_dequeue_actid := payload.actid;
1214:
1215: -- if no message is found, the message may be enqueued with the
1216: -- new correlation format, so reset the correlation id and retry.

Line 1213: wf_queue.g_dequeue_actid := payload.actid;

1209: -- Bug 4005674
1210: -- Record the item_type:item_key:actid at dequeue time
1211: wf_queue.g_dequeue_item_type := payload.itemtype;
1212: wf_queue.g_dequeue_item_key := payload.itemkey;
1213: wf_queue.g_dequeue_actid := payload.actid;
1214:
1215: -- if no message is found, the message may be enqueued with the
1216: -- new correlation format, so reset the correlation id and retry.
1217: if (navigation = dbms_aq.FIRST_MESSAGE and message_handle is null

Line 1220: lcorrelation := wf_queue.account_name||nvl(itemtype,'%');

1216: -- new correlation format, so reset the correlation id and retry.
1217: if (navigation = dbms_aq.FIRST_MESSAGE and message_handle is null
1218: and correlation is null and lcorrelation = itemtype) then
1219:
1220: lcorrelation := wf_queue.account_name||nvl(itemtype,'%');
1221:
1222: -- otherwise, process the message
1223: else
1224: if (timeout) then

Line 1238: wf_queue.ProcessDeferredEvent(itemtype=>payload.itemtype,

1234: minthreshold )
1235: AND
1236: wf_item.acquire_lock(payload.itemtype,payload.itemkey) then
1237:
1238: wf_queue.ProcessDeferredEvent(itemtype=>payload.itemtype,
1239: itemkey=>payload.itemkey,
1240: actid=>payload.actid,
1241: message_handle=>ProcessDeferredQueue.message_handle,
1242: minthreshold=>ProcessDeferredQueue.minthreshold,

Line 1256: if wf_queue.check_instance then

1252:
1253: --
1254: -- Test for Instance Shutdown
1255: --
1256: if wf_queue.check_instance then
1257: raise shutdown_pending;
1258: end if;
1259:
1260: navigation := dbms_aq.NEXT_MESSAGE;

Line 1271: Wf_Core.Context('Wf_Queue', 'ProcessDeferredQueue', 'Queue shutdown');

1267: end loop;
1268:
1269: exception
1270: when dequeue_disabled then
1271: Wf_Core.Context('Wf_Queue', 'ProcessDeferredQueue', 'Queue shutdown');
1272: raise;
1273: when shutdown_pending then
1274: Wf_Core.Context('Wf_Queue', 'ProcessDeferredQueue', 'DB shutting down');
1275: raise;

Line 1274: Wf_Core.Context('Wf_Queue', 'ProcessDeferredQueue', 'DB shutting down');

1270: when dequeue_disabled then
1271: Wf_Core.Context('Wf_Queue', 'ProcessDeferredQueue', 'Queue shutdown');
1272: raise;
1273: when shutdown_pending then
1274: Wf_Core.Context('Wf_Queue', 'ProcessDeferredQueue', 'DB shutting down');
1275: raise;
1276: when others then
1277: Wf_Core.Context('Wf_Queue', 'ProcessDeferredQueue');
1278: raise;

Line 1277: Wf_Core.Context('Wf_Queue', 'ProcessDeferredQueue');

1273: when shutdown_pending then
1274: Wf_Core.Context('Wf_Queue', 'ProcessDeferredQueue', 'DB shutting down');
1275: raise;
1276: when others then
1277: Wf_Core.Context('Wf_Queue', 'ProcessDeferredQueue');
1278: raise;
1279: end ProcessDeferredQueue;
1280:
1281:

Line 1302: wf_queue.set_queue_names;

1298: msg_id raw(16);
1299: begin
1300: dequeue_options.dequeue_mode := dbms_aq.BROWSE;
1301: dequeue_options.wait := dbms_aq.NO_WAIT;
1302: wf_queue.set_queue_names;
1303: if correlation is not null then
1304: dequeue_options.correlation := correlation;
1305: else
1306: dequeue_options.correlation := wf_queue.account_name||nvl(itemtype,'%');

Line 1306: dequeue_options.correlation := wf_queue.account_name||nvl(itemtype,'%');

1302: wf_queue.set_queue_names;
1303: if correlation is not null then
1304: dequeue_options.correlation := correlation;
1305: else
1306: dequeue_options.correlation := wf_queue.account_name||nvl(itemtype,'%');
1307: end if;
1308:
1309: if (multiconsumer) then
1310: dequeue_options.consumer_name := wf_queue.account_name;

Line 1310: dequeue_options.consumer_name := wf_queue.account_name;

1306: dequeue_options.correlation := wf_queue.account_name||nvl(itemtype,'%');
1307: end if;
1308:
1309: if (multiconsumer) then
1310: dequeue_options.consumer_name := wf_queue.account_name;
1311: end if;
1312:
1313: --execute first read
1314: dequeue_options.navigation := dbms_aq.FIRST_MESSAGE;

Line 1414: 'wf.plsql.WF_QUEUE.DequeueException.queue_empty',

1410: exception
1411: when no_messages then
1412: if (wf_log_pkg.level_event >= fnd_log.g_current_runtime_level) then
1413: wf_log_pkg.string(wf_log_pkg.level_event,
1414: 'wf.plsql.WF_QUEUE.DequeueException.queue_empty',
1415: 'No more messages in ExceptionDequeue.');
1416: end if;
1417: exit;
1418: end;

Line 1422: Wf_Core.Context('Wf_Queue', 'DequeueException',queuename);

1418: end;
1419: end loop;
1420: exception
1421: when others then
1422: Wf_Core.Context('Wf_Queue', 'DequeueException',queuename);
1423: raise;
1424: end DequeueException;
1425: --=============================================================
1426: -- Declare all developer APIs for Inbound queue manipulation

Line 1436: wf_queue.stck_itemtype(1) := '';

1432: -- Clears runtime cache
1433: procedure ClearMsgStack
1434: is
1435: begin
1436: wf_queue.stck_itemtype(1) := '';
1437: wf_queue.stck_itemkey(1) := '';
1438: wf_queue.stck_actid(1) := 0;
1439: wf_queue.stck_ctr := 0;
1440: exception

Line 1437: wf_queue.stck_itemkey(1) := '';

1433: procedure ClearMsgStack
1434: is
1435: begin
1436: wf_queue.stck_itemtype(1) := '';
1437: wf_queue.stck_itemkey(1) := '';
1438: wf_queue.stck_actid(1) := 0;
1439: wf_queue.stck_ctr := 0;
1440: exception
1441: when others then

Line 1438: wf_queue.stck_actid(1) := 0;

1434: is
1435: begin
1436: wf_queue.stck_itemtype(1) := '';
1437: wf_queue.stck_itemkey(1) := '';
1438: wf_queue.stck_actid(1) := 0;
1439: wf_queue.stck_ctr := 0;
1440: exception
1441: when others then
1442: Wf_Core.Context('Wf_Queue', 'ClearMsgStack');

Line 1439: wf_queue.stck_ctr := 0;

1435: begin
1436: wf_queue.stck_itemtype(1) := '';
1437: wf_queue.stck_itemkey(1) := '';
1438: wf_queue.stck_actid(1) := 0;
1439: wf_queue.stck_ctr := 0;
1440: exception
1441: when others then
1442: Wf_Core.Context('Wf_Queue', 'ClearMsgStack');
1443: raise;

Line 1442: Wf_Core.Context('Wf_Queue', 'ClearMsgStack');

1438: wf_queue.stck_actid(1) := 0;
1439: wf_queue.stck_ctr := 0;
1440: exception
1441: when others then
1442: Wf_Core.Context('Wf_Queue', 'ClearMsgStack');
1443: raise;
1444: end ClearMsgStack;
1445:
1446:

Line 1457: i := wf_queue.SearchMsgStack(itemtype,itemkey,actid);

1453: is
1454: i pls_integer;
1455: begin
1456:
1457: i := wf_queue.SearchMsgStack(itemtype,itemkey,actid);
1458:
1459: wf_queue.EnqueueInbound(
1460: itemtype=>wf_queue.stck_itemtype(i),
1461: itemkey =>wf_queue.stck_itemkey(i),

Line 1459: wf_queue.EnqueueInbound(

1455: begin
1456:
1457: i := wf_queue.SearchMsgStack(itemtype,itemkey,actid);
1458:
1459: wf_queue.EnqueueInbound(
1460: itemtype=>wf_queue.stck_itemtype(i),
1461: itemkey =>wf_queue.stck_itemkey(i),
1462: actid =>wf_queue.stck_actid(i),
1463: result =>wf_queue.stck_result(i),

Line 1460: itemtype=>wf_queue.stck_itemtype(i),

1456:
1457: i := wf_queue.SearchMsgStack(itemtype,itemkey,actid);
1458:
1459: wf_queue.EnqueueInbound(
1460: itemtype=>wf_queue.stck_itemtype(i),
1461: itemkey =>wf_queue.stck_itemkey(i),
1462: actid =>wf_queue.stck_actid(i),
1463: result =>wf_queue.stck_result(i),
1464: attrlist=>wf_queue.stck_attrlist(i));

Line 1461: itemkey =>wf_queue.stck_itemkey(i),

1457: i := wf_queue.SearchMsgStack(itemtype,itemkey,actid);
1458:
1459: wf_queue.EnqueueInbound(
1460: itemtype=>wf_queue.stck_itemtype(i),
1461: itemkey =>wf_queue.stck_itemkey(i),
1462: actid =>wf_queue.stck_actid(i),
1463: result =>wf_queue.stck_result(i),
1464: attrlist=>wf_queue.stck_attrlist(i));
1465:

Line 1462: actid =>wf_queue.stck_actid(i),

1458:
1459: wf_queue.EnqueueInbound(
1460: itemtype=>wf_queue.stck_itemtype(i),
1461: itemkey =>wf_queue.stck_itemkey(i),
1462: actid =>wf_queue.stck_actid(i),
1463: result =>wf_queue.stck_result(i),
1464: attrlist=>wf_queue.stck_attrlist(i));
1465:
1466:

Line 1463: result =>wf_queue.stck_result(i),

1459: wf_queue.EnqueueInbound(
1460: itemtype=>wf_queue.stck_itemtype(i),
1461: itemkey =>wf_queue.stck_itemkey(i),
1462: actid =>wf_queue.stck_actid(i),
1463: result =>wf_queue.stck_result(i),
1464: attrlist=>wf_queue.stck_attrlist(i));
1465:
1466:
1467: exception

Line 1464: attrlist=>wf_queue.stck_attrlist(i));

1460: itemtype=>wf_queue.stck_itemtype(i),
1461: itemkey =>wf_queue.stck_itemkey(i),
1462: actid =>wf_queue.stck_actid(i),
1463: result =>wf_queue.stck_result(i),
1464: attrlist=>wf_queue.stck_attrlist(i));
1465:
1466:
1467: exception
1468: when others then

Line 1469: Wf_Core.Context('Wf_Queue', 'WriteMsg');

1465:
1466:
1467: exception
1468: when others then
1469: Wf_Core.Context('Wf_Queue', 'WriteMsg');
1470: raise;
1471:
1472: end WriteMsg;
1473:

Line 1485: i := wf_queue.SearchMsgStack(itemtype,itemkey,actid);

1481: is
1482: i pls_integer;
1483: begin
1484:
1485: i := wf_queue.SearchMsgStack(itemtype,itemkey,actid);
1486:
1487: exception
1488: when others then
1489: Wf_Core.Context('Wf_Queue', 'CreateMsg');

Line 1489: Wf_Core.Context('Wf_Queue', 'CreateMsg');

1485: i := wf_queue.SearchMsgStack(itemtype,itemkey,actid);
1486:
1487: exception
1488: when others then
1489: Wf_Core.Context('Wf_Queue', 'CreateMsg');
1490: raise;
1491:
1492: end CreateMsg;
1493:

Line 1510: if wf_queue.stck_attrlist(i) is null then

1506: i pls_integer;
1507: begin
1508: i := SearchMsgStack (itemtype, itemkey, actid);
1509:
1510: if wf_queue.stck_attrlist(i) is null then
1511: wf_queue.stck_attrlist(i) := upper(attrName)||'='||AttrValue;
1512: else
1513: wf_queue.stck_attrlist(i) :=
1514: wf_queue.stck_attrlist(i) ||'^'||attrName||'='||AttrValue;

Line 1511: wf_queue.stck_attrlist(i) := upper(attrName)||'='||AttrValue;

1507: begin
1508: i := SearchMsgStack (itemtype, itemkey, actid);
1509:
1510: if wf_queue.stck_attrlist(i) is null then
1511: wf_queue.stck_attrlist(i) := upper(attrName)||'='||AttrValue;
1512: else
1513: wf_queue.stck_attrlist(i) :=
1514: wf_queue.stck_attrlist(i) ||'^'||attrName||'='||AttrValue;
1515: end if;

Line 1513: wf_queue.stck_attrlist(i) :=

1509:
1510: if wf_queue.stck_attrlist(i) is null then
1511: wf_queue.stck_attrlist(i) := upper(attrName)||'='||AttrValue;
1512: else
1513: wf_queue.stck_attrlist(i) :=
1514: wf_queue.stck_attrlist(i) ||'^'||attrName||'='||AttrValue;
1515: end if;
1516:
1517: exception

Line 1514: wf_queue.stck_attrlist(i) ||'^'||attrName||'='||AttrValue;

1510: if wf_queue.stck_attrlist(i) is null then
1511: wf_queue.stck_attrlist(i) := upper(attrName)||'='||AttrValue;
1512: else
1513: wf_queue.stck_attrlist(i) :=
1514: wf_queue.stck_attrlist(i) ||'^'||attrName||'='||AttrValue;
1515: end if;
1516:
1517: exception
1518: when others then

Line 1519: Wf_Core.Context('Wf_Queue', 'SetMsgAttr',

1515: end if;
1516:
1517: exception
1518: when others then
1519: Wf_Core.Context('Wf_Queue', 'SetMsgAttr',
1520: itemtype, itemkey, actid, to_char(stck_ctr));
1521: raise;
1522: end SetMsgAttr;
1523:

Line 1537: wf_queue.stck_result(i) :=result;

1533: i pls_integer;
1534: begin
1535: i := SearchMsgStack (itemtype, itemkey, actid);
1536:
1537: wf_queue.stck_result(i) :=result;
1538:
1539: exception
1540: when others then
1541: Wf_Core.Context('Wf_Queue', 'AddResult',

Line 1541: Wf_Core.Context('Wf_Queue', 'AddResult',

1537: wf_queue.stck_result(i) :=result;
1538:
1539: exception
1540: when others then
1541: Wf_Core.Context('Wf_Queue', 'AddResult',
1542: itemtype, itemkey, actid, to_char(stck_ctr));
1543: raise;
1544: end SetMsgResult;
1545:

Line 1562: wf_queue.stck_ctr := wf_queue.stck_ctr + 1;

1558: is
1559: begin
1560:
1561: -- Add the process to the stack
1562: wf_queue.stck_ctr := wf_queue.stck_ctr + 1;
1563: wf_queue.stck_itemtype(wf_queue.stck_ctr) := itemtype;
1564: wf_queue.stck_itemkey(wf_queue.stck_ctr) := itemkey;
1565: wf_queue.stck_actid(wf_queue.stck_ctr) := actid;
1566: wf_queue.stck_result(wf_queue.stck_ctr) := null;

Line 1563: wf_queue.stck_itemtype(wf_queue.stck_ctr) := itemtype;

1559: begin
1560:
1561: -- Add the process to the stack
1562: wf_queue.stck_ctr := wf_queue.stck_ctr + 1;
1563: wf_queue.stck_itemtype(wf_queue.stck_ctr) := itemtype;
1564: wf_queue.stck_itemkey(wf_queue.stck_ctr) := itemkey;
1565: wf_queue.stck_actid(wf_queue.stck_ctr) := actid;
1566: wf_queue.stck_result(wf_queue.stck_ctr) := null;
1567: wf_queue.stck_AttrList(wf_queue.stck_ctr) := null;

Line 1564: wf_queue.stck_itemkey(wf_queue.stck_ctr) := itemkey;

1560:
1561: -- Add the process to the stack
1562: wf_queue.stck_ctr := wf_queue.stck_ctr + 1;
1563: wf_queue.stck_itemtype(wf_queue.stck_ctr) := itemtype;
1564: wf_queue.stck_itemkey(wf_queue.stck_ctr) := itemkey;
1565: wf_queue.stck_actid(wf_queue.stck_ctr) := actid;
1566: wf_queue.stck_result(wf_queue.stck_ctr) := null;
1567: wf_queue.stck_AttrList(wf_queue.stck_ctr) := null;
1568:

Line 1565: wf_queue.stck_actid(wf_queue.stck_ctr) := actid;

1561: -- Add the process to the stack
1562: wf_queue.stck_ctr := wf_queue.stck_ctr + 1;
1563: wf_queue.stck_itemtype(wf_queue.stck_ctr) := itemtype;
1564: wf_queue.stck_itemkey(wf_queue.stck_ctr) := itemkey;
1565: wf_queue.stck_actid(wf_queue.stck_ctr) := actid;
1566: wf_queue.stck_result(wf_queue.stck_ctr) := null;
1567: wf_queue.stck_AttrList(wf_queue.stck_ctr) := null;
1568:
1569: exception

Line 1566: wf_queue.stck_result(wf_queue.stck_ctr) := null;

1562: wf_queue.stck_ctr := wf_queue.stck_ctr + 1;
1563: wf_queue.stck_itemtype(wf_queue.stck_ctr) := itemtype;
1564: wf_queue.stck_itemkey(wf_queue.stck_ctr) := itemkey;
1565: wf_queue.stck_actid(wf_queue.stck_ctr) := actid;
1566: wf_queue.stck_result(wf_queue.stck_ctr) := null;
1567: wf_queue.stck_AttrList(wf_queue.stck_ctr) := null;
1568:
1569: exception
1570: when others then

Line 1567: wf_queue.stck_AttrList(wf_queue.stck_ctr) := null;

1563: wf_queue.stck_itemtype(wf_queue.stck_ctr) := itemtype;
1564: wf_queue.stck_itemkey(wf_queue.stck_ctr) := itemkey;
1565: wf_queue.stck_actid(wf_queue.stck_ctr) := actid;
1566: wf_queue.stck_result(wf_queue.stck_ctr) := null;
1567: wf_queue.stck_AttrList(wf_queue.stck_ctr) := null;
1568:
1569: exception
1570: when others then
1571: Wf_Core.Context('Wf_Queue', 'AddNewMsg',

Line 1571: Wf_Core.Context('Wf_Queue', 'AddNewMsg',

1567: wf_queue.stck_AttrList(wf_queue.stck_ctr) := null;
1568:
1569: exception
1570: when others then
1571: Wf_Core.Context('Wf_Queue', 'AddNewMsg',
1572: itemtype, itemkey, actid, to_char(stck_ctr));
1573: raise;
1574: end AddNewMsg;
1575:

Line 1590: if ( nvl(wf_queue.stck_ctr, 0) > 0) then

1586: i pls_integer;
1587:
1588: begin
1589:
1590: if ( nvl(wf_queue.stck_ctr, 0) > 0) then
1591: for i in reverse 1 .. wf_queue.stck_ctr loop
1592: if ((itemtype = wf_queue.stck_itemtype(i)) and
1593: (itemkey = wf_queue.stck_itemkey(i)) and
1594: (actid = wf_queue.stck_actid(i))) then

Line 1591: for i in reverse 1 .. wf_queue.stck_ctr loop

1587:
1588: begin
1589:
1590: if ( nvl(wf_queue.stck_ctr, 0) > 0) then
1591: for i in reverse 1 .. wf_queue.stck_ctr loop
1592: if ((itemtype = wf_queue.stck_itemtype(i)) and
1593: (itemkey = wf_queue.stck_itemkey(i)) and
1594: (actid = wf_queue.stck_actid(i))) then
1595: -- Found a match.

Line 1592: if ((itemtype = wf_queue.stck_itemtype(i)) and

1588: begin
1589:
1590: if ( nvl(wf_queue.stck_ctr, 0) > 0) then
1591: for i in reverse 1 .. wf_queue.stck_ctr loop
1592: if ((itemtype = wf_queue.stck_itemtype(i)) and
1593: (itemkey = wf_queue.stck_itemkey(i)) and
1594: (actid = wf_queue.stck_actid(i))) then
1595: -- Found a match.
1596: return(i);

Line 1593: (itemkey = wf_queue.stck_itemkey(i)) and

1589:
1590: if ( nvl(wf_queue.stck_ctr, 0) > 0) then
1591: for i in reverse 1 .. wf_queue.stck_ctr loop
1592: if ((itemtype = wf_queue.stck_itemtype(i)) and
1593: (itemkey = wf_queue.stck_itemkey(i)) and
1594: (actid = wf_queue.stck_actid(i))) then
1595: -- Found a match.
1596: return(i);
1597: end if;

Line 1594: (actid = wf_queue.stck_actid(i))) then

1590: if ( nvl(wf_queue.stck_ctr, 0) > 0) then
1591: for i in reverse 1 .. wf_queue.stck_ctr loop
1592: if ((itemtype = wf_queue.stck_itemtype(i)) and
1593: (itemkey = wf_queue.stck_itemkey(i)) and
1594: (actid = wf_queue.stck_actid(i))) then
1595: -- Found a match.
1596: return(i);
1597: end if;
1598: end loop;

Line 1636: from wf_queues wfq

1632: select wfq.protocol,
1633: wfq.inbound_outbound,
1634: wfq.description,
1635: wfq.queue_count
1636: from wf_queues wfq
1637: where NVL(wfq.disable_flag, 'N') = 'N'
1638: order by wfq.protocol, wfq.inbound_outbound;
1639:
1640: rowcount number;

Line 1718: '/wf_queue.generic_queue_edit?p_protocol='||

1714:
1715:
1716: htp.tableData(htf.anchor2(
1717: curl=>wfa_html.base_url||
1718: '/wf_queue.generic_queue_edit?p_protocol='||
1719: queues.protocol||'&p_inbound_outbound='||
1720: queues.inbound_outbound,
1721: ctext=>queues.protocol, ctarget=>'_top'),
1722: 'Left',

Line 1736: '/wf_queue.Generic_Queue_View_Detail?p_protocol='||

1732: htp.tableData(queues.queue_count, 'left',
1733: cattributes=>'headers="' || wf_core.translate('QUEUE_COUNT') || '"');
1734:
1735: htp.tableData(htf.anchor2(curl=>wfa_html.base_url||
1736: '/wf_queue.Generic_Queue_View_Detail?p_protocol='||
1737: queues.protocol||'&p_inbound_outbound='||
1738: queues.inbound_outbound,
1739: ctext=>''||wf_core.translate('FIND') || ''),
1740: 'center', cattributes=>'valign="MIDDLE"

Line 1744: '/wf_queue.generic_queue_confirm_delete?p_protocol='||

1740: 'center', cattributes=>'valign="MIDDLE"
1741: headers="' || wf_core.translate('VIEW_DETAIL') || '"');
1742:
1743: htp.tableData(htf.anchor2(curl=>wfa_html.base_url||
1744: '/wf_queue.generic_queue_confirm_delete?p_protocol='||
1745: queues.protocol||'&p_inbound_outbound='||
1746: queues.inbound_outbound,
1747: ctext=>'' || wf_core.translate('WFRTG_DELETE') || ''),
1748: 'center', cattributes=>'valign="MIDDLE"

Line 1763: l_url := wfa_html.base_url||'/wf_queue.generic_queue_edit';

1759:
1760: --Add new node Button
1761: htp.tableRowOpen;
1762:
1763: l_url := wfa_html.base_url||'/wf_queue.generic_queue_edit';
1764: l_icon := 'FNDJLFOK.gif';
1765: l_text := wf_core.translate ('WFQUEUE_CREATE');
1766: l_onmouseover := wf_core.translate ('WFQUEUE_CREATE');
1767:

Line 1849: FROM wf_queues

1845: END IF;
1846:
1847: SELECT queue_count
1848: INTO l_count
1849: FROM wf_queues
1850: WHERE UPPER(p_protocol) = protocol
1851: AND p_inbound_outbound = inbound_outbound;
1852:
1853: -- Column headers

Line 1914: '/wf_queue.generic_queue_display_contents?p_protocol='||

1910: htp.tableData(to_char(l_count), 'left', cattributes=>'headers="' ||
1911: wf_core.translate('QUEUE_COUNT') || '"');
1912:
1913: htp.tableData(htf.anchor2(curl=>wfa_html.base_url||
1914: '/wf_queue.generic_queue_display_contents?p_protocol='||
1915: p_protocol||'&p_inbound_outbound='||
1916: p_inbound_outbound||'&p_queue_number='||
1917: to_char(ii)||'&p_message_number=1',
1918: ctext=>'' || wf_core.translate('FIND') || ''),

Line 2006: htp.p('
');

2002: END IF;
2003:
2004: htp.tableopen(calign=>'CENTER',cattributes=>'summary=""');
2005:
2006: htp.p('');
2007:
2008: /*
2009: ** Create a page with a form field with the message payload
2010: */

Line 2094: '/wf_queue.generic_queue_display_contents'||

2090:
2091: htp.tableRowOpen;
2092:
2093: l_url := wfa_html.base_url||
2094: '/wf_queue.generic_queue_display_contents'||
2095: '?p_protocol='||p_protocol||
2096: '&p_inbound_outbound='||p_inbound_outbound||
2097: '&p_queue_number='||to_char(p_queue_number)||
2098: '&p_message_number='||to_char(p_message_number + 1);

Line 2113: '/wf_queue.generic_queue_display_contents'||

2109:
2110: if (p_message_number > 1) then
2111:
2112: l_url := wfa_html.base_url||
2113: '/wf_queue.generic_queue_display_contents'||
2114: '?p_protocol='||p_protocol||
2115: '&p_inbound_outbound='||p_inbound_outbound||
2116: '&p_queue_number='||to_char(p_queue_number)||
2117: '&p_message_number='||to_char(p_message_number - 1);

Line 2141: Wf_Core.Context('Wf_Queue', 'generic_queue_display_contents',

2137: htp.htmlClose;
2138:
2139: exception
2140: when others then
2141: Wf_Core.Context('Wf_Queue', 'generic_queue_display_contents',
2142: p_protocol, p_inbound_outbound);
2143: raise;
2144:
2145: end generic_queue_display_contents;

Line 2196: FROM wf_queues

2192: SELECT description,
2193: queue_count
2194: INTO l_description,
2195: l_queue_count
2196: FROM wf_queues
2197: WHERE protocol = p_protocol
2198: AND inbound_outbound = p_inbound_outbound;
2199:
2200: END IF;

Line 2224: htp.p('');

2220: END IF;
2221:
2222: htp.tableopen(calign=>'CENTER',cattributes=>'summary="' || wf_core.translate('WFQUEUE_EDIT_QUEUE_TITLE') || '"');
2223:
2224: htp.p('');
2225:
2226: -- Protocol Name
2227: htp.tableRowOpen;
2228: htp.tableData(cvalue=>'

Line 2402: Wf_Core.Context('Wf_Queue', 'generic_queue_delete_check',

2398: end loop;
2399:
2400: exception
2401: when others then
2402: Wf_Core.Context('Wf_Queue', 'generic_queue_delete_check',
2403: p_protocol, p_inbound_outbound);
2404: raise;
2405:
2406: end generic_queue_delete_check;

Line 2447: Wf_Core.Context('Wf_Queue', 'generic_queue_delete_queues',

2443: end loop;
2444:
2445: exception
2446: when others then
2447: Wf_Core.Context('Wf_Queue', 'generic_queue_delete_queues',
2448: p_protocol, p_inbound_outbound);
2449: raise;
2450:
2451: end generic_queue_delete_queues;

Line 2507: FROM wf_queues

2503: IF (p_original_protocol IS NULL) THEN
2504:
2505: SELECT count(1)
2506: INTO l_count
2507: FROM wf_queues
2508: WHERE UPPER(p_protocol) = protocol
2509: AND p_inbound_outbound = inbound_outbound;
2510:
2511: if (l_count > 0) then

Line 2524: '/wf_queue.generic_queue_edit';

2520:
2521: htp.tableRowOpen;
2522:
2523: l_url := wfa_html.base_url||
2524: '/wf_queue.generic_queue_edit';
2525: l_icon := 'FNDJLFOK.gif';
2526: l_text := wf_core.translate ('WFMON_OK');
2527: l_onmouseover := wf_core.translate ('WFMON_OK');
2528:

Line 2541: wf_queue.create_generic_queue (p_protocol=>p_protocol,

2537: return;
2538:
2539: else
2540:
2541: wf_queue.create_generic_queue (p_protocol=>p_protocol,
2542: p_inbound_outbound => p_inbound_outbound,
2543: p_description => p_description,
2544: p_queue_count => to_number(p_queue_count));
2545:

Line 2552: wf_queue.update_generic_queue (p_protocol=>p_protocol,

2548: else
2549: null;
2550:
2551: /*
2552: wf_queue.update_generic_queue (p_protocol=>p_protocol,
2553: p_inbound_outbound => p_inbound_outbound,
2554: p_description => p_description,
2555: p_queue_count => to_number(p_queue_count),
2556: p_original_protocol=> p_original_protocol,

Line 2565: '/wf_queue.Generic_Queue_Display',

2561:
2562:
2563: -- use owa_util.redirect_url to redirect the URL to the home page
2564: owa_util.redirect_url(curl=>wfa_html.base_url ||
2565: '/wf_queue.Generic_Queue_Display',
2566: bclose_header=>TRUE);
2567:
2568:
2569: exception

Line 2596: from wf_queues wfq

2592: ** Check to see if the queue name already exists
2593: */
2594: select count(1)
2595: into l_count
2596: from wf_queues wfq
2597: where wfq.protocol = p_protocol
2598: and wfq.inbound_outbound = p_inbound_outbound;
2599:
2600: /*

Line 2646: ** Create an entry in WF_QUEUES table

2642:
2643: end loop;
2644:
2645: /*
2646: ** Create an entry in WF_QUEUES table
2647: */
2648: insert into wf_queues
2649: (protocol,
2650: inbound_outbound,

Line 2648: insert into wf_queues

2644:
2645: /*
2646: ** Create an entry in WF_QUEUES table
2647: */
2648: insert into wf_queues
2649: (protocol,
2650: inbound_outbound,
2651: description,
2652: queue_count,

Line 2663: Wf_Core.Context('Wf_Queue', 'create_generic_queue', p_protocol,

2659: 'N');
2660:
2661: exception
2662: when others then
2663: Wf_Core.Context('Wf_Queue', 'create_generic_queue', p_protocol,
2664: p_inbound_outbound);
2665: raise;
2666:
2667: end create_generic_queue;

Line 2688: from wf_queues wfq

2684: begin
2685:
2686: select queue_count
2687: into l_queue_count
2688: from wf_queues wfq
2689: where wfq.protocol = p_protocol
2690: and wfq.inbound_outbound = p_inbound_outbound;
2691:
2692: exception

Line 2704: wf_queue.generic_queue_delete_check (p_protocol, p_inbound_outbound,

2700:
2701: /*
2702: ** Make sure the queues are empty
2703: */
2704: wf_queue.generic_queue_delete_check (p_protocol, p_inbound_outbound,
2705: 1, l_queue_count);
2706:
2707: /*
2708: ** Delete the queues and queue tables

Line 2710: wf_queue.generic_queue_delete_queues(p_protocol, p_inbound_outbound,

2706:
2707: /*
2708: ** Delete the queues and queue tables
2709: */
2710: wf_queue.generic_queue_delete_queues(p_protocol, p_inbound_outbound,
2711: 1, l_queue_count);
2712:
2713: /*
2714: ** delete an entry in WF_QUEUES table

Line 2714: ** delete an entry in WF_QUEUES table

2710: wf_queue.generic_queue_delete_queues(p_protocol, p_inbound_outbound,
2711: 1, l_queue_count);
2712:
2713: /*
2714: ** delete an entry in WF_QUEUES table
2715: */
2716: delete from wf_queues
2717: where protocol = p_protocol
2718: and inbound_outbound = p_inbound_outbound;

Line 2716: delete from wf_queues

2712:
2713: /*
2714: ** delete an entry in WF_QUEUES table
2715: */
2716: delete from wf_queues
2717: where protocol = p_protocol
2718: and inbound_outbound = p_inbound_outbound;
2719:
2720: exception

Line 2722: Wf_Core.Context('Wf_Queue', 'delele_generic_queue', p_protocol,

2718: and inbound_outbound = p_inbound_outbound;
2719:
2720: exception
2721: when others then
2722: Wf_Core.Context('Wf_Queue', 'delele_generic_queue', p_protocol,
2723: p_inbound_outbound);
2724: raise;
2725:
2726: end delete_generic_queue;

Line 2746: from wf_queues

2742: l_queue_name varchar2(30) := null;
2743:
2744: cursor get_queues is
2745: select protocol, inbound_outbound, queue_count
2746: from wf_queues
2747: order by protocol, inbound_outbound;
2748:
2749: begin
2750:

Line 2755: if (wf_queue.queue_names_index.count < 1) then

2751: /*
2752: ** Check to see if queues loaded into memory. If they are not
2753: ** already loaded
2754: */
2755: if (wf_queue.queue_names_index.count < 1) then
2756:
2757: -- Show all nodes
2758: for wf_queues_list in get_queues loop
2759:

Line 2758: for wf_queues_list in get_queues loop

2754: */
2755: if (wf_queue.queue_names_index.count < 1) then
2756:
2757: -- Show all nodes
2758: for wf_queues_list in get_queues loop
2759:
2760: wf_queue.queue_names_index(ii).protocol := wf_queues_list.protocol;
2761: wf_queue.queue_names_index(ii).inbound_outbound := wf_queues_list.inbound_outbound;
2762: wf_queue.queue_names_index(ii).queue_count := wf_queues_list.queue_count;

Line 2760: wf_queue.queue_names_index(ii).protocol := wf_queues_list.protocol;

2756:
2757: -- Show all nodes
2758: for wf_queues_list in get_queues loop
2759:
2760: wf_queue.queue_names_index(ii).protocol := wf_queues_list.protocol;
2761: wf_queue.queue_names_index(ii).inbound_outbound := wf_queues_list.inbound_outbound;
2762: wf_queue.queue_names_index(ii).queue_count := wf_queues_list.queue_count;
2763:
2764: ii := ii + 1;

Line 2761: wf_queue.queue_names_index(ii).inbound_outbound := wf_queues_list.inbound_outbound;

2757: -- Show all nodes
2758: for wf_queues_list in get_queues loop
2759:
2760: wf_queue.queue_names_index(ii).protocol := wf_queues_list.protocol;
2761: wf_queue.queue_names_index(ii).inbound_outbound := wf_queues_list.inbound_outbound;
2762: wf_queue.queue_names_index(ii).queue_count := wf_queues_list.queue_count;
2763:
2764: ii := ii + 1;
2765:

Line 2762: wf_queue.queue_names_index(ii).queue_count := wf_queues_list.queue_count;

2758: for wf_queues_list in get_queues loop
2759:
2760: wf_queue.queue_names_index(ii).protocol := wf_queues_list.protocol;
2761: wf_queue.queue_names_index(ii).inbound_outbound := wf_queues_list.inbound_outbound;
2762: wf_queue.queue_names_index(ii).queue_count := wf_queues_list.queue_count;
2763:
2764: ii := ii + 1;
2765:
2766: end loop;

Line 2771: for ii in 1..wf_queue.queue_names_index.count loop

2767:
2768: end if;
2769:
2770: -- Go find the locator in the queue list that matches the request
2771: for ii in 1..wf_queue.queue_names_index.count loop
2772:
2773: if (wf_queue.queue_names_index(ii).protocol = p_protocol AND
2774: wf_queue.queue_names_index(ii).inbound_outbound = p_inbound_outbound) THEN
2775:

Line 2773: if (wf_queue.queue_names_index(ii).protocol = p_protocol AND

2769:
2770: -- Go find the locator in the queue list that matches the request
2771: for ii in 1..wf_queue.queue_names_index.count loop
2772:
2773: if (wf_queue.queue_names_index(ii).protocol = p_protocol AND
2774: wf_queue.queue_names_index(ii).inbound_outbound = p_inbound_outbound) THEN
2775:
2776: -- If there is more than 1 queue then choose the queue based on a random
2777: -- number generator

Line 2774: wf_queue.queue_names_index(ii).inbound_outbound = p_inbound_outbound) THEN

2770: -- Go find the locator in the queue list that matches the request
2771: for ii in 1..wf_queue.queue_names_index.count loop
2772:
2773: if (wf_queue.queue_names_index(ii).protocol = p_protocol AND
2774: wf_queue.queue_names_index(ii).inbound_outbound = p_inbound_outbound) THEN
2775:
2776: -- If there is more than 1 queue then choose the queue based on a random
2777: -- number generator
2778: if (wf_queue.queue_names_index(ii).queue_count > 1) then

Line 2778: if (wf_queue.queue_names_index(ii).queue_count > 1) then

2774: wf_queue.queue_names_index(ii).inbound_outbound = p_inbound_outbound) THEN
2775:
2776: -- If there is more than 1 queue then choose the queue based on a random
2777: -- number generator
2778: if (wf_queue.queue_names_index(ii).queue_count > 1) then
2779:
2780: l_index := mod(to_number(wf_core.random), wf_queue.queue_names_index(ii).queue_count) + 1;
2781:
2782: else

Line 2780: l_index := mod(to_number(wf_core.random), wf_queue.queue_names_index(ii).queue_count) + 1;

2776: -- If there is more than 1 queue then choose the queue based on a random
2777: -- number generator
2778: if (wf_queue.queue_names_index(ii).queue_count > 1) then
2779:
2780: l_index := mod(to_number(wf_core.random), wf_queue.queue_names_index(ii).queue_count) + 1;
2781:
2782: else
2783:
2784: l_index := 1;

Line 2801: Wf_Core.Context('Wf_Queue', 'get_hash_generic_queue',

2797: end if;
2798:
2799: exception
2800: when others then
2801: Wf_Core.Context('Wf_Queue', 'get_hash_generic_queue',
2802: p_protocol, p_inbound_outbound);
2803: raise;
2804:
2805: end get_hash_queue_name;

Line 2857: WF_CORE.Context('WF_QUEUE','Enable_Exception_Queue',p_queue_name);

2853: return l_exception_queue;
2854:
2855: exception
2856: when others then
2857: WF_CORE.Context('WF_QUEUE','Enable_Exception_Queue',p_queue_name);
2858: raise;
2859:
2860: end enable_Exception_Queue;
2861:

Line 2880: Wf_Core.Context('WF_QUEUE','AddSubscriber',queuename, name);

2876: );
2877:
2878: exception
2879: when OTHERS then
2880: Wf_Core.Context('WF_QUEUE','AddSubscriber',queuename, name);
2881: raise;
2882: end AddSubscriber;
2883:
2884: -- Bug 2307428

Line 2901: if (wf_queue.name_init = FALSE) then

2897: AND ((trim(enqueue_enabled) = 'NO') OR (trim(dequeue_enabled) = 'NO'));
2898:
2899: begin
2900: --If the queue names haven't been set,initialise them
2901: if (wf_queue.name_init = FALSE) then
2902: wf_queue.set_queue_names;
2903: end if;
2904:
2905: --Obtain the schema

Line 2902: wf_queue.set_queue_names;

2898:
2899: begin
2900: --If the queue names haven't been set,initialise them
2901: if (wf_queue.name_init = FALSE) then
2902: wf_queue.set_queue_names;
2903: end if;
2904:
2905: --Obtain the schema
2906: schema := wf_core.translate('WF_SCHEMA');

Line 2909: queue_name := substr(wf_queue.deferred_queue_name,length(schema)+2);

2905: --Obtain the schema
2906: schema := wf_core.translate('WF_SCHEMA');
2907:
2908: --Enable deferred queue
2909: queue_name := substr(wf_queue.deferred_queue_name,length(schema)+2);
2910: OPEN q_disabled (schema, queue_name);
2911: LOOP
2912: FETCH q_disabled into l_qname;
2913: EXIT WHEN q_disabled%NOTFOUND;

Line 2914: DBMS_AQADM.START_QUEUE(wf_queue.deferred_queue_name);

2910: OPEN q_disabled (schema, queue_name);
2911: LOOP
2912: FETCH q_disabled into l_qname;
2913: EXIT WHEN q_disabled%NOTFOUND;
2914: DBMS_AQADM.START_QUEUE(wf_queue.deferred_queue_name);
2915: END LOOP;
2916: CLOSE q_disabled;
2917:
2918: --Enable inbound queue

Line 2919: queue_name := substr(wf_queue.inbound_queue_name,length(schema)+2);

2915: END LOOP;
2916: CLOSE q_disabled;
2917:
2918: --Enable inbound queue
2919: queue_name := substr(wf_queue.inbound_queue_name,length(schema)+2);
2920: OPEN q_disabled (schema, queue_name);
2921: LOOP
2922: FETCH q_disabled into l_qname;
2923: EXIT WHEN q_disabled%NOTFOUND;

Line 2924: DBMS_AQADM.START_QUEUE(wf_queue.inbound_queue_name);

2920: OPEN q_disabled (schema, queue_name);
2921: LOOP
2922: FETCH q_disabled into l_qname;
2923: EXIT WHEN q_disabled%NOTFOUND;
2924: DBMS_AQADM.START_QUEUE(wf_queue.inbound_queue_name);
2925: END LOOP;
2926: CLOSE q_disabled;
2927: exception
2928: when others then

Line 2929: Wf_core.Context('WF_QUEUE','EnableBackgroundQueues');

2925: END LOOP;
2926: CLOSE q_disabled;
2927: exception
2928: when others then
2929: Wf_core.Context('WF_QUEUE','EnableBackgroundQueues');
2930: raise;
2931: end EnableBackgroundQueues;
2932: -- ====================================================================
2933: -- get Count Message States (PUBLIC)

Line 3082: Wf_Core.Context('WF_QUEUE','getCntMsgSt',p_agent);

3078: then
3079: close l_cntmsgst;
3080: end if;
3081:
3082: Wf_Core.Context('WF_QUEUE','getCntMsgSt',p_agent);
3083: raise;
3084: end getCntMsgSt;
3085:
3086: --

Line 3422: Wf_core.Context('WF_QUEUE', 'Clean_evt', p_agent_name,

3418: p_msg_count := p_msg_count + l_xcount;
3419:
3420: exception
3421: when others then
3422: Wf_core.Context('WF_QUEUE', 'Clean_evt', p_agent_name,
3423: p_correlation, to_char(p_commit_frequency));
3424: raise;
3425: end clean_evt;
3426:

Line 3629: Wf_core.Context('WF_QUEUE', 'Clean_evt', p_agent_name, p_correlation,

3625: p_msg_count := p_msg_count + l_xcount;
3626:
3627: exception
3628: when others then
3629: Wf_core.Context('WF_QUEUE', 'Clean_evt', p_agent_name, p_correlation,
3630: to_char(p_commit_frequency), to_char(p_age));
3631: raise;
3632: end clean_evt;
3633: --------------------------------------------------------------------------------

Line 3638: wf_queue.g_defer_occurrence := 100;

3634: /*
3635: ** Bug 4005674 - Populate Continuous Loop Global Variables
3636: */
3637: begin
3638: wf_queue.g_defer_occurrence := 100;
3639: wf_queue.g_add_delay_seconds := 300;
3640: wf_queue.g_max_delay_seconds := 3600;
3641: --------------------------------------------------------------------------------
3642: end WF_QUEUE;

Line 3639: wf_queue.g_add_delay_seconds := 300;

3635: ** Bug 4005674 - Populate Continuous Loop Global Variables
3636: */
3637: begin
3638: wf_queue.g_defer_occurrence := 100;
3639: wf_queue.g_add_delay_seconds := 300;
3640: wf_queue.g_max_delay_seconds := 3600;
3641: --------------------------------------------------------------------------------
3642: end WF_QUEUE;

Line 3640: wf_queue.g_max_delay_seconds := 3600;

3636: */
3637: begin
3638: wf_queue.g_defer_occurrence := 100;
3639: wf_queue.g_add_delay_seconds := 300;
3640: wf_queue.g_max_delay_seconds := 3600;
3641: --------------------------------------------------------------------------------
3642: end WF_QUEUE;

Line 3642: end WF_QUEUE;

3638: wf_queue.g_defer_occurrence := 100;
3639: wf_queue.g_add_delay_seconds := 300;
3640: wf_queue.g_max_delay_seconds := 3600;
3641: --------------------------------------------------------------------------------
3642: end WF_QUEUE;