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:
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;
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:
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:
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);
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;
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,
1176: if correlation is not null then
1177: lcorrelation := correlation;
1178:
1179: -- for standalone, we first try the old correlation id format.
1180: elsif (wf_core.translate('WF_INSTALL') = 'STANDALONE'
1181: and itemtype is not null) then
1182: lcorrelation := itemtype;
1183:
1184: -- for embedded, there was never the old format, so we are fine.
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;
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;
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:
1386:
1387: /*
1388: ** Update the event to let everyone know it expired
1389: */
1390: l_event.SetErrorMessage(wf_core.translate('WFE_MESSAGE_EXPIRED'));
1391: l_event.addParameterToList('ERROR_NAME',
1392: wf_core.translate('WFE_MESSAGE_EXPIRED') );
1393: l_event.addParameterToList('ERROR_TYPE', 'ERROR');
1394:
1388: ** Update the event to let everyone know it expired
1389: */
1390: l_event.SetErrorMessage(wf_core.translate('WFE_MESSAGE_EXPIRED'));
1391: l_event.addParameterToList('ERROR_NAME',
1392: wf_core.translate('WFE_MESSAGE_EXPIRED') );
1393: l_event.addParameterToList('ERROR_TYPE', 'ERROR');
1394:
1395: /*
1396: ** As we can't use the private API SaveErrorToQueue
1397: ** we copy a little bit of code to do it
1398: */
1399: select name into lsysname
1400: from wf_systems
1401: where guid = hextoraw(wf_core.translate('WF_SYSTEM_GUID'));
1402:
1403: erragt := wf_agent_t('WF_ERROR', lsysname);
1404: cmd := 'begin WF_ERROR_QH.enqueue(:v1, :v2); end;';
1405: execute immediate cmd using in l_event,
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
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:
1465:
1466:
1467: exception
1468: when others then
1469: Wf_Core.Context('Wf_Queue', 'WriteMsg');
1470: raise;
1471:
1472: end WriteMsg;
1473:
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:
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:
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:
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:
1645: wfa_sec.GetSession(username);
1646: username := upper(username);
1647: wf_directory.GetRoleInfo(username, realname, s0, s0, s0, s0);
1648:
1649: admin_role := wf_core.translate('WF_ADMIN_ROLE');
1650: if (admin_role = '*' or
1651: Wf_Directory.IsPerformer(username, admin_role)) then
1652: admin_mode := 'Y';
1653: else
1651: Wf_Directory.IsPerformer(username, admin_role)) then
1652: admin_mode := 'Y';
1653: else
1654:
1655: l_error_msg := wf_core.translate('WFPREF_INVALID_ADMIN');
1656:
1657: end if;
1658:
1659: -- Set page title
1659: -- Set page title
1660: htp.htmlOpen;
1661: htp.headOpen;
1662: htp.p('
1663: htp.title(wf_core.translate('WFGENERIC_QUEUE_TITLE'));
1664: wfa_html.create_help_function('wf/links/dmr.htm?DMREP');
1665: htp.headClose;
1666: wfa_sec.Header(FALSE, '',wf_core.translate('WFGENERIC_QUEUE_TITLE'), FALSE);
1667: htp.br;
1662: htp.p('
1663: htp.title(wf_core.translate('WFGENERIC_QUEUE_TITLE'));
1664: wfa_html.create_help_function('wf/links/dmr.htm?DMREP');
1665: htp.headClose;
1666: wfa_sec.Header(FALSE, '',wf_core.translate('WFGENERIC_QUEUE_TITLE'), FALSE);
1667: htp.br;
1668:
1669: IF (admin_mode = 'N') THEN
1670:
1678: htp.tableRowOpen(cattributes=>'bgcolor=#006699');
1679:
1680:
1681: htp.tableHeader(cvalue=>''||
1682: wf_core.translate('PROTOCOL')||'',
1683: calign=>'Center',
1684: cattributes=>'id="' || wf_core.translate('PROTOCOL') || '"');
1685: htp.tableHeader(cvalue=>''||
1686: wf_core.translate('QUEUE_DESCRIPTION')||'',
1680:
1681: htp.tableHeader(cvalue=>''||
1682: wf_core.translate('PROTOCOL')||'',
1683: calign=>'Center',
1684: cattributes=>'id="' || wf_core.translate('PROTOCOL') || '"');
1685: htp.tableHeader(cvalue=>''||
1686: wf_core.translate('QUEUE_DESCRIPTION')||'',
1687: calign=>'Center',
1688: cattributes=>'id="' || wf_core.translate('QUEUE_DESCRIPTION') || '"');
1682: wf_core.translate('PROTOCOL')||'',
1683: calign=>'Center',
1684: cattributes=>'id="' || wf_core.translate('PROTOCOL') || '"');
1685: htp.tableHeader(cvalue=>''||
1686: wf_core.translate('QUEUE_DESCRIPTION')||'',
1687: calign=>'Center',
1688: cattributes=>'id="' || wf_core.translate('QUEUE_DESCRIPTION') || '"');
1689: htp.tableHeader(cvalue=>''||
1690: wf_core.translate('INBOUND_PROMPT')||'',
1684: cattributes=>'id="' || wf_core.translate('PROTOCOL') || '"');
1685: htp.tableHeader(cvalue=>''||
1686: wf_core.translate('QUEUE_DESCRIPTION')||'',
1687: calign=>'Center',
1688: cattributes=>'id="' || wf_core.translate('QUEUE_DESCRIPTION') || '"');
1689: htp.tableHeader(cvalue=>''||
1690: wf_core.translate('INBOUND_PROMPT')||'',
1691: calign=>'Center',
1692: cattributes=>'id="' || wf_core.translate('INBOUND_PROMPT') || '"');
1686: wf_core.translate('QUEUE_DESCRIPTION')||'',
1687: calign=>'Center',
1688: cattributes=>'id="' || wf_core.translate('QUEUE_DESCRIPTION') || '"');
1689: htp.tableHeader(cvalue=>''||
1690: wf_core.translate('INBOUND_PROMPT')||'',
1691: calign=>'Center',
1692: cattributes=>'id="' || wf_core.translate('INBOUND_PROMPT') || '"');
1693: htp.tableHeader(cvalue=>''||
1694: wf_core.translate('QUEUE_COUNT')||'',
1688: cattributes=>'id="' || wf_core.translate('QUEUE_DESCRIPTION') || '"');
1689: htp.tableHeader(cvalue=>''||
1690: wf_core.translate('INBOUND_PROMPT')||'',
1691: calign=>'Center',
1692: cattributes=>'id="' || wf_core.translate('INBOUND_PROMPT') || '"');
1693: htp.tableHeader(cvalue=>''||
1694: wf_core.translate('QUEUE_COUNT')||'',
1695: calign=>'Center',
1696: cattributes=>'id="' || wf_core.translate('QUEUE_COUNT') || '"');
1690: wf_core.translate('INBOUND_PROMPT')||'',
1691: calign=>'Center',
1692: cattributes=>'id="' || wf_core.translate('INBOUND_PROMPT') || '"');
1693: htp.tableHeader(cvalue=>''||
1694: wf_core.translate('QUEUE_COUNT')||'',
1695: calign=>'Center',
1696: cattributes=>'id="' || wf_core.translate('QUEUE_COUNT') || '"');
1697: htp.tableHeader(cvalue=>''||
1698: wf_core.translate('VIEW_DETAIL')||'',
1692: cattributes=>'id="' || wf_core.translate('INBOUND_PROMPT') || '"');
1693: htp.tableHeader(cvalue=>''||
1694: wf_core.translate('QUEUE_COUNT')||'',
1695: calign=>'Center',
1696: cattributes=>'id="' || wf_core.translate('QUEUE_COUNT') || '"');
1697: htp.tableHeader(cvalue=>''||
1698: wf_core.translate('VIEW_DETAIL')||'',
1699: calign=>'Center',
1700: cattributes=>'id="' || wf_core.translate('VIEW_DETAIL') || '"');
1694: wf_core.translate('QUEUE_COUNT')||'',
1695: calign=>'Center',
1696: cattributes=>'id="' || wf_core.translate('QUEUE_COUNT') || '"');
1697: htp.tableHeader(cvalue=>''||
1698: wf_core.translate('VIEW_DETAIL')||'',
1699: calign=>'Center',
1700: cattributes=>'id="' || wf_core.translate('VIEW_DETAIL') || '"');
1701: htp.tableHeader(cvalue=>''||
1702: wf_core.translate('DELETE')||'',
1696: cattributes=>'id="' || wf_core.translate('QUEUE_COUNT') || '"');
1697: htp.tableHeader(cvalue=>''||
1698: wf_core.translate('VIEW_DETAIL')||'',
1699: calign=>'Center',
1700: cattributes=>'id="' || wf_core.translate('VIEW_DETAIL') || '"');
1701: htp.tableHeader(cvalue=>''||
1702: wf_core.translate('DELETE')||'',
1703: calign=>'Center',
1704: cattributes=>'id="' || wf_core.translate('DELETE') || '"');
1698: wf_core.translate('VIEW_DETAIL')||'',
1699: calign=>'Center',
1700: cattributes=>'id="' || wf_core.translate('VIEW_DETAIL') || '"');
1701: htp.tableHeader(cvalue=>''||
1702: wf_core.translate('DELETE')||'',
1703: calign=>'Center',
1704: cattributes=>'id="' || wf_core.translate('DELETE') || '"');
1705:
1706: htp.tableRowClose;
1700: cattributes=>'id="' || wf_core.translate('VIEW_DETAIL') || '"');
1701: htp.tableHeader(cvalue=>''||
1702: wf_core.translate('DELETE')||'',
1703: calign=>'Center',
1704: cattributes=>'id="' || wf_core.translate('DELETE') || '"');
1705:
1706: htp.tableRowClose;
1707: htp.tableRowOpen;
1708: htp.tableRowClose;
1720: queues.inbound_outbound,
1721: ctext=>queues.protocol, ctarget=>'_top'),
1722: 'Left',
1723: cattributes=>'headers="' ||
1724: wf_core.translate('PROTOCOL') || '"');
1725:
1726: htp.tableData(queues.description, 'left',
1727: cattributes=>'headers="' || wf_core.translate('QUEUE_DESCRIPTION') || '"');
1728:
1723: cattributes=>'headers="' ||
1724: wf_core.translate('PROTOCOL') || '"');
1725:
1726: htp.tableData(queues.description, 'left',
1727: cattributes=>'headers="' || wf_core.translate('QUEUE_DESCRIPTION') || '"');
1728:
1729: htp.tableData(queues.inbound_outbound, 'left',
1730: cattributes=>'headers="' || wf_core.translate('INBOUND_PROMPT') || '"');
1731:
1726: htp.tableData(queues.description, 'left',
1727: cattributes=>'headers="' || wf_core.translate('QUEUE_DESCRIPTION') || '"');
1728:
1729: htp.tableData(queues.inbound_outbound, 'left',
1730: cattributes=>'headers="' || wf_core.translate('INBOUND_PROMPT') || '"');
1731:
1732: htp.tableData(queues.queue_count, 'left',
1733: cattributes=>'headers="' || wf_core.translate('QUEUE_COUNT') || '"');
1734:
1729: htp.tableData(queues.inbound_outbound, 'left',
1730: cattributes=>'headers="' || wf_core.translate('INBOUND_PROMPT') || '"');
1731:
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='||
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=>''),
1740: 'center', cattributes=>'valign="MIDDLE"
1741: headers="' || wf_core.translate('VIEW_DETAIL') || '"');
1742:
1743: htp.tableData(htf.anchor2(curl=>wfa_html.base_url||
1737: queues.protocol||'&p_inbound_outbound='||
1738: queues.inbound_outbound,
1739: ctext=>''),
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='||
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=>''),
1748: 'center', cattributes=>'valign="MIDDLE"
1749: headers="' || wf_core.translate('DELETE') || '"');
1750:
1751:
1745: queues.protocol||'&p_inbound_outbound='||
1746: queues.inbound_outbound,
1747: ctext=>''),
1748: 'center', cattributes=>'valign="MIDDLE"
1749: headers="' || wf_core.translate('DELETE') || '"');
1750:
1751:
1752: end loop;
1753:
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:
1768: htp.p('
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:
1768: htp.p('
1779: htp.htmlClose;
1780:
1781: exception
1782: when others then
1783: wf_core.context('FND_DOCUMENT_MANAGEMENT', 'Generic_Queue_Display');
1784: raise;
1785: end Generic_Queue_Display;
1786:
1787: --
1816: wfa_sec.GetSession(username);
1817: username := upper(username);
1818: wf_directory.GetRoleInfo(username, realname, s0, s0, s0, s0);
1819:
1820: admin_role := wf_core.translate('WF_ADMIN_ROLE');
1821: if (admin_role = '*' or
1822: Wf_Directory.IsPerformer(username, admin_role)) then
1823: admin_mode := 'Y';
1824: else
1822: Wf_Directory.IsPerformer(username, admin_role)) then
1823: admin_mode := 'Y';
1824: else
1825:
1826: l_error_msg := wf_core.translate('WFPREF_INVALID_ADMIN');
1827:
1828: end if;
1829:
1830: -- Set page title
1830: -- Set page title
1831: htp.htmlOpen;
1832: htp.headOpen;
1833: htp.p('
1834: htp.title(wf_core.translate('WFGENERIC_QUEUE_TITLE'));
1835: wfa_html.create_help_function('wf/links/dmr.htm?DMREP');
1836: htp.headClose;
1837: wfa_sec.Header(FALSE, '',wf_core.translate('WFGENERIC_QUEUE_TITLE'), FALSE);
1838: htp.br;
1833: htp.p('
1834: htp.title(wf_core.translate('WFGENERIC_QUEUE_TITLE'));
1835: wfa_html.create_help_function('wf/links/dmr.htm?DMREP');
1836: htp.headClose;
1837: wfa_sec.Header(FALSE, '',wf_core.translate('WFGENERIC_QUEUE_TITLE'), FALSE);
1838: htp.br;
1839:
1840: IF (admin_mode = 'N') THEN
1841:
1854: htp.tableOpen(cattributes=>'border=1 cellpadding=3 bgcolor=white width="100%" summary=""');
1855: htp.tableRowOpen(cattributes=>'bgcolor=#006699');
1856:
1857: htp.tableHeader(cvalue=>''||
1858: wf_core.translate('PROTOCOL')||'',
1859: calign=>'Center',
1860: cattributes=>'id="' ||
1861: wf_core.translate('PROTOCOL') || '"');
1862: htp.tableHeader(cvalue=>''||
1857: htp.tableHeader(cvalue=>''||
1858: wf_core.translate('PROTOCOL')||'',
1859: calign=>'Center',
1860: cattributes=>'id="' ||
1861: wf_core.translate('PROTOCOL') || '"');
1862: htp.tableHeader(cvalue=>''||
1863: wf_core.translate('QUEUE_NUMBER')||'',
1864: calign=>'Center',
1865: cattributes=>'id="' ||
1859: calign=>'Center',
1860: cattributes=>'id="' ||
1861: wf_core.translate('PROTOCOL') || '"');
1862: htp.tableHeader(cvalue=>''||
1863: wf_core.translate('QUEUE_NUMBER')||'',
1864: calign=>'Center',
1865: cattributes=>'id="' ||
1866: wf_core.translate('QUEUE_NUMBER') || '"');
1867: htp.tableHeader(cvalue=>''||
1862: htp.tableHeader(cvalue=>''||
1863: wf_core.translate('QUEUE_NUMBER')||'',
1864: calign=>'Center',
1865: cattributes=>'id="' ||
1866: wf_core.translate('QUEUE_NUMBER') || '"');
1867: htp.tableHeader(cvalue=>''||
1868: wf_core.translate('QUEUE_NAME')||'',
1869: calign=>'Center',
1870: cattributes=>'id="' ||
1864: calign=>'Center',
1865: cattributes=>'id="' ||
1866: wf_core.translate('QUEUE_NUMBER') || '"');
1867: htp.tableHeader(cvalue=>''||
1868: wf_core.translate('QUEUE_NAME')||'',
1869: calign=>'Center',
1870: cattributes=>'id="' ||
1871: wf_core.translate('QUEUE_NAME') || '"');
1872: htp.tableHeader(cvalue=>''||
1867: htp.tableHeader(cvalue=>''||
1868: wf_core.translate('QUEUE_NAME')||'',
1869: calign=>'Center',
1870: cattributes=>'id="' ||
1871: wf_core.translate('QUEUE_NAME') || '"');
1872: htp.tableHeader(cvalue=>''||
1873: wf_core.translate('QUEUE_COUNT')||'',
1874: calign=>'Center',
1875: cattributes=>'id="' ||
1869: calign=>'Center',
1870: cattributes=>'id="' ||
1871: wf_core.translate('QUEUE_NAME') || '"');
1872: htp.tableHeader(cvalue=>''||
1873: wf_core.translate('QUEUE_COUNT')||'',
1874: calign=>'Center',
1875: cattributes=>'id="' ||
1876: wf_core.translate('QUEUE_COUNT') || '"');
1877: htp.tableHeader(cvalue=>''||
1872: htp.tableHeader(cvalue=>''||
1873: wf_core.translate('QUEUE_COUNT')||'',
1874: calign=>'Center',
1875: cattributes=>'id="' ||
1876: wf_core.translate('QUEUE_COUNT') || '"');
1877: htp.tableHeader(cvalue=>''||
1878: wf_core.translate('VIEW_DETAIL')||'',
1879: calign=>'Center',
1880: cattributes=>'id="' ||
1874: calign=>'Center',
1875: cattributes=>'id="' ||
1876: wf_core.translate('QUEUE_COUNT') || '"');
1877: htp.tableHeader(cvalue=>''||
1878: wf_core.translate('VIEW_DETAIL')||'',
1879: calign=>'Center',
1880: cattributes=>'id="' ||
1881: wf_core.translate('VIEW_DETAIL') || '"');
1882:
1877: htp.tableHeader(cvalue=>''||
1878: wf_core.translate('VIEW_DETAIL')||'',
1879: calign=>'Center',
1880: cattributes=>'id="' ||
1881: wf_core.translate('VIEW_DETAIL') || '"');
1882:
1883: htp.tableRowClose;
1884: htp.tableRowOpen;
1885: htp.tableRowClose;
1889:
1890: htp.tableRowOpen(null, 'TOP');
1891:
1892: htp.tableData(p_protocol, 'left', cattributes=>'headers="' ||
1893: wf_core.translate('PROTOCOL') || '"');
1894:
1895: htp.tableData(to_char(ii), 'left', cattributes=>'headers="' ||
1896: wf_core.translate('QUEUE_NUMBER') || '"');
1897:
1892: htp.tableData(p_protocol, 'left', cattributes=>'headers="' ||
1893: wf_core.translate('PROTOCOL') || '"');
1894:
1895: htp.tableData(to_char(ii), 'left', cattributes=>'headers="' ||
1896: wf_core.translate('QUEUE_NUMBER') || '"');
1897:
1898: -- p_protocol and p_inbound_outbound were verified above
1899: -- ii must be a number
1900: -- BINDVAR_SCAN_IGNORE
1897:
1898: -- p_protocol and p_inbound_outbound were verified above
1899: -- ii must be a number
1900: -- BINDVAR_SCAN_IGNORE
1901: 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') || '"');
1902:
1903: /*
1904: ** Check to see if there are any messages in the specified queue
1905: */
1907:
1908: execute immediate l_sql INTO l_count;
1909:
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='||
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=>''),
1919: 'center', cattributes=>'valign="MIDDLE" headers="' || wf_core.translate('VIEW_DETAIL') || '"');
1920:
1921:
1922: end loop;
1915: p_protocol||'&p_inbound_outbound='||
1916: p_inbound_outbound||'&p_queue_number='||
1917: to_char(ii)||'&p_message_number=1',
1918: ctext=>''),
1919: 'center', cattributes=>'valign="MIDDLE" headers="' || wf_core.translate('VIEW_DETAIL') || '"');
1920:
1921:
1922: end loop;
1923:
1929: htp.htmlClose;
1930:
1931: exception
1932: when others then
1933: wf_core.context('FND_DOCUMENT_MANAGEMENT', 'Generic_Queue_View_Detail');
1934: raise;
1935: end Generic_Queue_View_Detail;
1936:
1937:
1949: admin_mode varchar2(1) := 'N';
1950: l_media varchar2(240) := wfa_html.image_loc;
1951: l_icon varchar2(40) := 'FNDILOV.gif';
1952: l_text varchar2(240) := '';
1953: l_onmouseover varchar2(240) := wf_core.translate ('WFPREF_LOV');
1954: l_url varchar2(4000);
1955: l_error_msg varchar2(240);
1956:
1957: l_more_data BOOLEAN := TRUE;
1970: -- Check current user has admin authority
1971: wfa_sec.GetSession(username);
1972: username := upper(username);
1973:
1974: admin_role := wf_core.translate('WF_ADMIN_ROLE');
1975: if (admin_role = '*' or
1976: Wf_Directory.IsPerformer(username, admin_role)) then
1977: admin_mode := 'Y';
1978: else
1976: Wf_Directory.IsPerformer(username, admin_role)) then
1977: admin_mode := 'Y';
1978: else
1979:
1980: l_error_msg := wf_core.translate('WFPREF_INVALID_ADMIN');
1981:
1982: end if;
1983:
1984: -- Set page title
1983:
1984: -- Set page title
1985: htp.htmlOpen;
1986: htp.headOpen;
1987: htp.title(wf_core.translate('WFQUEUE_EDIT_QUEUE_TITLE'));
1988: wfa_html.create_help_function('wf/links/dmr.htm?DMREP');
1989:
1990: wf_lov.OpenLovWinHtml;
1991:
1991:
1992: htp.headClose;
1993:
1994: -- Page header
1995: wfa_sec.Header(FALSE, '', wf_core.translate('WFQUEUE_EDIT_QUEUE_TITLE'), TRUE);
1996:
1997: IF (admin_mode = 'N') THEN
1998:
1999: htp.center(htf.bold(l_error_msg));
2011: dequeue_options.dequeue_mode := dbms_aq.BROWSE;
2012: dequeue_options.wait := dbms_aq.NO_WAIT;
2013: dequeue_options.navigation := dbms_aq.FIRST_MESSAGE;
2014:
2015: l_queue_name := wf_core.translate('WF_SCHEMA')||'.'||'WF_'||p_protocol||'_'||substr(p_inbound_outbound, 1, 1)||'_'||
2016: to_char(p_queue_number)||'_QUEUE';
2017:
2018: dbms_aq.dequeue
2019: (queue_name => l_queue_name,
2097: '&p_queue_number='||to_char(p_queue_number)||
2098: '&p_message_number='||to_char(p_message_number + 1);
2099:
2100: l_icon := 'FNDJLFOK.gif';
2101: l_text := wf_core.translate ('NEXT');
2102: l_onmouseover := wf_core.translate ('NEXT');
2103:
2104: htp.p('
2098: '&p_message_number='||to_char(p_message_number + 1);
2099:
2100: l_icon := 'FNDJLFOK.gif';
2101: l_text := wf_core.translate ('NEXT');
2102: l_onmouseover := wf_core.translate ('NEXT');
2103:
2104: htp.p('
2116: '&p_queue_number='||to_char(p_queue_number)||
2117: '&p_message_number='||to_char(p_message_number - 1);
2118:
2119: l_icon := 'FNDJLFCN.gif';
2120: l_text := wf_core.translate ('PREVIOUS');
2121: l_onmouseover := wf_core.translate ('PREVIOUS');
2122:
2123: htp.p('
2117: '&p_message_number='||to_char(p_message_number - 1);
2118:
2119: l_icon := 'FNDJLFCN.gif';
2120: l_text := wf_core.translate ('PREVIOUS');
2121: l_onmouseover := wf_core.translate ('PREVIOUS');
2122:
2123: htp.p('
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;
2163: l_queue_count NUMBER;
2164: l_media varchar2(240) := wfa_html.image_loc;
2165: l_icon varchar2(40) := 'FNDILOV.gif';
2166: l_text varchar2(240) := '';
2167: l_onmouseover varchar2(240) := wf_core.translate ('WFPREF_LOV');
2168: l_url varchar2(4000);
2169: l_error_msg varchar2(240);
2170:
2171: BEGIN
2173: -- Check current user has admin authority
2174: wfa_sec.GetSession(username);
2175: username := upper(username);
2176:
2177: admin_role := wf_core.translate('WF_ADMIN_ROLE');
2178: if (admin_role = '*' or
2179: Wf_Directory.IsPerformer(username, admin_role)) then
2180: admin_mode := 'Y';
2181: else
2179: Wf_Directory.IsPerformer(username, admin_role)) then
2180: admin_mode := 'Y';
2181: else
2182:
2183: l_error_msg := wf_core.translate('WFPREF_INVALID_ADMIN');
2184:
2185: end if;
2186:
2187: /*
2201:
2202: -- Set page title
2203: htp.htmlOpen;
2204: htp.headOpen;
2205: htp.title(wf_core.translate('WFQUEUE_EDIT_QUEUE_TITLE'));
2206: wfa_html.create_help_function('wf/links/dmr.htm?DMREP');
2207:
2208: wf_lov.OpenLovWinHtml;
2209:
2209:
2210: htp.headClose;
2211:
2212: -- Page header
2213: wfa_sec.Header(FALSE, '', wf_core.translate('WFQUEUE_EDIT_QUEUE_TITLE'), TRUE);
2214:
2215: IF (admin_mode = 'N') THEN
2216:
2217: htp.center(htf.bold(l_error_msg));
2218: return;
2219:
2220: END IF;
2221:
2222: htp.tableopen(calign=>'CENTER',cattributes=>'summary="' || wf_core.translate('WFQUEUE_EDIT_QUEUE_TITLE') || '"');
2223:
2224: htp.p('