42:
43: pragma AUTONOMOUS_TRANSACTION;
44:
45: Begin
46: DBMS_AQADM.ADD_SUBSCRIBER(queue_name =>Q_Schema || '.' || QUEUE_NAME,
47: subscriber => sys.aq$_agent(OPPPREFIX || subscriber, NULL, NULL));
48:
49:
50: commit;
71:
72: pragma AUTONOMOUS_TRANSACTION;
73:
74: Begin
75: DBMS_AQADM.ADD_SUBSCRIBER(queue_name =>Q_Schema || '.' || QUEUE_NAME,
76: subscriber => sys.aq$_agent(OPPPREFIX || subscriber, NULL, NULL),
77: rule => 'tab.user_data.message_group = ''' || groupid || '''');
78:
79:
95:
96: pragma AUTONOMOUS_TRANSACTION;
97:
98: Begin
99: DBMS_AQADM.REMOVE_SUBSCRIBER(queue_name =>Q_Schema || '.' || QUEUE_NAME,
100: subscriber => sys.aq$_agent(OPPPREFIX || subscriber, NULL, NULL));
101:
102:
103: commit;
188: loop
189: fetch c1 into subname;
190: exit when c1%NOTFOUND;
191:
192: DBMS_AQADM.REMOVE_SUBSCRIBER(queue_name => Q_Schema || '.' || QUEUE_NAME,
193: subscriber => sys.aq$_agent(subname, NULL, NULL));
194: end loop;
195: close c1;
196:
246: message in Varchar2,
247: Parameters in Varchar2,
248: correlation in Varchar2 default null) is
249:
250: enq_opts DBMS_AQ.enqueue_options_t;
251: msg_props DBMS_AQ.message_properties_t;
252: msg_id raw(16);
253: msg system.FND_CP_GSM_OPP_AQ_PAYLOAD;
254:
247: Parameters in Varchar2,
248: correlation in Varchar2 default null) is
249:
250: enq_opts DBMS_AQ.enqueue_options_t;
251: msg_props DBMS_AQ.message_properties_t;
252: msg_id raw(16);
253: msg system.FND_CP_GSM_OPP_AQ_PAYLOAD;
254:
255:
257:
258: begin
259: msg := system.FND_CP_GSM_OPP_AQ_PAYLOAD(groupid, type, message, Parameters);
260:
261: enq_opts.visibility := DBMS_AQ.ON_COMMIT;
262: enq_opts.sequence_deviation := NULL;
263: msg_props.delay := DBMS_AQ.NO_DELAY;
264: msg_props.expiration := 365 * 24 * 3600; -- One Year
265:
259: msg := system.FND_CP_GSM_OPP_AQ_PAYLOAD(groupid, type, message, Parameters);
260:
261: enq_opts.visibility := DBMS_AQ.ON_COMMIT;
262: enq_opts.sequence_deviation := NULL;
263: msg_props.delay := DBMS_AQ.NO_DELAY;
264: msg_props.expiration := 365 * 24 * 3600; -- One Year
265:
266: msg_props.sender_id := sys.aq$_agent(OPPPREFIX || sender, NULL, NULL);
267:
275: msg_props.recipient_list(i) := sys.aq$_agent(OPPPREFIX || recipients(i), NULL, NULL);
276: end loop;
277: end if;
278:
279: DBMS_AQ.Enqueue( queue_name => Q_Schema || '.' || QUEUE_NAME,
280: enqueue_options => enq_opts,
281: message_properties => msg_props,
282: Payload => msg,
283: msgid => msg_id);
448: Correlation IN Varchar2 default null) is
449:
450:
451: payload system.FND_CP_GSM_OPP_AQ_PAYLOAD;
452: dq_opts DBMS_AQ.DEQUEUE_OPTIONS_T;
453: msg_props DBMS_AQ.MESSAGE_PROPERTIES_T;
454: msgid raw(16);
455: queue_timeout exception;
456: time_left number;
449:
450:
451: payload system.FND_CP_GSM_OPP_AQ_PAYLOAD;
452: dq_opts DBMS_AQ.DEQUEUE_OPTIONS_T;
453: msg_props DBMS_AQ.MESSAGE_PROPERTIES_T;
454: msgid raw(16);
455: queue_timeout exception;
456: time_left number;
457: end_time date;
462:
463: Begin
464: payload := system.FND_CP_GSM_OPP_AQ_PAYLOAD(NULL,NULL,NULL,NULL);
465:
466: dq_opts.DEQUEUE_MODE := DBMS_AQ.REMOVE;
467: dq_opts.NAVIGATION := DBMS_AQ.FIRST_MESSAGE;
468: dq_opts.VISIBILITY := DBMS_AQ.IMMEDIATE;
469: dq_opts.MSGID := NULL;
470: dq_opts.consumer_name := OPPPREFIX || Handle;
463: Begin
464: payload := system.FND_CP_GSM_OPP_AQ_PAYLOAD(NULL,NULL,NULL,NULL);
465:
466: dq_opts.DEQUEUE_MODE := DBMS_AQ.REMOVE;
467: dq_opts.NAVIGATION := DBMS_AQ.FIRST_MESSAGE;
468: dq_opts.VISIBILITY := DBMS_AQ.IMMEDIATE;
469: dq_opts.MSGID := NULL;
470: dq_opts.consumer_name := OPPPREFIX || Handle;
471:
464: payload := system.FND_CP_GSM_OPP_AQ_PAYLOAD(NULL,NULL,NULL,NULL);
465:
466: dq_opts.DEQUEUE_MODE := DBMS_AQ.REMOVE;
467: dq_opts.NAVIGATION := DBMS_AQ.FIRST_MESSAGE;
468: dq_opts.VISIBILITY := DBMS_AQ.IMMEDIATE;
469: dq_opts.MSGID := NULL;
470: dq_opts.consumer_name := OPPPREFIX || Handle;
471:
472: if correlation is not null then
487: end if;
488:
489: begin
490:
491: DBMS_AQ.DEQUEUE(QUEUE_NAME => Q_Schema || '.' || QUEUE_NAME,
492: DEQUEUE_OPTIONS => dq_opts,
493: MESSAGE_PROPERTIES => msg_props,
494: PAYLOAD => payload,
495: MSGID => msgid);