64: from dual;
65:
66: begin
67: l_module := 'ecx.plsql.ecx_inbound_listener_qh.dequeue';
68: if (wf_log_pkg.level_procedure >= fnd_log.g_current_runtime_level) then
69: wf_log_pkg.string(wf_log_pkg.level_procedure, l_module || '.begin',
70: 'in dequeue');
71: end if;
72:
65:
66: begin
67: l_module := 'ecx.plsql.ecx_inbound_listener_qh.dequeue';
68: if (wf_log_pkg.level_procedure >= fnd_log.g_current_runtime_level) then
69: wf_log_pkg.string(wf_log_pkg.level_procedure, l_module || '.begin',
70: 'in dequeue');
71: end if;
72:
73: select upper(queue_name), upper(name), system_guid
82:
83: x_from_agt := wf_agent_t(x_agent_name, x_sys_name);
84: x_to_agt := wf_agent_t(x_agent_name, x_sys_name);
85:
86: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
87: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,'p_agent_guid' ||hextoraw(p_agent_guid));
88: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,'System: ' || x_sys_name);
89: end if;
90:
83: x_from_agt := wf_agent_t(x_agent_name, x_sys_name);
84: x_to_agt := wf_agent_t(x_agent_name, x_sys_name);
85:
86: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
87: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,'p_agent_guid' ||hextoraw(p_agent_guid));
88: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,'System: ' || x_sys_name);
89: end if;
90:
91: x_dequeue_options.wait := 1;
84: x_to_agt := wf_agent_t(x_agent_name, x_sys_name);
85:
86: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
87: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,'p_agent_guid' ||hextoraw(p_agent_guid));
88: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,'System: ' || x_sys_name);
89: end if;
90:
91: x_dequeue_options.wait := 1;
92:
107: then
108: x_ecxmsg.transaction_subtype := x_ecxmsg.transaction_type;
109: end if;
110:
111: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
112: wf_log_pkg.string(wf_log_pkg.level_statement, l_module, 'after dequeue');
113: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
114: 'Message Id: ' || x_msgid);
115: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
108: x_ecxmsg.transaction_subtype := x_ecxmsg.transaction_type;
109: end if;
110:
111: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
112: wf_log_pkg.string(wf_log_pkg.level_statement, l_module, 'after dequeue');
113: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
114: 'Message Id: ' || x_msgid);
115: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
116: 'Message Type: ' || x_ecxmsg.message_type);
109: end if;
110:
111: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
112: wf_log_pkg.string(wf_log_pkg.level_statement, l_module, 'after dequeue');
113: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
114: 'Message Id: ' || x_msgid);
115: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
116: 'Message Type: ' || x_ecxmsg.message_type);
117: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
111: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
112: wf_log_pkg.string(wf_log_pkg.level_statement, l_module, 'after dequeue');
113: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
114: 'Message Id: ' || x_msgid);
115: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
116: 'Message Type: ' || x_ecxmsg.message_type);
117: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
118: 'Message Standard: ' || x_ecxmsg.message_standard);
119: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
113: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
114: 'Message Id: ' || x_msgid);
115: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
116: 'Message Type: ' || x_ecxmsg.message_type);
117: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
118: 'Message Standard: ' || x_ecxmsg.message_standard);
119: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
120: 'transaction type: ' || x_ecxmsg.transaction_type);
121: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
115: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
116: 'Message Type: ' || x_ecxmsg.message_type);
117: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
118: 'Message Standard: ' || x_ecxmsg.message_standard);
119: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
120: 'transaction type: ' || x_ecxmsg.transaction_type);
121: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
122: 'transaction subtype: '|| x_ecxmsg.transaction_subtype);
123: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
117: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
118: 'Message Standard: ' || x_ecxmsg.message_standard);
119: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
120: 'transaction type: ' || x_ecxmsg.transaction_type);
121: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
122: 'transaction subtype: '|| x_ecxmsg.transaction_subtype);
123: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
124: ' Defaulted transaction subtype: '|| x_ecxmsg.transaction_subtype);
125: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
119: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
120: 'transaction type: ' || x_ecxmsg.transaction_type);
121: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
122: 'transaction subtype: '|| x_ecxmsg.transaction_subtype);
123: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
124: ' Defaulted transaction subtype: '|| x_ecxmsg.transaction_subtype);
125: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
126: 'Party Site Id: '|| x_ecxmsg.party_site_id);
127: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
121: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
122: 'transaction subtype: '|| x_ecxmsg.transaction_subtype);
123: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
124: ' Defaulted transaction subtype: '|| x_ecxmsg.transaction_subtype);
125: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
126: 'Party Site Id: '|| x_ecxmsg.party_site_id);
127: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
128: 'From: '|| x_ecxmsg.attribute1);
129: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
123: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
124: ' Defaulted transaction subtype: '|| x_ecxmsg.transaction_subtype);
125: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
126: 'Party Site Id: '|| x_ecxmsg.party_site_id);
127: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
128: 'From: '|| x_ecxmsg.attribute1);
129: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
130: 'Final Destination: '|| x_ecxmsg.attribute3);
131: end if;
125: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
126: 'Party Site Id: '|| x_ecxmsg.party_site_id);
127: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
128: 'From: '|| x_ecxmsg.attribute1);
129: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
130: 'Final Destination: '|| x_ecxmsg.attribute3);
131: end if;
132:
133: x_from_agt := wf_agent_t(substr(x_ecxmsg.party_site_id,1,30),
145: p_event.error_message := null;
146: p_event.error_stack := null;
147:
148: select ecx_inlstn_s.nextval into i_message_counter from dual ;
149: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
150: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
151: 'setting message props');
152: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
153: 'msg_counter: ' || i_message_counter);
146: p_event.error_stack := null;
147:
148: select ecx_inlstn_s.nextval into i_message_counter from dual ;
149: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
150: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
151: 'setting message props');
152: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
153: 'msg_counter: ' || i_message_counter);
154: end if;
148: select ecx_inlstn_s.nextval into i_message_counter from dual ;
149: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
150: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
151: 'setting message props');
152: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
153: 'msg_counter: ' || i_message_counter);
154: end if;
155:
156: --- Encrypt the password
186: p_event.AddParameterToList('ECX_TRIGGER_ID', x_trigger_id);
187:
188: -- KH How do we pass this parameter dynamically through the Interface
189: --p_event.AddParameterToList('ECX_DEBUG_LEVEL', 0);
190: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
191: wf_log_pkg.string(wf_log_pkg.level_statement, l_module, 'Setting payload');
192: end if;
193: p_event.setEventData(x_ecxmsg.payload);
194:
187:
188: -- KH How do we pass this parameter dynamically through the Interface
189: --p_event.AddParameterToList('ECX_DEBUG_LEVEL', 0);
190: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
191: wf_log_pkg.string(wf_log_pkg.level_statement, l_module, 'Setting payload');
192: end if;
193: p_event.setEventData(x_ecxmsg.payload);
194:
195: exception
193: p_event.setEventData(x_ecxmsg.payload);
194:
195: exception
196: when no_messages then
197: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
198: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
199: 'No more messages in dequeue.');
200: end if;
201: p_event := NULL;
194:
195: exception
196: when no_messages then
197: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
198: wf_log_pkg.string(wf_log_pkg.level_statement, l_module,
199: 'No more messages in dequeue.');
200: end if;
201: p_event := NULL;
202: return;
202: return;
203:
204: when queue_handler_exit then
205: rollback to before_dequeue;
206: if (wf_log_pkg.level_error >= fnd_log.g_current_runtime_level) then
207: wf_log_pkg.string(wf_log_pkg.level_error, l_module,
208: ecx_debug.getMessage(ecx_utils.i_errbuf, ecx_utils.i_errparams));
209: wf_log_pkg.string(wf_log_pkg.level_error, l_module,
210: 'Exception in dequeue ' || x_queue_name);
203:
204: when queue_handler_exit then
205: rollback to before_dequeue;
206: if (wf_log_pkg.level_error >= fnd_log.g_current_runtime_level) then
207: wf_log_pkg.string(wf_log_pkg.level_error, l_module,
208: ecx_debug.getMessage(ecx_utils.i_errbuf, ecx_utils.i_errparams));
209: wf_log_pkg.string(wf_log_pkg.level_error, l_module,
210: 'Exception in dequeue ' || x_queue_name);
211: end if;
205: rollback to before_dequeue;
206: if (wf_log_pkg.level_error >= fnd_log.g_current_runtime_level) then
207: wf_log_pkg.string(wf_log_pkg.level_error, l_module,
208: ecx_debug.getMessage(ecx_utils.i_errbuf, ecx_utils.i_errparams));
209: wf_log_pkg.string(wf_log_pkg.level_error, l_module,
210: 'Exception in dequeue ' || x_queue_name);
211: end if;
212: Wf_Core.Context('ECX_INBOUND_LISTENER_QH', 'Dequeue', x_queue_name);
213: raise;
213: raise;
214:
215: when others then
216: rollback to before_dequeue;
217: if (wf_log_pkg.level_unexpected >= fnd_log.g_current_runtime_level) then
218: wf_log_pkg.string(wf_log_pkg.level_unexpected, l_module,
219: substr(sqlerrm, 1,2000));
220: wf_log_pkg.string(wf_log_pkg.level_unexpected, l_module,
221: 'Exception in dequeue '|| x_queue_name);
214:
215: when others then
216: rollback to before_dequeue;
217: if (wf_log_pkg.level_unexpected >= fnd_log.g_current_runtime_level) then
218: wf_log_pkg.string(wf_log_pkg.level_unexpected, l_module,
219: substr(sqlerrm, 1,2000));
220: wf_log_pkg.string(wf_log_pkg.level_unexpected, l_module,
221: 'Exception in dequeue '|| x_queue_name);
222: end if;
216: rollback to before_dequeue;
217: if (wf_log_pkg.level_unexpected >= fnd_log.g_current_runtime_level) then
218: wf_log_pkg.string(wf_log_pkg.level_unexpected, l_module,
219: substr(sqlerrm, 1,2000));
220: wf_log_pkg.string(wf_log_pkg.level_unexpected, l_module,
221: 'Exception in dequeue '|| x_queue_name);
222: end if;
223: Wf_Core.Context('ECX_INBOUND_LISTENER_QH', 'Dequeue', x_queue_name);
224: raise;
237: l_module varchar2(2000);
238:
239: begin
240: l_module := 'ecx.plsql.ecx_inbound_listener_qh.enqueue';
241: if (wf_log_pkg.level_procedure >= fnd_log.g_current_runtime_level) then
242: wf_log_pkg.string(wf_log_pkg.level_procedure, l_module || '.begin',
243: 'in enqueue');
244: end if;
245:
238:
239: begin
240: l_module := 'ecx.plsql.ecx_inbound_listener_qh.enqueue';
241: if (wf_log_pkg.level_procedure >= fnd_log.g_current_runtime_level) then
242: wf_log_pkg.string(wf_log_pkg.level_procedure, l_module || '.begin',
243: 'in enqueue');
244: end if;
245:
246: x_out_queue := 'APPLSYS.ECX_INBOUND';
278: payload => x_ecxmsg,
279: msgid => x_msgid
280: );
281:
282: if (wf_log_pkg.level_procedure >= fnd_log.g_current_runtime_level) then
283: wf_log_pkg.string(wf_log_pkg.level_procedure, l_module || '.end',
284: 'finished calling dbms_aq.enqueue');
285: end if;
286:
279: msgid => x_msgid
280: );
281:
282: if (wf_log_pkg.level_procedure >= fnd_log.g_current_runtime_level) then
283: wf_log_pkg.string(wf_log_pkg.level_procedure, l_module || '.end',
284: 'finished calling dbms_aq.enqueue');
285: end if;
286:
287: exception