122: --Set the value for the attribute
123: wf_engine.SetItemAttrText(itemtype, itemkey,
124: aname, avalue);
125: exception when others then
126: if ( wf_core.error_name = 'WFENG_ITEM_ATTR' ) then
127: --If the attribute does not exist first create it
128: --and then add the value
129: Wf_Engine.AddItemAttr(itemtype, itemkey, aname);
130: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname, avalue);
161: -- at the moment we only accept :ERROR:
162: if substr(p_payload.result,colon+1,5) = 'ERROR' then
163:
164: begin
165: wf_core.clear;
166: -- set the function name for courtesy.
167: wf_core.token('FUNCTION_NAME',
168: Wf_Activity.activity_function(itemtype,
169: itemkey,actid));
163:
164: begin
165: wf_core.clear;
166: -- set the function name for courtesy.
167: wf_core.token('FUNCTION_NAME',
168: Wf_Activity.activity_function(itemtype,
169: itemkey,actid));
170: wf_core.raise('WF_EXT_FUNCTION');
171: exception when others then null;
166: -- set the function name for courtesy.
167: wf_core.token('FUNCTION_NAME',
168: Wf_Activity.activity_function(itemtype,
169: itemkey,actid));
170: wf_core.raise('WF_EXT_FUNCTION');
171: exception when others then null;
172: end;
173: --function name on payload is upto 200 char so use it to record error
174: wf_core.error_stack := p_payload.function_name;
170: wf_core.raise('WF_EXT_FUNCTION');
171: exception when others then null;
172: end;
173: --function name on payload is upto 200 char so use it to record error
174: wf_core.error_stack := p_payload.function_name;
175:
176: wf_engine.CB(command => 'ERROR',
177: context =>itemtype||':'||
178: 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;
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
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
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)
250: if wf_queue.name_init then
251: return;
252: end if;
253:
254: schema_name := wf_core.translate('WF_SCHEMA');
255:
256: -- Do not determine account name by STANDALONE vs. EMBEDDED any more
257:
258: -- Current_schema is the schema in effect.
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:
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;
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)
429: end;
430: exception
431: when NO_SAVEPOINT then
432: -- Catch any savepoint error in case of a commit happened.
433: Wf_Core.Token('ACTIVITY', Wf_Engine.GetActivityLabel(actid));
434: Wf_Core.Raise('WFENG_COMMIT_IN_PROCESS');
435: end;
436: exception
437: when OTHERS then
430: exception
431: when NO_SAVEPOINT then
432: -- Catch any savepoint error in case of a commit happened.
433: Wf_Core.Token('ACTIVITY', Wf_Engine.GetActivityLabel(actid));
434: Wf_Core.Raise('WFENG_COMMIT_IN_PROCESS');
435: end;
436: exception
437: when OTHERS then
438: -- Remaining steps for proces thread raises an exception:
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,
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,
449: actid, wf_engine.eng_exception);
450: Wf_Core.Clear;
451: end;
452:
453: -- Commit work to insure this activity thread doesn't interfere
454: -- with others.
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:
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:
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:
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;
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:
790: when dequeue_timeout then
791: timeout := TRUE;
792: when others then
793: if correlation is null then
794: Wf_Core.Context('WF_QUEUE', 'Dequeue_Event', queuename, '%');
795: else
796: Wf_Core.Context('WF_QUEUE', 'Dequeue_Event', queuename, correlation);
797: end if;
798: timeout := FALSE;
792: when others then
793: if correlation is null then
794: Wf_Core.Context('WF_QUEUE', 'Dequeue_Event', queuename, '%');
795: else
796: Wf_Core.Context('WF_QUEUE', 'Dequeue_Event', queuename, correlation);
797: end if;
798: timeout := FALSE;
799: raise;
800:
880: return(FALSE);
881: when resource_busy then
882: return(FALSE);
883: when others then
884: Wf_Core.Context('Wf_Queue', 'Activity_valid', 'Invalid',
885: event.itemtype||':'||event.itemkey, to_char(event.actid));
886: return(FALSE);
887: end activity_valid;
888:
973: aname=>'#DELAY_ACTID_'||enqueue_event.actid,
974: avalue=>l_increment_delay);
975: exception
976: when others then
977: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
978: Wf_Core.Clear;
979: Wf_Engine.AddItemAttr(itemtype=>enqueue_event.itemtype,
980: itemkey=>enqueue_event.itemkey,
981: aname=>'#DELAY_ACTID_'||enqueue_event.actid,
974: avalue=>l_increment_delay);
975: exception
976: when others then
977: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
978: Wf_Core.Clear;
979: Wf_Engine.AddItemAttr(itemtype=>enqueue_event.itemtype,
980: itemkey=>enqueue_event.itemkey,
981: aname=>'#DELAY_ACTID_'||enqueue_event.actid,
982: number_value=>l_increment_delay);
1045:
1046:
1047: exception
1048: when others then
1049: Wf_Core.Context('Wf_Queue', 'Enqueue_event', itemtype,
1050: itemkey, to_char(actid), to_char(delay));
1051: raise;
1052:
1053: end;
1155: exit when nothing_processed;
1156: end loop;
1157: exception
1158: when others then
1159: Wf_Core.Context('Wf_Queue', 'ProcessInboundQueue');
1160: raise;
1161: end ProcessInboundQueue;
1162:
1163: procedure ProcessDeferredQueue (itemtype in varchar2 default null,
1187: if correlation is not null then
1188: lcorrelation := correlation;
1189:
1190: -- for standalone, we first try the old correlation id format.
1191: elsif (wf_core.translate('WF_INSTALL') = 'STANDALONE'
1192: and itemtype is not null) then
1193: lcorrelation := itemtype;
1194:
1195: -- for embedded, there was never the old format, so we are fine.
1287: end loop;
1288:
1289: exception
1290: when dequeue_disabled then
1291: Wf_Core.Context('Wf_Queue', 'ProcessDeferredQueue', 'Queue shutdown');
1292: raise;
1293: when shutdown_pending then
1294: Wf_Core.Context('Wf_Queue', 'ProcessDeferredQueue', 'DB shutting down');
1295: raise;
1290: when dequeue_disabled then
1291: Wf_Core.Context('Wf_Queue', 'ProcessDeferredQueue', 'Queue shutdown');
1292: raise;
1293: when shutdown_pending then
1294: Wf_Core.Context('Wf_Queue', 'ProcessDeferredQueue', 'DB shutting down');
1295: raise;
1296: when others then
1297: Wf_Core.Context('Wf_Queue', 'ProcessDeferredQueue');
1298: raise;
1293: when shutdown_pending then
1294: Wf_Core.Context('Wf_Queue', 'ProcessDeferredQueue', 'DB shutting down');
1295: raise;
1296: when others then
1297: Wf_Core.Context('Wf_Queue', 'ProcessDeferredQueue');
1298: raise;
1299: end ProcessDeferredQueue;
1300:
1301:
1406:
1407: /*
1408: ** Update the event to let everyone know it expired
1409: */
1410: l_event.SetErrorMessage(wf_core.translate('WFE_MESSAGE_EXPIRED'));
1411: l_event.addParameterToList('ERROR_NAME',
1412: wf_core.translate('WFE_MESSAGE_EXPIRED') );
1413: l_event.addParameterToList('ERROR_TYPE', 'ERROR');
1414:
1408: ** Update the event to let everyone know it expired
1409: */
1410: l_event.SetErrorMessage(wf_core.translate('WFE_MESSAGE_EXPIRED'));
1411: l_event.addParameterToList('ERROR_NAME',
1412: wf_core.translate('WFE_MESSAGE_EXPIRED') );
1413: l_event.addParameterToList('ERROR_TYPE', 'ERROR');
1414:
1415: /*
1416: ** As we can't use the private API SaveErrorToQueue
1417: ** we copy a little bit of code to do it
1418: */
1419: select name into lsysname
1420: from wf_systems
1421: where guid = hextoraw(wf_core.translate('WF_SYSTEM_GUID'));
1422:
1423: erragt := wf_agent_t('WF_ERROR', lsysname);
1424: cmd := 'begin WF_ERROR_QH.enqueue(:v1, :v2); end;';
1425: execute immediate cmd using in l_event,
1438: end;
1439: end loop;
1440: exception
1441: when others then
1442: Wf_Core.Context('Wf_Queue', 'DequeueException',queuename);
1443: raise;
1444: end DequeueException;
1445: --=============================================================
1446: -- Declare all developer APIs for Inbound queue manipulation
1458: wf_queue.stck_actid(1) := 0;
1459: wf_queue.stck_ctr := 0;
1460: exception
1461: when others then
1462: Wf_Core.Context('Wf_Queue', 'ClearMsgStack');
1463: raise;
1464: end ClearMsgStack;
1465:
1466:
1485:
1486:
1487: exception
1488: when others then
1489: Wf_Core.Context('Wf_Queue', 'WriteMsg');
1490: raise;
1491:
1492: end WriteMsg;
1493:
1505: i := wf_queue.SearchMsgStack(itemtype,itemkey,actid);
1506:
1507: exception
1508: when others then
1509: Wf_Core.Context('Wf_Queue', 'CreateMsg');
1510: raise;
1511:
1512: end CreateMsg;
1513:
1535: end if;
1536:
1537: exception
1538: when others then
1539: Wf_Core.Context('Wf_Queue', 'SetMsgAttr',
1540: itemtype, itemkey, actid, to_char(stck_ctr));
1541: raise;
1542: end SetMsgAttr;
1543:
1557: wf_queue.stck_result(i) :=result;
1558:
1559: exception
1560: when others then
1561: Wf_Core.Context('Wf_Queue', 'AddResult',
1562: itemtype, itemkey, actid, to_char(stck_ctr));
1563: raise;
1564: end SetMsgResult;
1565:
1587: wf_queue.stck_AttrList(wf_queue.stck_ctr) := null;
1588:
1589: exception
1590: when others then
1591: Wf_Core.Context('Wf_Queue', 'AddNewMsg',
1592: itemtype, itemkey, actid, to_char(stck_ctr));
1593: raise;
1594: end AddNewMsg;
1595:
1665: wfa_sec.GetSession(username);
1666: username := upper(username);
1667: wf_directory.GetRoleInfo(username, realname, s0, s0, s0, s0);
1668:
1669: admin_role := wf_core.translate('WF_ADMIN_ROLE');
1670: if (admin_role = '*' or
1671: Wf_Directory.IsPerformer(username, admin_role)) then
1672: admin_mode := 'Y';
1673: else
1671: Wf_Directory.IsPerformer(username, admin_role)) then
1672: admin_mode := 'Y';
1673: else
1674:
1675: l_error_msg := wf_core.translate('WFPREF_INVALID_ADMIN');
1676:
1677: end if;
1678:
1679: -- Set page title
1679: -- Set page title
1680: htp.htmlOpen;
1681: htp.headOpen;
1682: htp.p('
1683: htp.title(wf_core.translate('WFGENERIC_QUEUE_TITLE'));
1684: wfa_html.create_help_function('wf/links/dmr.htm?DMREP');
1685: htp.headClose;
1686: wfa_sec.Header(FALSE, '',wf_core.translate('WFGENERIC_QUEUE_TITLE'), FALSE);
1687: htp.br;
1682: htp.p('
1683: htp.title(wf_core.translate('WFGENERIC_QUEUE_TITLE'));
1684: wfa_html.create_help_function('wf/links/dmr.htm?DMREP');
1685: htp.headClose;
1686: wfa_sec.Header(FALSE, '',wf_core.translate('WFGENERIC_QUEUE_TITLE'), FALSE);
1687: htp.br;
1688:
1689: IF (admin_mode = 'N') THEN
1690:
1698: htp.tableRowOpen(cattributes=>'bgcolor=#006699');
1699:
1700:
1701: htp.tableHeader(cvalue=>''||
1702: wf_core.translate('PROTOCOL')||'',
1703: calign=>'Center',
1704: cattributes=>'id="' || wf_core.translate('PROTOCOL') || '"');
1705: htp.tableHeader(cvalue=>''||
1706: wf_core.translate('QUEUE_DESCRIPTION')||'',
1700:
1701: htp.tableHeader(cvalue=>''||
1702: wf_core.translate('PROTOCOL')||'',
1703: calign=>'Center',
1704: cattributes=>'id="' || wf_core.translate('PROTOCOL') || '"');
1705: htp.tableHeader(cvalue=>''||
1706: wf_core.translate('QUEUE_DESCRIPTION')||'',
1707: calign=>'Center',
1708: cattributes=>'id="' || wf_core.translate('QUEUE_DESCRIPTION') || '"');
1702: wf_core.translate('PROTOCOL')||'',
1703: calign=>'Center',
1704: cattributes=>'id="' || wf_core.translate('PROTOCOL') || '"');
1705: htp.tableHeader(cvalue=>''||
1706: wf_core.translate('QUEUE_DESCRIPTION')||'',
1707: calign=>'Center',
1708: cattributes=>'id="' || wf_core.translate('QUEUE_DESCRIPTION') || '"');
1709: htp.tableHeader(cvalue=>''||
1710: wf_core.translate('INBOUND_PROMPT')||'',
1704: cattributes=>'id="' || wf_core.translate('PROTOCOL') || '"');
1705: htp.tableHeader(cvalue=>''||
1706: wf_core.translate('QUEUE_DESCRIPTION')||'',
1707: calign=>'Center',
1708: cattributes=>'id="' || wf_core.translate('QUEUE_DESCRIPTION') || '"');
1709: htp.tableHeader(cvalue=>''||
1710: wf_core.translate('INBOUND_PROMPT')||'',
1711: calign=>'Center',
1712: cattributes=>'id="' || wf_core.translate('INBOUND_PROMPT') || '"');
1706: wf_core.translate('QUEUE_DESCRIPTION')||'',
1707: calign=>'Center',
1708: cattributes=>'id="' || wf_core.translate('QUEUE_DESCRIPTION') || '"');
1709: htp.tableHeader(cvalue=>''||
1710: wf_core.translate('INBOUND_PROMPT')||'',
1711: calign=>'Center',
1712: cattributes=>'id="' || wf_core.translate('INBOUND_PROMPT') || '"');
1713: htp.tableHeader(cvalue=>''||
1714: wf_core.translate('QUEUE_COUNT')||'',
1708: cattributes=>'id="' || wf_core.translate('QUEUE_DESCRIPTION') || '"');
1709: htp.tableHeader(cvalue=>''||
1710: wf_core.translate('INBOUND_PROMPT')||'',
1711: calign=>'Center',
1712: cattributes=>'id="' || wf_core.translate('INBOUND_PROMPT') || '"');
1713: htp.tableHeader(cvalue=>''||
1714: wf_core.translate('QUEUE_COUNT')||'',
1715: calign=>'Center',
1716: cattributes=>'id="' || wf_core.translate('QUEUE_COUNT') || '"');
1710: wf_core.translate('INBOUND_PROMPT')||'',
1711: calign=>'Center',
1712: cattributes=>'id="' || wf_core.translate('INBOUND_PROMPT') || '"');
1713: htp.tableHeader(cvalue=>''||
1714: wf_core.translate('QUEUE_COUNT')||'',
1715: calign=>'Center',
1716: cattributes=>'id="' || wf_core.translate('QUEUE_COUNT') || '"');
1717: htp.tableHeader(cvalue=>''||
1718: wf_core.translate('VIEW_DETAIL')||'',
1712: cattributes=>'id="' || wf_core.translate('INBOUND_PROMPT') || '"');
1713: htp.tableHeader(cvalue=>''||
1714: wf_core.translate('QUEUE_COUNT')||'',
1715: calign=>'Center',
1716: cattributes=>'id="' || wf_core.translate('QUEUE_COUNT') || '"');
1717: htp.tableHeader(cvalue=>''||
1718: wf_core.translate('VIEW_DETAIL')||'',
1719: calign=>'Center',
1720: cattributes=>'id="' || wf_core.translate('VIEW_DETAIL') || '"');
1714: wf_core.translate('QUEUE_COUNT')||'',
1715: calign=>'Center',
1716: cattributes=>'id="' || wf_core.translate('QUEUE_COUNT') || '"');
1717: htp.tableHeader(cvalue=>''||
1718: wf_core.translate('VIEW_DETAIL')||'',
1719: calign=>'Center',
1720: cattributes=>'id="' || wf_core.translate('VIEW_DETAIL') || '"');
1721: htp.tableHeader(cvalue=>''||
1722: wf_core.translate('DELETE')||'',
1716: cattributes=>'id="' || wf_core.translate('QUEUE_COUNT') || '"');
1717: htp.tableHeader(cvalue=>''||
1718: wf_core.translate('VIEW_DETAIL')||'',
1719: calign=>'Center',
1720: cattributes=>'id="' || wf_core.translate('VIEW_DETAIL') || '"');
1721: htp.tableHeader(cvalue=>''||
1722: wf_core.translate('DELETE')||'',
1723: calign=>'Center',
1724: cattributes=>'id="' || wf_core.translate('DELETE') || '"');
1718: wf_core.translate('VIEW_DETAIL')||'',
1719: calign=>'Center',
1720: cattributes=>'id="' || wf_core.translate('VIEW_DETAIL') || '"');
1721: htp.tableHeader(cvalue=>''||
1722: wf_core.translate('DELETE')||'',
1723: calign=>'Center',
1724: cattributes=>'id="' || wf_core.translate('DELETE') || '"');
1725:
1726: htp.tableRowClose;
1720: cattributes=>'id="' || wf_core.translate('VIEW_DETAIL') || '"');
1721: htp.tableHeader(cvalue=>''||
1722: wf_core.translate('DELETE')||'',
1723: calign=>'Center',
1724: cattributes=>'id="' || wf_core.translate('DELETE') || '"');
1725:
1726: htp.tableRowClose;
1727: htp.tableRowOpen;
1728: htp.tableRowClose;
1740: queues.inbound_outbound,
1741: ctext=>queues.protocol, ctarget=>'_top'),
1742: 'Left',
1743: cattributes=>'headers="' ||
1744: wf_core.translate('PROTOCOL') || '"');
1745:
1746: htp.tableData(queues.description, 'left',
1747: cattributes=>'headers="' || wf_core.translate('QUEUE_DESCRIPTION') || '"');
1748:
1743: cattributes=>'headers="' ||
1744: wf_core.translate('PROTOCOL') || '"');
1745:
1746: htp.tableData(queues.description, 'left',
1747: cattributes=>'headers="' || wf_core.translate('QUEUE_DESCRIPTION') || '"');
1748:
1749: htp.tableData(queues.inbound_outbound, 'left',
1750: cattributes=>'headers="' || wf_core.translate('INBOUND_PROMPT') || '"');
1751:
1746: htp.tableData(queues.description, 'left',
1747: cattributes=>'headers="' || wf_core.translate('QUEUE_DESCRIPTION') || '"');
1748:
1749: htp.tableData(queues.inbound_outbound, 'left',
1750: cattributes=>'headers="' || wf_core.translate('INBOUND_PROMPT') || '"');
1751:
1752: htp.tableData(queues.queue_count, 'left',
1753: cattributes=>'headers="' || wf_core.translate('QUEUE_COUNT') || '"');
1754:
1749: htp.tableData(queues.inbound_outbound, 'left',
1750: cattributes=>'headers="' || wf_core.translate('INBOUND_PROMPT') || '"');
1751:
1752: htp.tableData(queues.queue_count, 'left',
1753: cattributes=>'headers="' || wf_core.translate('QUEUE_COUNT') || '"');
1754:
1755: htp.tableData(htf.anchor2(curl=>wfa_html.base_url||
1756: '/wf_queue.Generic_Queue_View_Detail?p_protocol='||
1757: queues.protocol||'&p_inbound_outbound='||
1755: htp.tableData(htf.anchor2(curl=>wfa_html.base_url||
1756: '/wf_queue.Generic_Queue_View_Detail?p_protocol='||
1757: queues.protocol||'&p_inbound_outbound='||
1758: queues.inbound_outbound,
1759: ctext=>''),
1760: 'center', cattributes=>'valign="MIDDLE"
1761: headers="' || wf_core.translate('VIEW_DETAIL') || '"');
1762:
1763: htp.tableData(htf.anchor2(curl=>wfa_html.base_url||
1757: queues.protocol||'&p_inbound_outbound='||
1758: queues.inbound_outbound,
1759: ctext=>''),
1760: 'center', cattributes=>'valign="MIDDLE"
1761: headers="' || wf_core.translate('VIEW_DETAIL') || '"');
1762:
1763: htp.tableData(htf.anchor2(curl=>wfa_html.base_url||
1764: '/wf_queue.generic_queue_confirm_delete?p_protocol='||
1765: queues.protocol||'&p_inbound_outbound='||
1763: htp.tableData(htf.anchor2(curl=>wfa_html.base_url||
1764: '/wf_queue.generic_queue_confirm_delete?p_protocol='||
1765: queues.protocol||'&p_inbound_outbound='||
1766: queues.inbound_outbound,
1767: ctext=>''),
1768: 'center', cattributes=>'valign="MIDDLE"
1769: headers="' || wf_core.translate('DELETE') || '"');
1770:
1771:
1765: queues.protocol||'&p_inbound_outbound='||
1766: queues.inbound_outbound,
1767: ctext=>''),
1768: 'center', cattributes=>'valign="MIDDLE"
1769: headers="' || wf_core.translate('DELETE') || '"');
1770:
1771:
1772: end loop;
1773:
1781: htp.tableRowOpen;
1782:
1783: l_url := wfa_html.base_url||'/wf_queue.generic_queue_edit';
1784: l_icon := 'FNDJLFOK.gif';
1785: l_text := wf_core.translate ('WFQUEUE_CREATE');
1786: l_onmouseover := wf_core.translate ('WFQUEUE_CREATE');
1787:
1788: htp.p('
1782:
1783: l_url := wfa_html.base_url||'/wf_queue.generic_queue_edit';
1784: l_icon := 'FNDJLFOK.gif';
1785: l_text := wf_core.translate ('WFQUEUE_CREATE');
1786: l_onmouseover := wf_core.translate ('WFQUEUE_CREATE');
1787:
1788: htp.p('
1799: htp.htmlClose;
1800:
1801: exception
1802: when others then
1803: wf_core.context('FND_DOCUMENT_MANAGEMENT', 'Generic_Queue_Display');
1804: raise;
1805: end Generic_Queue_Display;
1806:
1807: --
1836: wfa_sec.GetSession(username);
1837: username := upper(username);
1838: wf_directory.GetRoleInfo(username, realname, s0, s0, s0, s0);
1839:
1840: admin_role := wf_core.translate('WF_ADMIN_ROLE');
1841: if (admin_role = '*' or
1842: Wf_Directory.IsPerformer(username, admin_role)) then
1843: admin_mode := 'Y';
1844: else
1842: Wf_Directory.IsPerformer(username, admin_role)) then
1843: admin_mode := 'Y';
1844: else
1845:
1846: l_error_msg := wf_core.translate('WFPREF_INVALID_ADMIN');
1847:
1848: end if;
1849:
1850: -- Set page title
1850: -- Set page title
1851: htp.htmlOpen;
1852: htp.headOpen;
1853: htp.p('
1854: htp.title(wf_core.translate('WFGENERIC_QUEUE_TITLE'));
1855: wfa_html.create_help_function('wf/links/dmr.htm?DMREP');
1856: htp.headClose;
1857: wfa_sec.Header(FALSE, '',wf_core.translate('WFGENERIC_QUEUE_TITLE'), FALSE);
1858: htp.br;
1853: htp.p('
1854: htp.title(wf_core.translate('WFGENERIC_QUEUE_TITLE'));
1855: wfa_html.create_help_function('wf/links/dmr.htm?DMREP');
1856: htp.headClose;
1857: wfa_sec.Header(FALSE, '',wf_core.translate('WFGENERIC_QUEUE_TITLE'), FALSE);
1858: htp.br;
1859:
1860: IF (admin_mode = 'N') THEN
1861:
1874: htp.tableOpen(cattributes=>'border=1 cellpadding=3 bgcolor=white width="100%" summary=""');
1875: htp.tableRowOpen(cattributes=>'bgcolor=#006699');
1876:
1877: htp.tableHeader(cvalue=>''||
1878: wf_core.translate('PROTOCOL')||'',
1879: calign=>'Center',
1880: cattributes=>'id="' ||
1881: wf_core.translate('PROTOCOL') || '"');
1882: htp.tableHeader(cvalue=>''||
1877: htp.tableHeader(cvalue=>''||
1878: wf_core.translate('PROTOCOL')||'',
1879: calign=>'Center',
1880: cattributes=>'id="' ||
1881: wf_core.translate('PROTOCOL') || '"');
1882: htp.tableHeader(cvalue=>''||
1883: wf_core.translate('QUEUE_NUMBER')||'',
1884: calign=>'Center',
1885: cattributes=>'id="' ||
1879: calign=>'Center',
1880: cattributes=>'id="' ||
1881: wf_core.translate('PROTOCOL') || '"');
1882: htp.tableHeader(cvalue=>''||
1883: wf_core.translate('QUEUE_NUMBER')||'',
1884: calign=>'Center',
1885: cattributes=>'id="' ||
1886: wf_core.translate('QUEUE_NUMBER') || '"');
1887: htp.tableHeader(cvalue=>''||
1882: htp.tableHeader(cvalue=>''||
1883: wf_core.translate('QUEUE_NUMBER')||'',
1884: calign=>'Center',
1885: cattributes=>'id="' ||
1886: wf_core.translate('QUEUE_NUMBER') || '"');
1887: htp.tableHeader(cvalue=>''||
1888: wf_core.translate('QUEUE_NAME')||'',
1889: calign=>'Center',
1890: cattributes=>'id="' ||
1884: calign=>'Center',
1885: cattributes=>'id="' ||
1886: wf_core.translate('QUEUE_NUMBER') || '"');
1887: htp.tableHeader(cvalue=>''||
1888: wf_core.translate('QUEUE_NAME')||'',
1889: calign=>'Center',
1890: cattributes=>'id="' ||
1891: wf_core.translate('QUEUE_NAME') || '"');
1892: htp.tableHeader(cvalue=>''||
1887: htp.tableHeader(cvalue=>''||
1888: wf_core.translate('QUEUE_NAME')||'',
1889: calign=>'Center',
1890: cattributes=>'id="' ||
1891: wf_core.translate('QUEUE_NAME') || '"');
1892: htp.tableHeader(cvalue=>''||
1893: wf_core.translate('QUEUE_COUNT')||'',
1894: calign=>'Center',
1895: cattributes=>'id="' ||
1889: calign=>'Center',
1890: cattributes=>'id="' ||
1891: wf_core.translate('QUEUE_NAME') || '"');
1892: htp.tableHeader(cvalue=>''||
1893: wf_core.translate('QUEUE_COUNT')||'',
1894: calign=>'Center',
1895: cattributes=>'id="' ||
1896: wf_core.translate('QUEUE_COUNT') || '"');
1897: htp.tableHeader(cvalue=>''||
1892: htp.tableHeader(cvalue=>''||
1893: wf_core.translate('QUEUE_COUNT')||'',
1894: calign=>'Center',
1895: cattributes=>'id="' ||
1896: wf_core.translate('QUEUE_COUNT') || '"');
1897: htp.tableHeader(cvalue=>''||
1898: wf_core.translate('VIEW_DETAIL')||'',
1899: calign=>'Center',
1900: cattributes=>'id="' ||
1894: calign=>'Center',
1895: cattributes=>'id="' ||
1896: wf_core.translate('QUEUE_COUNT') || '"');
1897: htp.tableHeader(cvalue=>''||
1898: wf_core.translate('VIEW_DETAIL')||'',
1899: calign=>'Center',
1900: cattributes=>'id="' ||
1901: wf_core.translate('VIEW_DETAIL') || '"');
1902:
1897: htp.tableHeader(cvalue=>''||
1898: wf_core.translate('VIEW_DETAIL')||'',
1899: calign=>'Center',
1900: cattributes=>'id="' ||
1901: wf_core.translate('VIEW_DETAIL') || '"');
1902:
1903: htp.tableRowClose;
1904: htp.tableRowOpen;
1905: htp.tableRowClose;
1909:
1910: htp.tableRowOpen(null, 'TOP');
1911:
1912: htp.tableData(p_protocol, 'left', cattributes=>'headers="' ||
1913: wf_core.translate('PROTOCOL') || '"');
1914:
1915: htp.tableData(to_char(ii), 'left', cattributes=>'headers="' ||
1916: wf_core.translate('QUEUE_NUMBER') || '"');
1917:
1912: htp.tableData(p_protocol, 'left', cattributes=>'headers="' ||
1913: wf_core.translate('PROTOCOL') || '"');
1914:
1915: htp.tableData(to_char(ii), 'left', cattributes=>'headers="' ||
1916: wf_core.translate('QUEUE_NUMBER') || '"');
1917:
1918: -- p_protocol and p_inbound_outbound were verified above
1919: -- ii must be a number
1920: -- BINDVAR_SCAN_IGNORE
1917:
1918: -- p_protocol and p_inbound_outbound were verified above
1919: -- ii must be a number
1920: -- BINDVAR_SCAN_IGNORE
1921: htp.tableData(wf_core.translate('WF_SCHEMA')||'.'||'WF_'||p_protocol||'_'||substr(p_inbound_outbound, 1, 1)||'_'||to_char(ii)||'_QUEUE', 'left', cattributes=>'headers="' || wf_core.translate('QUEUE_NAME') || '"');
1922:
1923: /*
1924: ** Check to see if there are any messages in the specified queue
1925: */
1927:
1928: execute immediate l_sql INTO l_count;
1929:
1930: htp.tableData(to_char(l_count), 'left', cattributes=>'headers="' ||
1931: wf_core.translate('QUEUE_COUNT') || '"');
1932:
1933: htp.tableData(htf.anchor2(curl=>wfa_html.base_url||
1934: '/wf_queue.generic_queue_display_contents?p_protocol='||
1935: p_protocol||'&p_inbound_outbound='||
1934: '/wf_queue.generic_queue_display_contents?p_protocol='||
1935: p_protocol||'&p_inbound_outbound='||
1936: p_inbound_outbound||'&p_queue_number='||
1937: to_char(ii)||'&p_message_number=1',
1938: ctext=>''),
1939: 'center', cattributes=>'valign="MIDDLE" headers="' || wf_core.translate('VIEW_DETAIL') || '"');
1940:
1941:
1942: end loop;
1935: p_protocol||'&p_inbound_outbound='||
1936: p_inbound_outbound||'&p_queue_number='||
1937: to_char(ii)||'&p_message_number=1',
1938: ctext=>''),
1939: 'center', cattributes=>'valign="MIDDLE" headers="' || wf_core.translate('VIEW_DETAIL') || '"');
1940:
1941:
1942: end loop;
1943:
1949: htp.htmlClose;
1950:
1951: exception
1952: when others then
1953: wf_core.context('FND_DOCUMENT_MANAGEMENT', 'Generic_Queue_View_Detail');
1954: raise;
1955: end Generic_Queue_View_Detail;
1956:
1957:
1969: admin_mode varchar2(1) := 'N';
1970: l_media varchar2(240) := wfa_html.image_loc;
1971: l_icon varchar2(40) := 'FNDILOV.gif';
1972: l_text varchar2(240) := '';
1973: l_onmouseover varchar2(240) := wf_core.translate ('WFPREF_LOV');
1974: l_url varchar2(4000);
1975: l_error_msg varchar2(240);
1976:
1977: l_more_data BOOLEAN := TRUE;
1990: -- Check current user has admin authority
1991: wfa_sec.GetSession(username);
1992: username := upper(username);
1993:
1994: admin_role := wf_core.translate('WF_ADMIN_ROLE');
1995: if (admin_role = '*' or
1996: Wf_Directory.IsPerformer(username, admin_role)) then
1997: admin_mode := 'Y';
1998: else
1996: Wf_Directory.IsPerformer(username, admin_role)) then
1997: admin_mode := 'Y';
1998: else
1999:
2000: l_error_msg := wf_core.translate('WFPREF_INVALID_ADMIN');
2001:
2002: end if;
2003:
2004: -- Set page title
2003:
2004: -- Set page title
2005: htp.htmlOpen;
2006: htp.headOpen;
2007: htp.title(wf_core.translate('WFQUEUE_EDIT_QUEUE_TITLE'));
2008: wfa_html.create_help_function('wf/links/dmr.htm?DMREP');
2009:
2010: wf_lov.OpenLovWinHtml;
2011:
2011:
2012: htp.headClose;
2013:
2014: -- Page header
2015: wfa_sec.Header(FALSE, '', wf_core.translate('WFQUEUE_EDIT_QUEUE_TITLE'), TRUE);
2016:
2017: IF (admin_mode = 'N') THEN
2018:
2019: htp.center(htf.bold(l_error_msg));
2031: dequeue_options.dequeue_mode := dbms_aq.BROWSE;
2032: dequeue_options.wait := dbms_aq.NO_WAIT;
2033: dequeue_options.navigation := dbms_aq.FIRST_MESSAGE;
2034:
2035: l_queue_name := wf_core.translate('WF_SCHEMA')||'.'||'WF_'||p_protocol||'_'||substr(p_inbound_outbound, 1, 1)||'_'||
2036: to_char(p_queue_number)||'_QUEUE';
2037:
2038: dbms_aq.dequeue
2039: (queue_name => l_queue_name,
2117: '&p_queue_number='||to_char(p_queue_number)||
2118: '&p_message_number='||to_char(p_message_number + 1);
2119:
2120: l_icon := 'FNDJLFOK.gif';
2121: l_text := wf_core.translate ('NEXT');
2122: l_onmouseover := wf_core.translate ('NEXT');
2123:
2124: htp.p('
2118: '&p_message_number='||to_char(p_message_number + 1);
2119:
2120: l_icon := 'FNDJLFOK.gif';
2121: l_text := wf_core.translate ('NEXT');
2122: l_onmouseover := wf_core.translate ('NEXT');
2123:
2124: htp.p('
2136: '&p_queue_number='||to_char(p_queue_number)||
2137: '&p_message_number='||to_char(p_message_number - 1);
2138:
2139: l_icon := 'FNDJLFCN.gif';
2140: l_text := wf_core.translate ('PREVIOUS');
2141: l_onmouseover := wf_core.translate ('PREVIOUS');
2142:
2143: htp.p('
2137: '&p_message_number='||to_char(p_message_number - 1);
2138:
2139: l_icon := 'FNDJLFCN.gif';
2140: l_text := wf_core.translate ('PREVIOUS');
2141: l_onmouseover := wf_core.translate ('PREVIOUS');
2142:
2143: htp.p('
2157: htp.htmlClose;
2158:
2159: exception
2160: when others then
2161: Wf_Core.Context('Wf_Queue', 'generic_queue_display_contents',
2162: p_protocol, p_inbound_outbound);
2163: raise;
2164:
2165: end generic_queue_display_contents;
2183: l_queue_count NUMBER;
2184: l_media varchar2(240) := wfa_html.image_loc;
2185: l_icon varchar2(40) := 'FNDILOV.gif';
2186: l_text varchar2(240) := '';
2187: l_onmouseover varchar2(240) := wf_core.translate ('WFPREF_LOV');
2188: l_url varchar2(4000);
2189: l_error_msg varchar2(240);
2190:
2191: BEGIN
2193: -- Check current user has admin authority
2194: wfa_sec.GetSession(username);
2195: username := upper(username);
2196:
2197: admin_role := wf_core.translate('WF_ADMIN_ROLE');
2198: if (admin_role = '*' or
2199: Wf_Directory.IsPerformer(username, admin_role)) then
2200: admin_mode := 'Y';
2201: else
2199: Wf_Directory.IsPerformer(username, admin_role)) then
2200: admin_mode := 'Y';
2201: else
2202:
2203: l_error_msg := wf_core.translate('WFPREF_INVALID_ADMIN');
2204:
2205: end if;
2206:
2207: /*
2221:
2222: -- Set page title
2223: htp.htmlOpen;
2224: htp.headOpen;
2225: htp.title(wf_core.translate('WFQUEUE_EDIT_QUEUE_TITLE'));
2226: wfa_html.create_help_function('wf/links/dmr.htm?DMREP');
2227:
2228: wf_lov.OpenLovWinHtml;
2229:
2229:
2230: htp.headClose;
2231:
2232: -- Page header
2233: wfa_sec.Header(FALSE, '', wf_core.translate('WFQUEUE_EDIT_QUEUE_TITLE'), TRUE);
2234:
2235: IF (admin_mode = 'N') THEN
2236:
2237: htp.center(htf.bold(l_error_msg));
2238: return;
2239:
2240: END IF;
2241:
2242: htp.tableopen(calign=>'CENTER',cattributes=>'summary="' || wf_core.translate('WFQUEUE_EDIT_QUEUE_TITLE') || '"');
2243:
2244: htp.p('