1: package body WF_ERROR_QH as
2: /* $Header: wferrqhb.pls 120.2 2006/02/16 05:49:22 nravindr ship $ */
3: ------------------------------------------------------------------------------
4: PROCEDURE dequeue(p_agent_guid in raw,
5: p_event out nocopy wf_event_t)
21: where guid = p_agent_guid;
22:
23: if (wf_log_pkg.level_procedure >= fnd_log.g_current_runtime_level) then
24: wf_log_pkg.string(wf_log_pkg.level_procedure,
25: 'wf.plsql.WF_ERROR_QH.dequeue.Begin',
26: 'Dequeuing '||x_queue_name||' on '||x_agent_name);
27: end if;
28:
29:
42:
43: if (wf_log_pkg.level_procedure >= fnd_log.g_current_runtime_level) then
44: if (wf_event.g_correlation is not null) then
45: wf_log_pkg.string(wf_log_pkg.level_procedure,
46: 'wf.plsql.WF_ERROR_QH.dequeue.corrid',
47: 'Dequeuing with Correlation ' || x_dequeue_options.correlation);
48: else
49: wf_log_pkg.string(wf_log_pkg.level_procedure,
50: 'wf.plsql.WF_ERROR_QH.dequeue.corrid',
46: 'wf.plsql.WF_ERROR_QH.dequeue.corrid',
47: 'Dequeuing with Correlation ' || x_dequeue_options.correlation);
48: else
49: wf_log_pkg.string(wf_log_pkg.level_procedure,
50: 'wf.plsql.WF_ERROR_QH.dequeue.corrid',
51: 'Dequeuing with No Correlation');
52: end if;
53: end if;
54:
67: when no_messages then
68:
69: if (wf_log_pkg.level_event >= fnd_log.g_current_runtime_level) then
70: wf_log_pkg.string(wf_log_pkg.level_event,
71: 'wf.plsql.WF_ERROR_QH.dequeue.queue_empty',
72: 'No more messages in dequeue.');
73: end if;
74:
75: wf_event.navigation := dbms_aq.first_message;
99: raise;
100: END;
101: exception
102: when others then
103: Wf_Core.Context('Wf_Error_QH', 'Dequeue', x_queue_name,
104: 'SQL err is '||substr(sqlerrm,1,200));
105: raise;
106: end dequeue;
107: ------------------------------------------------------------------------------
132: begin
133:
134: if (wf_log_pkg.level_procedure >= fnd_log.g_current_runtime_level) then
135: wf_log_pkg.string(wf_log_pkg.level_procedure,
136: 'wf.plsql.WF_ERROR_QH.enqueue.Begin',
137: 'Entered Enqueue ');
138: end if;
139:
140: -- Determine the out queue --
150: and sys.guid = agt.system_guid;
151:
152: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
153: wf_log_pkg.string(wf_log_pkg.level_statement,
154: 'wf.plsql.WF_ERROR_QH.enqueue.Enqueuing',
155: 'Enqueuing on Queue: '||x_out_queue);
156: end if;
157:
158: x_protocol_num := 0;
171: end if;
172:
173: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
174: wf_log_pkg.string(wf_log_pkg.level_statement,
175: 'wf.plsql.WF_ERROR_QH.enqueue.dbms_qa',
176: 'calling dbms_aq.enqueue');
177: end if;
178:
179: DBMS_AQ.ENQUEUE(
184: msgid => x_msgid); /* OUT*/
185:
186: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
187: wf_log_pkg.string(wf_log_pkg.level_statement,
188: 'wf.plsql.WF_ERROR_QH.enqueue.done',
189: 'finished calling dbms_aq.enqueue');
190: end if;
191:
192: exception
190: end if;
191:
192: exception
193: when others then
194: Wf_Core.Context('Wf_Error_QH', 'Enqueue', x_out_queue
195: );
196: raise;
197: end enqueue;
198: ------------------------------------------------------------------------------
195: );
196: raise;
197: end enqueue;
198: ------------------------------------------------------------------------------
199: end WF_ERROR_QH;