DBA Data[Home] [Help]

APPS.WF_ENGINE dependencies on WF_ENGINE

Line 1: package body WF_ENGINE as

1: package body WF_ENGINE as
2: /* $Header: wfengb.pls 120.25.12010000.3 2008/10/28 15:19:48 alepe ship $ */
3:
4: type InstanceArrayTyp is table of pls_integer
5: index by binary_integer;

Line 43: if (wf_engine.schema is null) then

39: function Current_Schema
40: return varchar2
41: is
42: begin
43: if (wf_engine.schema is null) then
44: select sys_context('USERENV','CURRENT_SCHEMA')
45: into wf_engine.schema
46: from sys.dual;
47: end if;

Line 45: into wf_engine.schema

41: is
42: begin
43: if (wf_engine.schema is null) then
44: select sys_context('USERENV','CURRENT_SCHEMA')
45: into wf_engine.schema
46: from sys.dual;
47: end if;
48: return wf_engine.schema;
49: exception

Line 48: return wf_engine.schema;

44: select sys_context('USERENV','CURRENT_SCHEMA')
45: into wf_engine.schema
46: from sys.dual;
47: end if;
48: return wf_engine.schema;
49: exception
50: when OTHERS then
51: Wf_Core.Context('Wf_Engine', 'Current_Schema');
52: raise;

Line 51: Wf_Core.Context('Wf_Engine', 'Current_Schema');

47: end if;
48: return wf_engine.schema;
49: exception
50: when OTHERS then
51: Wf_Core.Context('Wf_Engine', 'Current_Schema');
52: raise;
53: end Current_Schema;
54:
55: --

Line 98: if (itemkey = wf_engine.eng_synch) then

94: Wf_Core.Raise('WFENG_ITEM');
95:
96: end if;
97:
98: if (itemkey = wf_engine.eng_synch) then
99: --ItemAttrValues are indexed on the hash value of the name.
100: --ItemKey is not used here because we are in #SYNCH mode.
101: WF_CACHE.GetItemAttrValue(itemtype, itemKey, aname, iStatus, wiavIND);
102:

Line 130: Wf_Core.Context('Wf_Engine', 'AddItemAttr', itemtype, itemkey, aname);

126: end if;
127:
128: exception
129: when dup_val_on_index then
130: Wf_Core.Context('Wf_Engine', 'AddItemAttr', itemtype, itemkey, aname);
131: Wf_Core.Token('TYPE', itemtype);
132: Wf_Core.Token('KEY', itemkey);
133: Wf_Core.Token('ATTRIBUTE', aname);
134: Wf_Core.Raise('WFENG_ITEM_ATTR_UNIQUE');

Line 136: Wf_Core.Context('Wf_Engine', 'AddItemAttr', itemtype, itemkey, aname);

132: Wf_Core.Token('KEY', itemkey);
133: Wf_Core.Token('ATTRIBUTE', aname);
134: Wf_Core.Raise('WFENG_ITEM_ATTR_UNIQUE');
135: when others then
136: Wf_Core.Context('Wf_Engine', 'AddItemAttr', itemtype, itemkey, aname);
137: raise;
138: end AddItemAttr;
139:
140: --

Line 155: aname in Wf_Engine.NameTabTyp,

151: --
152: procedure AddItemAttrTextArray(
153: itemtype in varchar2,
154: itemkey in varchar2,
155: aname in Wf_Engine.NameTabTyp,
156: avalue in Wf_Engine.TextTabTyp)
157: is
158: iStatus pls_integer;
159: wiavIND pls_integer;

Line 156: avalue in Wf_Engine.TextTabTyp)

152: procedure AddItemAttrTextArray(
153: itemtype in varchar2,
154: itemkey in varchar2,
155: aname in Wf_Engine.NameTabTyp,
156: avalue in Wf_Engine.TextTabTyp)
157: is
158: iStatus pls_integer;
159: wiavIND pls_integer;
160: arrayIndex pls_integer;

Line 194: if (itemkey = wf_engine.eng_synch) then

190:
191: -- Check to see if we are in synch mode and use WF_CACHE.
192:
193: success_cnt := 0;
194: if (itemkey = wf_engine.eng_synch) then
195: -- Use WF_CACHE.ItemAttrValues for #SYNCH mode.
196: for arrayIndex in aname.FIRST..aname.LAST loop
197: -- first check duplicate attribute name
198: WF_CACHE.GetItemAttrValue( itemType, itemKey, aname(arrayIndex), iStatus,

Line 238: Wf_Core.Context('Wf_Engine', 'AddItemAttrTextArray', itemtype, itemkey);

234: end if;
235:
236: exception
237: when dup_val_on_index then
238: Wf_Core.Context('Wf_Engine', 'AddItemAttrTextArray', itemtype, itemkey);
239: Wf_Core.Token('TYPE', itemtype);
240: Wf_Core.Token('KEY', itemkey);
241: Wf_Core.Token('TOTAL', to_char(aname.COUNT));
242: Wf_Core.Token('SUCCESS', to_char(success_cnt));

Line 245: Wf_Core.Context('Wf_Engine', 'AddItemAttrTextArray', itemtype, itemkey);

241: Wf_Core.Token('TOTAL', to_char(aname.COUNT));
242: Wf_Core.Token('SUCCESS', to_char(success_cnt));
243: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
244: when others then
245: Wf_Core.Context('Wf_Engine', 'AddItemAttrTextArray', itemtype, itemkey);
246: raise;
247: end AddItemAttrTextArray;
248:
249: --

Line 264: aname in Wf_Engine.NameTabTyp,

260: --
261: procedure AddItemAttrNumberArray(
262: itemtype in varchar2,
263: itemkey in varchar2,
264: aname in Wf_Engine.NameTabTyp,
265: avalue in Wf_Engine.NumTabTyp)
266: is
267: arrayIndex pls_integer;
268: iStatus pls_integer;

Line 265: avalue in Wf_Engine.NumTabTyp)

261: procedure AddItemAttrNumberArray(
262: itemtype in varchar2,
263: itemkey in varchar2,
264: aname in Wf_Engine.NameTabTyp,
265: avalue in Wf_Engine.NumTabTyp)
266: is
267: arrayIndex pls_integer;
268: iStatus pls_integer;
269: wiavIND NUMBER;

Line 300: if (itemkey = wf_engine.eng_synch) then

296:
297: success_cnt := 0;
298: --If we are in #SYNCH mode, we will go ahead and use WF_CACHE to
299: --Store the attributes.
300: if (itemkey = wf_engine.eng_synch) then
301: for arrayIndex in aname.FIRST..aname.LAST loop
302: -- first check duplicate attribute name
303: WF_CACHE.GetItemAttrValue(itemtype, itemKey, aname(arrayIndex), iStatus,
304: wiavIND);

Line 339: Wf_Core.Context('Wf_Engine', 'AddItemAttrNumberArray', itemtype, itemkey);

335: end if;
336:
337: exception
338: when dup_val_on_index then
339: Wf_Core.Context('Wf_Engine', 'AddItemAttrNumberArray', itemtype, itemkey);
340: Wf_Core.Token('TYPE', itemtype);
341: Wf_Core.Token('KEY', itemkey);
342: Wf_Core.Token('TOTAL', to_char(aname.COUNT));
343: Wf_Core.Token('SUCCESS', to_char(success_cnt));

Line 346: Wf_Core.Context('Wf_Engine', 'AddItemAttrNumberArray', itemtype, itemkey);

342: Wf_Core.Token('TOTAL', to_char(aname.COUNT));
343: Wf_Core.Token('SUCCESS', to_char(success_cnt));
344: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
345: when others then
346: Wf_Core.Context('Wf_Engine', 'AddItemAttrNumberArray', itemtype, itemkey);
347: raise;
348: end AddItemAttrNumberArray;
349:
350: --

Line 365: aname in Wf_Engine.NameTabTyp,

361: --
362: procedure AddItemAttrDateArray(
363: itemtype in varchar2,
364: itemkey in varchar2,
365: aname in Wf_Engine.NameTabTyp,
366: avalue in Wf_Engine.DateTabTyp)
367: is
368: iStatus pls_integer;
369: wiavIND number;

Line 366: avalue in Wf_Engine.DateTabTyp)

362: procedure AddItemAttrDateArray(
363: itemtype in varchar2,
364: itemkey in varchar2,
365: aname in Wf_Engine.NameTabTyp,
366: avalue in Wf_Engine.DateTabTyp)
367: is
368: iStatus pls_integer;
369: wiavIND number;
370: success_cnt number;

Line 401: if (itemkey = wf_engine.eng_synch) then

397: end if;
398:
399: success_cnt := 0;
400: -- If in #SYNCH mode, we will use WF_CACHE to store the attributes.
401: if (itemkey = wf_engine.eng_synch) then
402: for arrayIndex in aname.FIRST..aname.LAST loop
403: WF_CACHE.GetItemAttrValue(itemtype, itemKey, aname(arrayIndex), iStatus,
404: wiavIND);
405:

Line 438: Wf_Core.Context('Wf_Engine', 'AddItemAttrDateArray', itemtype, itemkey);

434: end if;
435:
436: exception
437: when dup_val_on_index then
438: Wf_Core.Context('Wf_Engine', 'AddItemAttrDateArray', itemtype, itemkey);
439: Wf_Core.Token('TYPE', itemtype);
440: Wf_Core.Token('KEY', itemkey);
441: Wf_Core.Token('TOTAL', to_char(aname.COUNT));
442: Wf_Core.Token('SUCCESS', to_char(success_cnt));

Line 445: Wf_Core.Context('Wf_Engine', 'AddItemAttrDateArray', itemtype, itemkey);

441: Wf_Core.Token('TOTAL', to_char(aname.COUNT));
442: Wf_Core.Token('SUCCESS', to_char(success_cnt));
443: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
444: when others then
445: Wf_Core.Context('Wf_Engine', 'AddItemAttrDateArray', itemtype, itemkey);
446: raise;
447: end AddItemAttrDateArray;
448:
449: --

Line 524: Wf_Engine.SetItemAttrNumber(itemtype, itemkey, aname, nvalue);

520: nvalue := to_number(avalue);
521: else
522: nvalue := to_number(avalue, WF_CACHE.ItemAttributes(wiaIND).FORMAT);
523: end if;
524: Wf_Engine.SetItemAttrNumber(itemtype, itemkey, aname, nvalue);
525:
526: elsif (WF_CACHE.ItemAttributes(wiaIND).TYPE = 'DATE') then
527:
528: if (WF_CACHE.ItemAttributes(wiaIND).FORMAT is null) then

Line 533: Wf_Engine.SetItemAttrDate(itemtype, itemkey, aname, dvalue);

529: dvalue := to_date(avalue,SYS_CONTEXT('USERENV','NLS_DATE_FORMAT'));
530: else
531: dvalue := to_date(avalue, WF_CACHE.ItemAttributes(wiaIND).FORMAT);
532: end if;
533: Wf_Engine.SetItemAttrDate(itemtype, itemkey, aname, dvalue);
534:
535: else -- One of the text values
536:
537: if (WF_CACHE.ItemAttributes(wiaIND).TYPE = 'VARCHAR2') then

Line 578: if (itemkey = wf_engine.eng_synch) then

574: tvalue := avalue;
575: end if;
576:
577: -- Set the text value.
578: if (itemkey = wf_engine.eng_synch) then
579: -- Use WF_CACHE in synch mode
580: WF_CACHE.GetItemAttrValue(itemtype, itemKey, aname, status, wiavIND);
581:
582: if (status <> WF_CACHE.task_SUCCESS) then

Line 624: Wf_Core.Context('Wf_Engine', 'SetItemAttrText', itemtype, itemkey,

620: end if;
621:
622: exception
623: when no_data_found then
624: Wf_Core.Context('Wf_Engine', 'SetItemAttrText', itemtype, itemkey,
625: aname, avalue);
626: Wf_Core.Token('TYPE', itemtype);
627: Wf_Core.Token('KEY', itemkey);
628: Wf_Core.Token('ATTRIBUTE', aname);

Line 632: Wf_Core.Context('Wf_Engine', 'SetItemAttrText', itemtype, itemkey,

628: Wf_Core.Token('ATTRIBUTE', aname);
629: Wf_Core.Raise('WFENG_ITEM_ATTR');
630:
631: when bad_format then --
632: Wf_Core.Context('Wf_Engine', 'SetItemAttrText', itemtype, itemkey,
633: aname, avalue);
634: Wf_Core.Token('VALUE', avalue);
635: Wf_Core.Token('TYPE', WF_CACHE.ItemAttributes(wiaIND).TYPE);
636:

Line 648: Wf_Core.Context('Wf_Engine', 'SetItemAttrText', itemtype, itemkey,

644:
645: Wf_Core.Raise('WFENG_BAD_FORMAT');
646:
647: when others then
648: Wf_Core.Context('Wf_Engine', 'SetItemAttrText', itemtype, itemkey,
649: aname, avalue);
650: raise;
651: end SetItemAttrText;
652:

Line 686: if (p_itemkey = wf_engine.eng_synch) then

682: Wf_Core.Raise('WFSQL_ARGS');
683: end if;
684:
685: -- Set the text value.
686: if (p_itemkey = wf_engine.eng_synch) then
687: -- Use WF_CACHE in synch mode
688: WF_CACHE.GetItemAttrValue(p_itemtype, p_itemkey, p_aname, status, wiavIND);
689:
690: if (status <> WF_CACHE.task_SUCCESS) then

Line 739: Wf_Core.Context('Wf_Engine', 'SetItemAttrText2', p_itemtype, p_itemkey,

735: when no_data_found then
736: return FALSE;
737:
738: when others then
739: Wf_Core.Context('Wf_Engine', 'SetItemAttrText2', p_itemtype, p_itemkey,
740: p_aname, p_avalue);
741: raise;
742: end SetItemAttrText2;
743:

Line 803: Wf_Engine.SetItemAttrNumber(itemtype, itemkey, aname, nvalue);

799: nvalue := to_number(avalue, wf_core.canonical_number_mask);
800: else
801: nvalue := to_number(avalue, WF_CACHE.ItemAttributes(wiaIND).FORMAT);
802: end if;
803: Wf_Engine.SetItemAttrNumber(itemtype, itemkey, aname, nvalue);
804:
805: elsif (WF_CACHE.ItemAttributes(wiaIND).TYPE = 'DATE') then
806:
807: if (WF_CACHE.ItemAttributes(wiaIND).FORMAT is null) then

Line 812: Wf_Engine.SetItemAttrDate(itemtype, itemkey, aname, dvalue);

808: dvalue := to_date(avalue, wf_core.canonical_date_mask);
809: else
810: dvalue := to_date(avalue, WF_CACHE.ItemAttributes(wiaIND).FORMAT);
811: end if;
812: Wf_Engine.SetItemAttrDate(itemtype, itemkey, aname, dvalue);
813:
814: else -- One of the text values
815:
816: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname, avalue);

Line 816: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname, avalue);

812: Wf_Engine.SetItemAttrDate(itemtype, itemkey, aname, dvalue);
813:
814: else -- One of the text values
815:
816: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname, avalue);
817:
818: end if;
819:
820: exception

Line 822: Wf_Core.Context('Wf_Engine', 'SetEventItemAttr', itemtype, itemkey,

818: end if;
819:
820: exception
821: when no_data_found then
822: Wf_Core.Context('Wf_Engine', 'SetEventItemAttr', itemtype, itemkey,
823: aname, avalue);
824: Wf_Core.Token('TYPE', itemtype);
825: Wf_Core.Token('KEY', itemkey);
826: Wf_Core.Token('ATTRIBUTE', aname);

Line 830: Wf_Core.Context('Wf_Engine', 'SetEventItemAttr', itemtype, itemkey,

826: Wf_Core.Token('ATTRIBUTE', aname);
827: Wf_Core.Raise('WFENG_ITEM_ATTR');
828:
829: when others then
830: Wf_Core.Context('Wf_Engine', 'SetEventItemAttr', itemtype, itemkey,
831: aname, avalue);
832: raise;
833: end SetEventItemAttr;
834:

Line 864: if (itemkey = wf_engine.eng_synch) then

860: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
861: Wf_Core.Raise('WFSQL_ARGS');
862: end if;
863:
864: if (itemkey = wf_engine.eng_synch) then
865: WF_CACHE.GetItemAttrValue(itemtype, itemKey, aname, iStatus, wiavIND);
866:
867: if (iStatus <> WF_CACHE.task_SUCCESS) then
868: raise no_data_found;

Line 908: Wf_Core.Context('Wf_Engine', 'SetItemAttrNumber', itemtype, itemkey,

904: end if;
905:
906: exception
907: when no_data_found then
908: Wf_Core.Context('Wf_Engine', 'SetItemAttrNumber', itemtype, itemkey,
909: aname, to_char(avalue));
910: Wf_Core.Token('TYPE', itemtype);
911: Wf_Core.Token('KEY', itemkey);
912: Wf_Core.Token('ATTRIBUTE', aname);

Line 916: Wf_Core.Context('Wf_Engine', 'SetItemAttrNumber', itemtype, itemkey,

912: Wf_Core.Token('ATTRIBUTE', aname);
913: Wf_Core.Raise('WFENG_ITEM_ATTR');
914:
915: when others then
916: Wf_Core.Context('Wf_Engine', 'SetItemAttrNumber', itemtype, itemkey,
917: aname, to_char(avalue));
918: raise;
919: end SetItemAttrNumber;
920:

Line 951: if (itemkey = wf_engine.eng_synch) then

947: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
948: Wf_Core.Raise('WFSQL_ARGS');
949: end if;
950:
951: if (itemkey = wf_engine.eng_synch) then
952: WF_CACHE.GetItemAttrValue(itemtype, itemKey, aname, iStatus, wiavIND);
953:
954: if (iStatus <> WF_CACHE.task_SUCCESS) then
955: raise no_data_found;

Line 995: Wf_Core.Context('Wf_Engine', 'SetItemAttrDate', itemtype, itemkey,

991: end if;
992:
993: exception
994: when no_data_found then
995: Wf_Core.Context('Wf_Engine', 'SetItemAttrDate', itemtype, itemkey,
996: aname, to_char(avalue));
997: Wf_Core.Token('TYPE', itemtype);
998: Wf_Core.Token('KEY', itemkey);
999: Wf_Core.Token('ATTRIBUTE', aname);

Line 1003: Wf_Core.Context('Wf_Engine', 'SetItemAttr', itemtype, itemkey,

999: Wf_Core.Token('ATTRIBUTE', aname);
1000: Wf_Core.Raise('WFENG_ITEM_ATTR');
1001:
1002: when bad_format then --
1003: Wf_Core.Context('Wf_Engine', 'SetItemAttr', itemtype, itemkey,
1004: aname, avalue);
1005: Wf_Core.Token('VALUE', avalue);
1006: Wf_Core.Token('FORMAT', 'DATE');
1007: Wf_Core.Raise('WFENG_BAD_FORMAT');

Line 1010: Wf_Core.Context('Wf_Engine', 'SetItemAttrDate', itemtype, itemkey,

1006: Wf_Core.Token('FORMAT', 'DATE');
1007: Wf_Core.Raise('WFENG_BAD_FORMAT');
1008:
1009: when others then
1010: Wf_Core.Context('Wf_Engine', 'SetItemAttrDate', itemtype, itemkey,
1011: aname, to_char(avalue));
1012: raise;
1013: end SetItemAttrDate;
1014:

Line 1043: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname, documentid);

1039: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1040: Wf_Core.Raise('WFSQL_ARGS');
1041: end if;
1042:
1043: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname, documentid);
1044: exception
1045: when others then
1046: Wf_Core.Context('Wf_Engine', 'SetItemAttrDocument', itemtype, itemkey,
1047: aname);

Line 1046: Wf_Core.Context('Wf_Engine', 'SetItemAttrDocument', itemtype, itemkey,

1042:
1043: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname, documentid);
1044: exception
1045: when others then
1046: Wf_Core.Context('Wf_Engine', 'SetItemAttrDocument', itemtype, itemkey,
1047: aname);
1048: raise;
1049: end SetItemAttrDocument;
1050:

Line 1078: if (itemkey = wf_engine.eng_synch) then

1074: Wf_Core.Raise('WFSQL_ARGS');
1075: end if;
1076:
1077: -- Not allowed in synch mode
1078: if (itemkey = wf_engine.eng_synch) then
1079: wf_core.token('OPERATION', 'Wf_Engine.SetItemAttrEvent');
1080: wf_core.raise('WFENG_SYNCH_DISABLED');
1081: end if;
1082:

Line 1079: wf_core.token('OPERATION', 'Wf_Engine.SetItemAttrEvent');

1075: end if;
1076:
1077: -- Not allowed in synch mode
1078: if (itemkey = wf_engine.eng_synch) then
1079: wf_core.token('OPERATION', 'Wf_Engine.SetItemAttrEvent');
1080: wf_core.raise('WFENG_SYNCH_DISABLED');
1081: end if;
1082:
1083: update WF_ITEM_ATTRIBUTE_VALUES set

Line 1114: Wf_Core.Context('Wf_Engine', 'SetItemAttrEvent', itemtype, itemkey,

1110: end if;
1111: end if;
1112: exception
1113: when no_data_found then
1114: Wf_Core.Context('Wf_Engine', 'SetItemAttrEvent', itemtype, itemkey,
1115: name);
1116: Wf_Core.Token('TYPE', itemtype);
1117: Wf_Core.Token('KEY', itemkey);
1118: Wf_Core.Token('ATTRIBUTE', name);

Line 1121: Wf_Core.Context('Wf_Engine', 'SetItemAttrEvent', itemtype, itemkey,

1117: Wf_Core.Token('KEY', itemkey);
1118: Wf_Core.Token('ATTRIBUTE', name);
1119: Wf_Core.Raise('WFENG_ITEM_ATTR');
1120: when others then
1121: Wf_Core.Context('Wf_Engine', 'SetItemAttrEvent', itemtype, itemkey,
1122: name);
1123: raise;
1124: end SetItemAttrEvent;
1125:

Line 1139: aname in Wf_Engine.NameTabTyp,

1135: --
1136: procedure SetItemAttrTextArray(
1137: itemtype in varchar2,
1138: itemkey in varchar2,
1139: aname in Wf_Engine.NameTabTyp,
1140: avalue in Wf_Engine.TextTabTyp)
1141: is
1142: status pls_integer;
1143: arrayIndex pls_integer;

Line 1140: avalue in Wf_Engine.TextTabTyp)

1136: procedure SetItemAttrTextArray(
1137: itemtype in varchar2,
1138: itemkey in varchar2,
1139: aname in Wf_Engine.NameTabTyp,
1140: avalue in Wf_Engine.TextTabTyp)
1141: is
1142: status pls_integer;
1143: arrayIndex pls_integer;
1144: wiavIND number;

Line 1167: if (itemkey = wf_engine.eng_synch) then

1163: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY_MISMATCH');
1164: end if;
1165:
1166: -- Set the text value.
1167: if (itemkey = wf_engine.eng_synch) then
1168: -- Use WF_CACHE in synch mode
1169: success_cnt := 0;
1170:
1171: for arrayIndex in aname.FIRST..aname.LAST loop

Line 1225: Wf_Core.Context('Wf_Engine', 'SetItemAttrTextArray', itemtype, itemkey);

1221: end if;
1222:
1223: exception
1224: when no_data_found then
1225: Wf_Core.Context('Wf_Engine', 'SetItemAttrTextArray', itemtype, itemkey);
1226: Wf_Core.Token('TYPE', itemtype);
1227: Wf_Core.Token('KEY', itemkey);
1228: Wf_Core.Token('TOTAL', to_char(aname.COUNT));
1229: Wf_Core.Token('SUCCESS', to_char(success_cnt));

Line 1233: Wf_Core.Context('Wf_Engine', 'SetItemAttrTextArray', itemtype, itemkey);

1229: Wf_Core.Token('SUCCESS', to_char(success_cnt));
1230: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
1231:
1232: when others then
1233: Wf_Core.Context('Wf_Engine', 'SetItemAttrTextArray', itemtype, itemkey);
1234: raise;
1235: end SetItemAttrTextArray;
1236:
1237:

Line 1251: aname in Wf_Engine.NameTabTyp,

1247: --
1248: procedure SetItemAttrNumberArray(
1249: itemtype in varchar2,
1250: itemkey in varchar2,
1251: aname in Wf_Engine.NameTabTyp,
1252: avalue in Wf_Engine.NumTabTyp)
1253: is
1254: arrayIndex pls_integer;
1255: status pls_integer;

Line 1252: avalue in Wf_Engine.NumTabTyp)

1248: procedure SetItemAttrNumberArray(
1249: itemtype in varchar2,
1250: itemkey in varchar2,
1251: aname in Wf_Engine.NameTabTyp,
1252: avalue in Wf_Engine.NumTabTyp)
1253: is
1254: arrayIndex pls_integer;
1255: status pls_integer;
1256: wiavIND number;

Line 1279: if (itemkey = wf_engine.eng_synch) then

1275:
1276: end if;
1277:
1278: -- Set the number value.
1279: if (itemkey = wf_engine.eng_synch) then
1280: -- Use WF_CACHE in synch mode
1281: success_cnt := 0;
1282:
1283: for arrayIndex in aname.FIRST..aname.LAST loop

Line 1338: Wf_Core.Context('Wf_Engine', 'SetItemAttrNumberArray', itemtype, itemkey);

1334: end if;
1335:
1336: exception
1337: when no_data_found then
1338: Wf_Core.Context('Wf_Engine', 'SetItemAttrNumberArray', itemtype, itemkey);
1339: Wf_Core.Token('TYPE', itemtype);
1340: Wf_Core.Token('KEY', itemkey);
1341: Wf_Core.Token('TOTAL', to_char(aname.COUNT));
1342: Wf_Core.Token('SUCCESS', to_char(success_cnt));

Line 1346: Wf_Core.Context('Wf_Engine', 'SetItemAttrNumberArray', itemtype, itemkey);

1342: Wf_Core.Token('SUCCESS', to_char(success_cnt));
1343: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
1344:
1345: when others then
1346: Wf_Core.Context('Wf_Engine', 'SetItemAttrNumberArray', itemtype, itemkey);
1347: raise;
1348: end SetItemAttrNumberArray;
1349:
1350: --

Line 1363: aname in Wf_Engine.NameTabTyp,

1359: --
1360: procedure SetItemAttrDateArray(
1361: itemtype in varchar2,
1362: itemkey in varchar2,
1363: aname in Wf_Engine.NameTabTyp,
1364: avalue in Wf_Engine.DateTabTyp)
1365: is
1366: status pls_integer;
1367: arrayIndex pls_integer;

Line 1364: avalue in Wf_Engine.DateTabTyp)

1360: procedure SetItemAttrDateArray(
1361: itemtype in varchar2,
1362: itemkey in varchar2,
1363: aname in Wf_Engine.NameTabTyp,
1364: avalue in Wf_Engine.DateTabTyp)
1365: is
1366: status pls_integer;
1367: arrayIndex pls_integer;
1368: wiavIND number;

Line 1392: if (itemkey = wf_engine.eng_synch) then

1388: end if;
1389:
1390: success_cnt := 0;
1391: -- Set the date value.
1392: if (itemkey = wf_engine.eng_synch) then
1393: -- Use WF_CACHE in synch mode
1394: for arrayIndex in aname.FIRST..aname.LAST loop
1395: WF_CACHE.GetItemAttrValue(itemtype, itemKey, aname(arrayIndex), status,
1396: wiavIND);

Line 1449: Wf_Core.Context('Wf_Engine', 'SetItemAttrDateArray', itemtype, itemkey);

1445: end if;
1446:
1447: exception
1448: when no_data_found then
1449: Wf_Core.Context('Wf_Engine', 'SetItemAttrDateArray', itemtype, itemkey);
1450: Wf_Core.Token('TYPE', itemtype);
1451: Wf_Core.Token('KEY', itemkey);
1452: Wf_Core.Token('TOTAL', to_char(aname.COUNT));
1453: Wf_Core.Token('SUCCESS', to_char(success_cnt));

Line 1457: Wf_Core.Context('Wf_Engine', 'SetItemAttrDateArray', itemtype, itemkey);

1453: Wf_Core.Token('SUCCESS', to_char(success_cnt));
1454: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
1455:
1456: when others then
1457: Wf_Core.Context('Wf_Engine', 'SetItemAttrDateArray', itemtype, itemkey);
1458: raise;
1459: end SetItemAttrDateArray;
1460:
1461: --

Line 1509: Wf_Core.Context('Wf_Engine', 'GetItemAttrInfo', itemtype, aname);

1505: format := WF_CACHE.ItemAttributes(wiaIND).FORMAT;
1506:
1507: exception
1508: when no_data_found then
1509: Wf_Core.Context('Wf_Engine', 'GetItemAttrInfo', itemtype, aname);
1510: Wf_Core.Token('TYPE', itemtype);
1511: Wf_Core.Token('KEY', NULL);
1512: Wf_Core.Token('ATTRIBUTE', aname);
1513: Wf_Core.Raise('WFENG_ITEM_ATTR');

Line 1516: Wf_Core.Context('Wf_Engine', 'GetItemAttrInfo', itemtype, aname);

1512: Wf_Core.Token('ATTRIBUTE', aname);
1513: Wf_Core.Raise('WFENG_ITEM_ATTR');
1514:
1515: when others then
1516: Wf_Core.Context('Wf_Engine', 'GetItemAttrInfo', itemtype, aname);
1517: raise;
1518: end GetItemAttrInfo;
1519:
1520: --

Line 1586: nvalue := Wf_Engine.GetItemAttrNumber(itemtype, itemkey, aname);

1582: end if;
1583:
1584: -- Select value from appropriate type column.
1585: if (WF_CACHE.ItemAttributes(wiaIND).TYPE = 'NUMBER') then
1586: nvalue := Wf_Engine.GetItemAttrNumber(itemtype, itemkey, aname);
1587: if (WF_CACHE.ItemAttributes(wiaIND).FORMAT is null) then
1588: lvalue := to_char(nvalue);
1589: else
1590: lvalue := to_char(nvalue, WF_CACHE.ItemAttributes(wiaIND).FORMAT);

Line 1593: dvalue := Wf_Engine.GetItemAttrDate(itemtype, itemkey, aname);

1589: else
1590: lvalue := to_char(nvalue, WF_CACHE.ItemAttributes(wiaIND).FORMAT);
1591: end if;
1592: elsif (WF_CACHE.ItemAttributes(wiaIND).TYPE = 'DATE') then
1593: dvalue := Wf_Engine.GetItemAttrDate(itemtype, itemkey, aname);
1594: if (WF_CACHE.ItemAttributes(wiaIND).FORMAT is null) then
1595: lvalue := to_char(dvalue);
1596: else
1597: lvalue := to_char(dvalue, WF_CACHE.ItemAttributes(wiaIND).FORMAT);

Line 1602: if (itemkey = wf_engine.eng_synch) then

1598: end if;
1599: else
1600: -- VARCHAR2, LOOKUP, FORM, URL, DOCUMENT.
1601: -- Get the text value directly with no translation.
1602: if (itemkey = wf_engine.eng_synch) then
1603: -- Use WF_CACHE in synch mode
1604: WF_CACHE.GetItemAttrValue(itemtype, itemKey, aname, status, wiavIND);
1605:
1606: if (status <> WF_CACHE.task_SUCCESS) then

Line 1651: Wf_Core.Context('Wf_Engine', 'GetItemAttrText', itemtype, itemkey,

1647: return(null);
1648:
1649: else
1650:
1651: Wf_Core.Context('Wf_Engine', 'GetItemAttrText', itemtype, itemkey,
1652: aname);
1653: Wf_Core.Token('TYPE', itemtype);
1654: Wf_Core.Token('KEY', itemkey);
1655: Wf_Core.Token('ATTRIBUTE', aname);

Line 1661: Wf_Core.Context('Wf_Engine', 'GetItemAttrText', itemtype, itemkey,

1657:
1658: end if;
1659:
1660: when others then
1661: Wf_Core.Context('Wf_Engine', 'GetItemAttrText', itemtype, itemkey,
1662: aname);
1663: raise;
1664:
1665: end GetItemAttrText;

Line 1699: if (itemkey = wf_engine.eng_synch) then

1695: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1696: Wf_Core.Raise('WFSQL_ARGS');
1697: end if;
1698:
1699: if (itemkey = wf_engine.eng_synch) then
1700: -- Use WF_CACHE in synch mode
1701: WF_CACHE.GetItemAttrValue(itemtype, itemKey, aname, status, wiavIND);
1702:
1703: if (status <> WF_CACHE.task_SUCCESS) then

Line 1744: Wf_Core.Context('Wf_Engine', 'GetItemAttrNumber', itemtype, itemkey,

1740: return(null);
1741:
1742: else
1743:
1744: Wf_Core.Context('Wf_Engine', 'GetItemAttrNumber', itemtype, itemkey,
1745: aname);
1746: Wf_Core.Token('TYPE', itemtype);
1747: Wf_Core.Token('KEY', itemkey);
1748: Wf_Core.Token('ATTRIBUTE', aname);

Line 1754: Wf_Core.Context('Wf_Engine', 'GetItemAttrNumber', itemtype, itemkey,

1750:
1751: end if;
1752:
1753: when others then
1754: Wf_Core.Context('Wf_Engine', 'GetItemAttrNumber', itemtype, itemkey,
1755: aname);
1756: raise;
1757: end GetItemAttrNumber;
1758:

Line 1790: if (itemkey = wf_engine.eng_synch) then

1786: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1787: Wf_Core.Raise('WFSQL_ARGS');
1788: end if;
1789:
1790: if (itemkey = wf_engine.eng_synch) then
1791: -- Use WF_CACHE in synch mode
1792: WF_CACHE.GetItemAttrValue(itemtype, itemKey, aname, status, wiavIND);
1793:
1794: if (status <> WF_CACHE.task_SUCCESS) then

Line 1835: Wf_Core.Context('Wf_Engine', 'GetItemAttrDate', itemtype, itemkey,

1831: return(null);
1832:
1833: else
1834:
1835: Wf_Core.Context('Wf_Engine', 'GetItemAttrDate', itemtype, itemkey,
1836: aname);
1837: Wf_Core.Token('TYPE', itemtype);
1838: Wf_Core.Token('KEY', itemkey);
1839: Wf_Core.Token('ATTRIBUTE', aname);

Line 1844: Wf_Core.Context('Wf_Engine', 'GetItemAttrDate', itemtype, itemkey,

1840: Wf_Core.Raise('WFENG_ITEM_ATTR');
1841:
1842: end if;
1843: when others then
1844: Wf_Core.Context('Wf_Engine', 'GetItemAttrDate', itemtype, itemkey,
1845: aname);
1846: raise;
1847: end GetItemAttrDate;
1848:

Line 1879: return(Wf_Engine.GetItemAttrText(itemtype, itemkey, aname, ignore_notfound));

1875: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1876: Wf_Core.Raise('WFSQL_ARGS');
1877: end if;
1878:
1879: return(Wf_Engine.GetItemAttrText(itemtype, itemkey, aname, ignore_notfound));
1880: exception
1881: when others then
1882: Wf_Core.Context('Wf_Engine', 'GetItemAttrDocument', itemtype, itemkey,
1883: aname);

Line 1882: Wf_Core.Context('Wf_Engine', 'GetItemAttrDocument', itemtype, itemkey,

1878:
1879: return(Wf_Engine.GetItemAttrText(itemtype, itemkey, aname, ignore_notfound));
1880: exception
1881: when others then
1882: Wf_Core.Context('Wf_Engine', 'GetItemAttrDocument', itemtype, itemkey,
1883: aname);
1884: raise;
1885: end GetItemAttrDocument;
1886:

Line 1959: value := WF_Engine.GetItemAttrText(itemtype, itemkey, aname);

1955: -- Parse out document subtypes
1956: null;
1957: else
1958: -- All others just use text value
1959: value := WF_Engine.GetItemAttrText(itemtype, itemkey, aname);
1960: end if;
1961:
1962: -- Write value to fake clob and return
1963: if (value is null) then

Line 1974: Wf_Core.Context('Wf_Engine', 'GetItemAttrClob', itemtype,

1970: end if;
1971:
1972: exception
1973: when others then
1974: Wf_Core.Context('Wf_Engine', 'GetItemAttrClob', itemtype,
1975: itemkey, aname);
1976: raise;
1977: end GetItemAttrClob;
1978:

Line 2009: if (itemkey = wf_engine.eng_synch) then

2005: Wf_Core.Raise('WFSQL_ARGS');
2006: end if;
2007:
2008: -- Not allowed in synch mode
2009: if (itemkey = wf_engine.eng_synch) then
2010: wf_core.token('OPERATION', 'Wf_Engine.GetItemAttrEvent');
2011: wf_core.raise('WFENG_SYNCH_DISABLED');
2012: end if;
2013:

Line 2010: wf_core.token('OPERATION', 'Wf_Engine.GetItemAttrEvent');

2006: end if;
2007:
2008: -- Not allowed in synch mode
2009: if (itemkey = wf_engine.eng_synch) then
2010: wf_core.token('OPERATION', 'Wf_Engine.GetItemAttrEvent');
2011: wf_core.raise('WFENG_SYNCH_DISABLED');
2012: end if;
2013:
2014: begin

Line 2053: Wf_Core.Context('Wf_Engine', 'GetItemAttrEvent', itemtype, itemkey,

2049: end if;
2050: end;
2051: exception
2052: when no_data_found then
2053: Wf_Core.Context('Wf_Engine', 'GetItemAttrEvent', itemtype, itemkey,
2054: name);
2055: Wf_Core.Token('TYPE', itemtype);
2056: Wf_Core.Token('KEY', itemkey);
2057: Wf_Core.Token('ATTRIBUTE', name);

Line 2060: Wf_Core.Context('Wf_Engine', 'GetItemAttrEvent', itemtype,

2056: Wf_Core.Token('KEY', itemkey);
2057: Wf_Core.Token('ATTRIBUTE', name);
2058: Wf_Core.Raise('WFENG_ITEM_ATTR');
2059: when others then
2060: Wf_Core.Context('Wf_Engine', 'GetItemAttrEvent', itemtype,
2061: itemkey, name);
2062: raise;
2063: end GetItemAttrEvent;
2064:

Line 2196: Wf_Core.Context('Wf_Engine', 'GetActivityAttrInfo', itemtype, itemkey,

2192: format := WF_CACHE.ActivityAttributes(waaIND).FORMAT;
2193:
2194: exception
2195: when no_data_found then
2196: Wf_Core.Context('Wf_Engine', 'GetActivityAttrInfo', itemtype, itemkey,
2197: to_char(actid), aname);
2198: Wf_Core.Token('TYPE', itemtype);
2199: Wf_Core.Token('KEY', itemkey);
2200: Wf_Core.Token('ACTIVITY', to_char(actid));

Line 2204: Wf_Core.Context('Wf_Engine', 'GetActivityAttrInfo', itemtype, itemkey,

2200: Wf_Core.Token('ACTIVITY', to_char(actid));
2201: Wf_Core.Token('ATTRIBUTE', aname);
2202: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2203: when others then
2204: Wf_Core.Context('Wf_Engine', 'GetActivityAttrInfo', itemtype, itemkey,
2205: to_char(actid), aname);
2206: raise;
2207: end GetActivityAttrInfo;
2208:

Line 2480: Wf_Core.Context('Wf_Engine', 'GetActivityAttrText', itemtype, itemkey,

2476: return(null);
2477:
2478: else
2479:
2480: Wf_Core.Context('Wf_Engine', 'GetActivityAttrText', itemtype, itemkey,
2481: to_char(actid), aname);
2482: Wf_Core.Token('TYPE', itemtype);
2483: Wf_Core.Token('KEY', itemkey);
2484: Wf_Core.Token('ACTIVITY', to_char(actid));

Line 2496: Wf_Core.Context('Wf_Engine', 'GetActivityAttrText', itemtype, itemkey,

2492: if (curs_activityattr%ISOPEN) then
2493: CLOSE curs_activityattr;
2494: end if;
2495:
2496: Wf_Core.Context('Wf_Engine', 'GetActivityAttrText', itemtype, itemkey,
2497: to_char(actid), aname);
2498: raise;
2499: end GetActivityAttrText;
2500:

Line 2574: Wf_Core.Context('Wf_Engine', 'GetActivityAttrNumber', itemtype, itemkey,

2570: return null;
2571:
2572: else
2573:
2574: Wf_Core.Context('Wf_Engine', 'GetActivityAttrNumber', itemtype, itemkey,
2575: to_char(actid), aname);
2576: Wf_Core.Token('TYPE', itemtype);
2577: Wf_Core.Token('KEY', itemkey);
2578: Wf_Core.Token('ACTIVITY', to_char(actid));

Line 2590: Wf_Core.Context('Wf_Engine', 'GetActivityAttrNumber', itemtype, itemkey,

2586: if (curs_activityattr%ISOPEN) then
2587: CLOSE curs_activityattr;
2588: end if;
2589:
2590: Wf_Core.Context('Wf_Engine', 'GetActivityAttrNumber', itemtype, itemkey,
2591: to_char(actid), aname);
2592: raise;
2593: end GetActivityAttrNumber;
2594:

Line 2667: Wf_Core.Context('Wf_Engine', 'GetActivityAttrDate', itemtype, itemkey,

2663: return(null);
2664:
2665: else
2666:
2667: Wf_Core.Context('Wf_Engine', 'GetActivityAttrDate', itemtype, itemkey,
2668: to_char(actid), aname);
2669: Wf_Core.Token('TYPE', itemtype);
2670: Wf_Core.Token('KEY', itemkey);
2671: Wf_Core.Token('ACTIVITY', to_char(actid));

Line 2683: Wf_Core.Context('Wf_Engine', 'GetActivityAttrDate', itemtype, itemkey,

2679: if (curs_activityattr%ISOPEN) then
2680: CLOSE curs_activityattr;
2681: end if;
2682:
2683: Wf_Core.Context('Wf_Engine', 'GetActivityAttrDate', itemtype, itemkey,
2684: to_char(actid), aname);
2685: raise;
2686: end GetActivityAttrDate;
2687:

Line 2764: value := WF_Engine.GetActivityAttrText(itemtype, itemkey, actid, aname);

2760: -- Parse out document subtypes
2761: null;
2762: else
2763: -- All others just use text value
2764: value := WF_Engine.GetActivityAttrText(itemtype, itemkey, actid, aname);
2765: end if;
2766:
2767: -- Write value to fake clob and return
2768: dbms_lob.write(tempclob, lengthb(value), 1, value);

Line 2778: Wf_Core.Context('Wf_Engine', 'GetActivityAttrClob', itemtype,

2774: if (curs_activityattr%ISOPEN) then
2775: CLOSE curs_activityattr;
2776: end if;
2777:
2778: Wf_Core.Context('Wf_Engine', 'GetActivityAttrClob', itemtype,
2779: itemkey, to_char(actid), aname);
2780: raise;
2781: end GetActivityAttrClob;
2782:

Line 2846: Wf_Core.Context('Wf_Engine', 'GetActivityAttrEvent', itemtype, itemkey,

2842: if (curs_activityattr%ISOPEN) then
2843: CLOSE curs_activityattr;
2844: end if;
2845:
2846: Wf_Core.Context('Wf_Engine', 'GetActivityAttrEvent', itemtype, itemkey,
2847: to_char(actid), name);
2848: Wf_Core.Token('TYPE', itemtype);
2849: Wf_Core.Token('KEY', itemkey);
2850: Wf_Core.Token('ACTIVITY', to_char(actid));

Line 2860: Wf_Core.Context('Wf_Engine', 'GetActivityAttrEvent', itemtype,

2856: if (curs_activityattr%ISOPEN) then
2857: CLOSE curs_activityattr;
2858: end if;
2859:
2860: Wf_Core.Context('Wf_Engine', 'GetActivityAttrEvent', itemtype,
2861: itemkey, to_char(actid), name);
2862: raise;
2863: end GetActivityAttrEvent;
2864:

Line 2877: if (itemkey = wf_engine.eng_synch) then

2873: parent_context in varchar2)
2874: is
2875: begin
2876: -- Not allowed in synch mode
2877: if (itemkey = wf_engine.eng_synch) then
2878: wf_core.token('OPERATION', 'Wf_Engine.Set_Item_Parent');
2879: wf_core.raise('WFENG_SYNCH_DISABLED');
2880: end if;
2881:

Line 2878: wf_core.token('OPERATION', 'Wf_Engine.Set_Item_Parent');

2874: is
2875: begin
2876: -- Not allowed in synch mode
2877: if (itemkey = wf_engine.eng_synch) then
2878: wf_core.token('OPERATION', 'Wf_Engine.Set_Item_Parent');
2879: wf_core.raise('WFENG_SYNCH_DISABLED');
2880: end if;
2881:
2882: Wf_Item.Set_Item_Parent(itemtype, itemkey, parent_itemtype, parent_itemkey,

Line 2886: Wf_Core.Context('Wf_Engine', 'Set_Item_Parent', itemtype, itemkey,

2882: Wf_Item.Set_Item_Parent(itemtype, itemkey, parent_itemtype, parent_itemkey,
2883: parent_context);
2884: exception
2885: when others then
2886: Wf_Core.Context('Wf_Engine', 'Set_Item_Parent', itemtype, itemkey,
2887: parent_itemtype, parent_itemkey, parent_context);
2888: raise;
2889: end Set_Item_Parent;
2890:

Line 2924: if (itemkey = wf_engine.eng_synch) then

2920:
2921: end if;
2922:
2923: -- Not allowed in synch mode
2924: if (itemkey = wf_engine.eng_synch) then
2925: wf_core.token('OPERATION', 'Wf_Engine.SetItemParent');
2926: wf_core.raise('WFENG_SYNCH_DISABLED');
2927: end if;
2928:

Line 2925: wf_core.token('OPERATION', 'Wf_Engine.SetItemParent');

2921: end if;
2922:
2923: -- Not allowed in synch mode
2924: if (itemkey = wf_engine.eng_synch) then
2925: wf_core.token('OPERATION', 'Wf_Engine.SetItemParent');
2926: wf_core.raise('WFENG_SYNCH_DISABLED');
2927: end if;
2928:
2929: Wf_Item.Set_Item_Parent(itemtype, itemkey, parent_itemtype,

Line 2933: Wf_Core.Context('Wf_Engine', 'SetItemParent', itemtype, itemkey,

2929: Wf_Item.Set_Item_Parent(itemtype, itemkey, parent_itemtype,
2930: parent_itemkey, parent_context, masterdetail);
2931: exception
2932: when others then
2933: Wf_Core.Context('Wf_Engine', 'SetItemParent', itemtype, itemkey,
2934: parent_itemtype, parent_itemkey, parent_context);
2935: raise;
2936: end SetItemParent;
2937:

Line 2962: if (itemkey = wf_engine.eng_synch) then

2958:
2959: end if;
2960:
2961: -- Not allowed in synch mode
2962: if (itemkey = wf_engine.eng_synch) then
2963: wf_core.token('OPERATION', 'Wf_Engine.SetItemOwner');
2964: wf_core.raise('WFENG_SYNCH_DISABLED');
2965: end if;
2966:

Line 2963: wf_core.token('OPERATION', 'Wf_Engine.SetItemOwner');

2959: end if;
2960:
2961: -- Not allowed in synch mode
2962: if (itemkey = wf_engine.eng_synch) then
2963: wf_core.token('OPERATION', 'Wf_Engine.SetItemOwner');
2964: wf_core.raise('WFENG_SYNCH_DISABLED');
2965: end if;
2966:
2967: Wf_Item.SetItemOwner(itemtype, itemkey, owner);

Line 2970: Wf_Core.Context('Wf_Engine', 'SetItemOwner', itemtype, itemkey,

2966:
2967: Wf_Item.SetItemOwner(itemtype, itemkey, owner);
2968: exception
2969: when others then
2970: Wf_Core.Context('Wf_Engine', 'SetItemOwner', itemtype, itemkey,
2971: owner);
2972: raise;
2973: end SetItemOwner;
2974:

Line 3001: Wf_Core.Context('Wf_Engine', 'GetItemUserKey', itemtype, itemkey);

2997:
2998: return(Wf_Item.GetItemUserKey(itemtype, itemkey));
2999: exception
3000: when others then
3001: Wf_Core.Context('Wf_Engine', 'GetItemUserKey', itemtype, itemkey);
3002: raise;
3003: end GetItemUserKey;
3004:
3005: --

Line 3029: if (itemkey = wf_engine.eng_synch) then

3025:
3026: end if;
3027:
3028: -- Not allowed in synch mode
3029: if (itemkey = wf_engine.eng_synch) then
3030: wf_core.token('OPERATION', 'Wf_Engine.SetItemUserKey');
3031: wf_core.raise('WFENG_SYNCH_DISABLED');
3032: end if;
3033:

Line 3030: wf_core.token('OPERATION', 'Wf_Engine.SetItemUserKey');

3026: end if;
3027:
3028: -- Not allowed in synch mode
3029: if (itemkey = wf_engine.eng_synch) then
3030: wf_core.token('OPERATION', 'Wf_Engine.SetItemUserKey');
3031: wf_core.raise('WFENG_SYNCH_DISABLED');
3032: end if;
3033:
3034: Wf_Item.SetItemUserKey(itemtype, itemkey, userkey);

Line 3037: Wf_Core.Context('Wf_Engine', 'SetItemUserKey', itemtype, itemkey,

3033:
3034: Wf_Item.SetItemUserKey(itemtype, itemkey, userkey);
3035: exception
3036: when others then
3037: Wf_Core.Context('Wf_Engine', 'SetItemUserKey', itemtype, itemkey,
3038: userkey);
3039: raise;
3040: end SetItemUserKey;
3041:

Line 3045: -- suitable for passing to other wf_engine apis.

3041:
3042: --
3043: -- GetActivityLabel (PUBLIC)
3044: -- Get activity instance label given id, in a format
3045: -- suitable for passing to other wf_engine apis.
3046: -- IN
3047: -- actid - activity instance id
3048: -- RETURNS
3049: -- ||':'||

Line 3084: Wf_Core.Context('Wf_Engine', 'GetActivityLabel', to_char(actid));

3080: WF_CACHE.ProcessActivities(actid).INSTANCE_LABEL);
3081:
3082: exception
3083: when no_data_found then
3084: Wf_Core.Context('Wf_Engine', 'GetActivityLabel', to_char(actid));
3085: Wf_Core.Token('ACTID', to_char(actid));
3086: Wf_Core.Raise('WFENG_ACTID');
3087: when others then
3088: Wf_Core.Context('Wf_Engine', 'GetActivityLabel', to_char(actid));

Line 3088: Wf_Core.Context('Wf_Engine', 'GetActivityLabel', to_char(actid));

3084: Wf_Core.Context('Wf_Engine', 'GetActivityLabel', to_char(actid));
3085: Wf_Core.Token('ACTID', to_char(actid));
3086: Wf_Core.Raise('WFENG_ACTID');
3087: when others then
3088: Wf_Core.Context('Wf_Engine', 'GetActivityLabel', to_char(actid));
3089: raise;
3090: end GetActivityLabel;
3091:
3092: -- Bug 2376033

Line 3192: if (itemkey = wf_engine.eng_synch) then

3188: actid := to_number(substr(context, secondcolon+1,
3189: length(context) - secondcolon));
3190:
3191: -- Not allowed in synch mode
3192: if (itemkey = wf_engine.eng_synch) then
3193: wf_core.token('OPERATION', 'Wf_Engine.CB');
3194: wf_core.raise('WFENG_SYNCH_DISABLED');
3195: end if;
3196:

Line 3193: wf_core.token('OPERATION', 'Wf_Engine.CB');

3189: length(context) - secondcolon));
3190:
3191: -- Not allowed in synch mode
3192: if (itemkey = wf_engine.eng_synch) then
3193: wf_core.token('OPERATION', 'Wf_Engine.CB');
3194: wf_core.raise('WFENG_SYNCH_DISABLED');
3195: end if;
3196:
3197: --

Line 3252: elsif (upper(command) = wf_engine.eng_completed) then

3248: else
3249: raise;
3250: end if;
3251: end;
3252: elsif (upper(command) = wf_engine.eng_completed) then
3253: -- CB is signalling that a notification has completed.
3254: -- If the activity originating this notification still has ACTIVE
3255: -- status, then a routing rule (or some other kind of automatic
3256: -- processing) has completed the notification before the activity

Line 3263: if (status = wf_engine.eng_active) then

3259: -- execute_activity() pick up the execution when the activity
3260: -- owning this notification is actually completed.
3261: Wf_Item_Activity_Status.Status(itemtype, itemkey,
3262: actid, status);
3263: if (status = wf_engine.eng_active) then
3264: -- Do nothing!!!
3265: return;
3266: end if;
3267:

Line 3283: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);

3279: NULL;
3280:
3281: end if;
3282:
3283: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);
3284: exception
3285: when trig_savepoint or dist_savepoint then
3286: -- Savepoint violation.
3287: -- Try without fancy error processing.

Line 3288: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);

3284: exception
3285: when trig_savepoint or dist_savepoint then
3286: -- Savepoint violation.
3287: -- Try without fancy error processing.
3288: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);
3289: when others then
3290: -- If anything in this process raises an exception:
3291: -- 1. rollback any work in this process thread
3292: -- 2. set this activity to error status

Line 3297: Wf_Core.Context('Wf_Engine', 'CB', command, context, attr_name,

3293: -- 3. execute the error process (if any)
3294: -- 4. clear the error to continue with next activity
3295: rollback to wf_savepoint;
3296: --The rollback will be done in the when others block
3297: Wf_Core.Context('Wf_Engine', 'CB', command, context, attr_name,
3298: attr_type, ':'||text_value||':'||to_char(number_value)||':'||
3299: to_char(date_value)||':');
3300: Wf_Item_Activity_Status.Set_Error(itemtype,
3301: itemkey, actid, wf_engine.eng_exception, FALSE);

Line 3301: itemkey, actid, wf_engine.eng_exception, FALSE);

3297: Wf_Core.Context('Wf_Engine', 'CB', command, context, attr_name,
3298: attr_type, ':'||text_value||':'||to_char(number_value)||':'||
3299: to_char(date_value)||':');
3300: Wf_Item_Activity_Status.Set_Error(itemtype,
3301: itemkey, actid, wf_engine.eng_exception, FALSE);
3302: Wf_Engine_Util.Execute_Error_Process(itemtype,
3303: itemkey, actid, wf_engine.eng_exception);
3304: Wf_Core.Clear;
3305: end;

Line 3302: Wf_Engine_Util.Execute_Error_Process(itemtype,

3298: attr_type, ':'||text_value||':'||to_char(number_value)||':'||
3299: to_char(date_value)||':');
3300: Wf_Item_Activity_Status.Set_Error(itemtype,
3301: itemkey, actid, wf_engine.eng_exception, FALSE);
3302: Wf_Engine_Util.Execute_Error_Process(itemtype,
3303: itemkey, actid, wf_engine.eng_exception);
3304: Wf_Core.Clear;
3305: end;
3306: elsif (upper(command) = wf_engine.eng_error) then

Line 3303: itemkey, actid, wf_engine.eng_exception);

3299: to_char(date_value)||':');
3300: Wf_Item_Activity_Status.Set_Error(itemtype,
3301: itemkey, actid, wf_engine.eng_exception, FALSE);
3302: Wf_Engine_Util.Execute_Error_Process(itemtype,
3303: itemkey, actid, wf_engine.eng_exception);
3304: Wf_Core.Clear;
3305: end;
3306: elsif (upper(command) = wf_engine.eng_error) then
3307:

Line 3306: elsif (upper(command) = wf_engine.eng_error) then

3302: Wf_Engine_Util.Execute_Error_Process(itemtype,
3303: itemkey, actid, wf_engine.eng_exception);
3304: Wf_Core.Clear;
3305: end;
3306: elsif (upper(command) = wf_engine.eng_error) then
3307:
3308: -- Set the error status
3309: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
3310: wf_engine.eng_mail, FALSE);

Line 3310: wf_engine.eng_mail, FALSE);

3306: elsif (upper(command) = wf_engine.eng_error) then
3307:
3308: -- Set the error status
3309: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
3310: wf_engine.eng_mail, FALSE);
3311: -- Run any error process for the activity
3312: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
3313: wf_engine.eng_mail);
3314: elsif (upper(command) = 'TESTCTX') then

Line 3312: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,

3308: -- Set the error status
3309: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
3310: wf_engine.eng_mail, FALSE);
3311: -- Run any error process for the activity
3312: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
3313: wf_engine.eng_mail);
3314: elsif (upper(command) = 'TESTCTX') then
3315: -- Call selector function in test mode
3316: -- Return true if result is either true or null (means context

Line 3313: wf_engine.eng_mail);

3309: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
3310: wf_engine.eng_mail, FALSE);
3311: -- Run any error process for the activity
3312: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
3313: wf_engine.eng_mail);
3314: elsif (upper(command) = 'TESTCTX') then
3315: -- Call selector function in test mode
3316: -- Return true if result is either true or null (means context
3317: -- test not implemented)

Line 3318: result := Wf_Engine_Util.Execute_Selector_Function(itemtype,

3314: elsif (upper(command) = 'TESTCTX') then
3315: -- Call selector function in test mode
3316: -- Return true if result is either true or null (means context
3317: -- test not implemented)
3318: result := Wf_Engine_Util.Execute_Selector_Function(itemtype,
3319: itemkey, wf_engine.eng_testctx);
3320: text_value := nvl(result, 'TRUE');
3321: elsif (upper(command) = 'SETCTX') then
3322: -- Call selector function in set mode

Line 3319: itemkey, wf_engine.eng_testctx);

3315: -- Call selector function in test mode
3316: -- Return true if result is either true or null (means context
3317: -- test not implemented)
3318: result := Wf_Engine_Util.Execute_Selector_Function(itemtype,
3319: itemkey, wf_engine.eng_testctx);
3320: text_value := nvl(result, 'TRUE');
3321: elsif (upper(command) = 'SETCTX') then
3322: -- Call selector function in set mode
3323: result := Wf_Engine_Util.Execute_Selector_Function(itemtype,

Line 3323: result := Wf_Engine_Util.Execute_Selector_Function(itemtype,

3319: itemkey, wf_engine.eng_testctx);
3320: text_value := nvl(result, 'TRUE');
3321: elsif (upper(command) = 'SETCTX') then
3322: -- Call selector function in set mode
3323: result := Wf_Engine_Util.Execute_Selector_Function(itemtype,
3324: itemkey, wf_engine.eng_setctx);
3325: elsif (upper(command) in ('FORWARD', 'TRANSFER', 'RESPOND',
3326: 'ANSWER', 'QUESTION', 'VALIDATE')) then
3327: -- FORWARD/TRANSFER/RESPOND/ANSWER/QUESTION/VALIDATE

Line 3324: itemkey, wf_engine.eng_setctx);

3320: text_value := nvl(result, 'TRUE');
3321: elsif (upper(command) = 'SETCTX') then
3322: -- Call selector function in set mode
3323: result := Wf_Engine_Util.Execute_Selector_Function(itemtype,
3324: itemkey, wf_engine.eng_setctx);
3325: elsif (upper(command) in ('FORWARD', 'TRANSFER', 'RESPOND',
3326: 'ANSWER', 'QUESTION', 'VALIDATE')) then
3327: -- FORWARD/TRANSFER/RESPOND/ANSWER/QUESTION/VALIDATE
3328: -- Look for a notification callback function to execute.

Line 3338: Wf_Engine_Util.Execute_Notification_Callback(command, itemtype,

3334: -- 2. The callback function will raise an exception if the
3335: -- operation isn't allowed. If so, allow the exception to raise
3336: -- up to the calling function.
3337:
3338: Wf_Engine_Util.Execute_Notification_Callback(command, itemtype,
3339: itemkey, actid, number_value, text_value);
3340:
3341: -- For TRANSFER mode only, reset the assigned user, but only
3342: -- if not a voting activity

Line 3357: Wf_Core.Context('Wf_Engine', 'CB', command, context, attr_name, attr_type,

3353: end if;
3354:
3355: exception
3356: when wf_invalid_command then
3357: Wf_Core.Context('Wf_Engine', 'CB', command, context, attr_name, attr_type,
3358: ':'||text_value||':'||to_char(number_value)||':'||
3359: to_char(date_value)||':');
3360: Wf_Core.Token('COMMAND', command);
3361: Wf_Core.Raise('WFSQL_COMMAND');

Line 3364: Wf_Core.Context('Wf_Engine', 'CB', command, context, attr_name, attr_type,

3360: Wf_Core.Token('COMMAND', command);
3361: Wf_Core.Raise('WFSQL_COMMAND');
3362:
3363: when wf_invalid_argument then
3364: Wf_Core.Context('Wf_Engine', 'CB', command, context, attr_name, attr_type,
3365: ':'||text_value||':'||to_char(number_value)||':'||
3366: to_char(date_value)||':');
3367: Wf_Core.Token('CONTEXT', context);
3368: Wf_Core.Raise('WFSQL_ARGS');

Line 3371: Wf_Core.Context('Wf_Engine', 'CB', command, context, attr_name, attr_type,

3367: Wf_Core.Token('CONTEXT', context);
3368: Wf_Core.Raise('WFSQL_ARGS');
3369:
3370: when OTHERS then
3371: Wf_Core.Context('Wf_Engine', 'CB', command, context, attr_name, attr_type,
3372: ':'||text_value||':'||to_char(number_value)||':'||
3373: to_char(date_value)||':');
3374: raise;
3375: end CB;

Line 3425: Wf_Engine.CB(command, context, attr_name, attr_type, text_value, number_value, date_value, event_value);

3421: is
3422: event_value wf_event_t;
3423: begin
3424:
3425: Wf_Engine.CB(command, context, attr_name, attr_type, text_value, number_value, date_value, event_value);
3426:
3427: exception
3428: when OTHERS then
3429: Wf_Core.Context('Wf_Engine', 'oldCB', command, context, attr_name, attr_type,

Line 3429: Wf_Core.Context('Wf_Engine', 'oldCB', command, context, attr_name, attr_type,

3425: Wf_Engine.CB(command, context, attr_name, attr_type, text_value, number_value, date_value, event_value);
3426:
3427: exception
3428: when OTHERS then
3429: Wf_Core.Context('Wf_Engine', 'oldCB', command, context, attr_name, attr_type,
3430: ':'||text_value||':'||to_char(number_value)||':'||
3431: to_char(date_value)||':');
3432: raise;
3433:

Line 3453: Wf_Core.Context('Wf_Engine', 'ProcessDeferred',itemtype,

3449: begin
3450: wf_queue.ProcessDeferredQueue(itemtype, minthreshold, maxthreshold);
3451: exception
3452: when others then
3453: Wf_Core.Context('Wf_Engine', 'ProcessDeferred',itemtype,
3454: to_char(minthreshold), to_char(maxthreshold));
3455: raise;
3456: end ProcessDeferred;
3457:

Line 3543: schema := Wf_Engine.GetItemAttrText(l_itemtype,l_itemkey,

3539: and WI.item_key = S.ITEM_KEY
3540: for update of S.ACTIVITY_STATUS, WI.item_type , wi.item_key NOWAIT;
3541:
3542: -- check if schema matched
3543: schema := Wf_Engine.GetItemAttrText(l_itemtype,l_itemkey,
3544: wf_engine.eng_schema, ignore_notfound=>TRUE);
3545:
3546: if (schema is null or
3547: schema = Wf_Engine.Current_Schema) then

Line 3544: wf_engine.eng_schema, ignore_notfound=>TRUE);

3540: for update of S.ACTIVITY_STATUS, WI.item_type , wi.item_key NOWAIT;
3541:
3542: -- check if schema matched
3543: schema := Wf_Engine.GetItemAttrText(l_itemtype,l_itemkey,
3544: wf_engine.eng_schema, ignore_notfound=>TRUE);
3545:
3546: if (schema is null or
3547: schema = Wf_Engine.Current_Schema) then
3548: eligible := TRUE;

Line 3547: schema = Wf_Engine.Current_Schema) then

3543: schema := Wf_Engine.GetItemAttrText(l_itemtype,l_itemkey,
3544: wf_engine.eng_schema, ignore_notfound=>TRUE);
3545:
3546: if (schema is null or
3547: schema = Wf_Engine.Current_Schema) then
3548: eligible := TRUE;
3549: else
3550: eligible := FALSE;
3551: end if;

Line 3562: wf_engine.eng_completed, wf_engine.eng_timedout);

3558:
3559: if (eligible) then
3560: -- Set the status to COMPLETE:#TIMEOUT.
3561: Wf_Item_Activity_Status.Create_Status(l_itemtype, l_itemkey, l_actid,
3562: wf_engine.eng_completed, wf_engine.eng_timedout);
3563:
3564: begin
3565: begin
3566: begin

Line 3571: Wf_Engine_Util.Execute_Post_NTF_Function(l_itemtype, l_itemkey,

3567: savepoint wf_savepoint;
3568: -- If there is a function attached, call it in timeout mode to
3569: -- give the function one last chance to complete and override
3570: -- the timeout.
3571: Wf_Engine_Util.Execute_Post_NTF_Function(l_itemtype, l_itemkey,
3572: l_actid, wf_engine.eng_timeout, pntfstatus, pntfresult);
3573: if (pntfstatus = wf_engine.eng_completed) then
3574: -- Post-notification function found and returned a completed
3575: -- status.

Line 3572: l_actid, wf_engine.eng_timeout, pntfstatus, pntfresult);

3568: -- If there is a function attached, call it in timeout mode to
3569: -- give the function one last chance to complete and override
3570: -- the timeout.
3571: Wf_Engine_Util.Execute_Post_NTF_Function(l_itemtype, l_itemkey,
3572: l_actid, wf_engine.eng_timeout, pntfstatus, pntfresult);
3573: if (pntfstatus = wf_engine.eng_completed) then
3574: -- Post-notification function found and returned a completed
3575: -- status.
3576: -- Complete activity with result of post-notification function.

Line 3573: if (pntfstatus = wf_engine.eng_completed) then

3569: -- give the function one last chance to complete and override
3570: -- the timeout.
3571: Wf_Engine_Util.Execute_Post_NTF_Function(l_itemtype, l_itemkey,
3572: l_actid, wf_engine.eng_timeout, pntfstatus, pntfresult);
3573: if (pntfstatus = wf_engine.eng_completed) then
3574: -- Post-notification function found and returned a completed
3575: -- status.
3576: -- Complete activity with result of post-notification function.
3577: Wf_Engine_Util.Complete_Activity(l_itemtype, l_itemkey, l_actid,

Line 3577: Wf_Engine_Util.Complete_Activity(l_itemtype, l_itemkey, l_actid,

3573: if (pntfstatus = wf_engine.eng_completed) then
3574: -- Post-notification function found and returned a completed
3575: -- status.
3576: -- Complete activity with result of post-notification function.
3577: Wf_Engine_Util.Complete_Activity(l_itemtype, l_itemkey, l_actid,
3578: pntfresult, FALSE);
3579: else
3580: -- Either had no post-notification function, or result was still
3581: -- not complete.

Line 3583: Wf_Engine_Util.Complete_Activity(l_itemtype, l_itemkey, l_actid,

3579: else
3580: -- Either had no post-notification function, or result was still
3581: -- not complete.
3582: -- In either case, complete activity with #TIMEOUT.
3583: Wf_Engine_Util.Complete_Activity(l_itemtype, l_itemkey, l_actid,
3584: wf_engine.eng_timedout);
3585: end if;
3586: exception
3587: when others then

Line 3584: wf_engine.eng_timedout);

3580: -- Either had no post-notification function, or result was still
3581: -- not complete.
3582: -- In either case, complete activity with #TIMEOUT.
3583: Wf_Engine_Util.Complete_Activity(l_itemtype, l_itemkey, l_actid,
3584: wf_engine.eng_timedout);
3585: end if;
3586: exception
3587: when others then
3588: -- If anything in this process raises an exception:

Line 3598: Wf_Core.Token('ACTIVITY', Wf_Engine.GetActivityLabel(l_actid));

3594: end;
3595: exception
3596: when NO_SAVEPOINT then
3597: -- Catch any savepoint error in case of a commit happened.
3598: Wf_Core.Token('ACTIVITY', Wf_Engine.GetActivityLabel(l_actid));
3599: Wf_Core.Raise('WFENG_COMMIT_IN_COMPLETE');
3600: end;
3601: exception
3602: when OTHERS then

Line 3607: Wf_Core.Context('Wf_Engine', 'ProcessTimeout', l_itemkey, l_itemtype,

3603: -- Remaining steps for completing activity raises an exception:
3604: -- 2. set this activity to error status
3605: -- 3. execute the error process (if any)
3606: -- 4. clear the error to continue with next activity
3607: Wf_Core.Context('Wf_Engine', 'ProcessTimeout', l_itemkey, l_itemtype,
3608: to_char(l_actid));
3609: Wf_Item_Activity_Status.Set_Error(l_itemtype, l_itemkey, l_actid,
3610: wf_engine.eng_exception, FALSE);
3611: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey,

Line 3610: wf_engine.eng_exception, FALSE);

3606: -- 4. clear the error to continue with next activity
3607: Wf_Core.Context('Wf_Engine', 'ProcessTimeout', l_itemkey, l_itemtype,
3608: to_char(l_actid));
3609: Wf_Item_Activity_Status.Set_Error(l_itemtype, l_itemkey, l_actid,
3610: wf_engine.eng_exception, FALSE);
3611: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey,
3612: l_actid, wf_engine.eng_exception);
3613: Wf_Core.Clear;
3614: end;

Line 3611: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey,

3607: Wf_Core.Context('Wf_Engine', 'ProcessTimeout', l_itemkey, l_itemtype,
3608: to_char(l_actid));
3609: Wf_Item_Activity_Status.Set_Error(l_itemtype, l_itemkey, l_actid,
3610: wf_engine.eng_exception, FALSE);
3611: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey,
3612: l_actid, wf_engine.eng_exception);
3613: Wf_Core.Clear;
3614: end;
3615: end if;

Line 3612: l_actid, wf_engine.eng_exception);

3608: to_char(l_actid));
3609: Wf_Item_Activity_Status.Set_Error(l_itemtype, l_itemkey, l_actid,
3610: wf_engine.eng_exception, FALSE);
3611: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey,
3612: l_actid, wf_engine.eng_exception);
3613: Wf_Core.Clear;
3614: end;
3615: end if;
3616:

Line 3627: Wf_Core.Context('Wf_Engine', 'ProcessTimeout', l_itemkey, l_itemtype,

3623: end loop;
3624:
3625: exception
3626: when others then
3627: Wf_Core.Context('Wf_Engine', 'ProcessTimeout', l_itemkey, l_itemtype,
3628: to_char(l_actid));
3629: raise;
3630: end ProcessTimeOut;
3631:

Line 3672: and WAP.TYPE = wf_engine.eng_process

3668: and WIASP.ITEM_TYPE = WI.ITEM_TYPE
3669: and WIASP.ITEM_KEY = WI.ITEM_KEY
3670: and WI.BEGIN_DATE >= WAP.BEGIN_DATE
3671: and WI.BEGIN_DATE < nvl(WAP.END_DATE, WI.BEGIN_DATE+1)
3672: and WAP.TYPE = wf_engine.eng_process
3673: and WIASP.ACTIVITY_STATUS = 'ACTIVE' --use literal to force index
3674: and not exists
3675: (select null
3676: from WF_ITEM_ACTIVITY_STATUSES WIASC,

Line 3766: and WAP.TYPE = wf_engine.eng_process

3762: and WIASP.ITEM_TYPE = WI.ITEM_TYPE
3763: and WIASP.ITEM_KEY = WI.ITEM_KEY
3764: and WI.BEGIN_DATE >= WAP.BEGIN_DATE
3765: and WI.BEGIN_DATE < nvl(WAP.END_DATE, WI.BEGIN_DATE+1)
3766: and WAP.TYPE = wf_engine.eng_process
3767: and WIASP.ACTIVITY_STATUS = 'ACTIVE' --use literal to force index
3768: and not exists
3769: (select null
3770: from WF_ITEM_ACTIVITY_STATUSES WIASC,

Line 3794: wf_engine.eng_error, wf_engine.eng_stuck);

3790:
3791: if (eligible) then
3792: -- Set the status to ERROR:#STUCK
3793: Wf_Item_Activity_Status.Create_Status(l_itemtype, l_itemkey, l_actid,
3794: wf_engine.eng_error, wf_engine.eng_stuck);
3795:
3796: -- Execute the error process for stuck process
3797: begin
3798: begin

Line 3801: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey, l_actid,

3797: begin
3798: begin
3799: begin
3800: savepoint wf_savepoint;
3801: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey, l_actid,
3802: wf_engine.eng_stuck);
3803: exception
3804: when others then
3805: -- If anything in this process raises an exception:

Line 3802: wf_engine.eng_stuck);

3798: begin
3799: begin
3800: savepoint wf_savepoint;
3801: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey, l_actid,
3802: wf_engine.eng_stuck);
3803: exception
3804: when others then
3805: -- If anything in this process raises an exception:
3806: -- 1. rollback any work in this process thread

Line 3815: Wf_Core.Token('ACTIVITY', Wf_Engine.GetActivityLabel(l_actid));

3811: end;
3812: exception
3813: when NO_SAVEPOINT then
3814: -- Catch any savepoint error in case of a commit happened.
3815: Wf_Core.Token('ACTIVITY', Wf_Engine.GetActivityLabel(l_actid));
3816: Wf_Core.Raise('WFENG_COMMIT_IN_ERRPROC');
3817: end;
3818: exception
3819: when OTHERS then

Line 3824: Wf_Core.Context('Wf_Engine', 'ProcessStuckProcess', l_itemkey,

3820: -- Remaining steps for completing activity raises an exception:
3821: -- 2. set this activity to error status
3822: -- 3. execute the error process (if any)
3823: -- 4. clear the error to continue with next activity
3824: Wf_Core.Context('Wf_Engine', 'ProcessStuckProcess', l_itemkey,
3825: l_itemtype, to_char(l_actid));
3826: Wf_Item_Activity_Status.Set_Error(l_itemtype, l_itemkey, l_actid,
3827: wf_engine.eng_exception, FALSE);
3828: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey,

Line 3827: wf_engine.eng_exception, FALSE);

3823: -- 4. clear the error to continue with next activity
3824: Wf_Core.Context('Wf_Engine', 'ProcessStuckProcess', l_itemkey,
3825: l_itemtype, to_char(l_actid));
3826: Wf_Item_Activity_Status.Set_Error(l_itemtype, l_itemkey, l_actid,
3827: wf_engine.eng_exception, FALSE);
3828: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey,
3829: l_actid, wf_engine.eng_exception);
3830: Wf_Core.Clear;
3831: end;

Line 3828: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey,

3824: Wf_Core.Context('Wf_Engine', 'ProcessStuckProcess', l_itemkey,
3825: l_itemtype, to_char(l_actid));
3826: Wf_Item_Activity_Status.Set_Error(l_itemtype, l_itemkey, l_actid,
3827: wf_engine.eng_exception, FALSE);
3828: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey,
3829: l_actid, wf_engine.eng_exception);
3830: Wf_Core.Clear;
3831: end;
3832:

Line 3829: l_actid, wf_engine.eng_exception);

3825: l_itemtype, to_char(l_actid));
3826: Wf_Item_Activity_Status.Set_Error(l_itemtype, l_itemkey, l_actid,
3827: wf_engine.eng_exception, FALSE);
3828: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey,
3829: l_actid, wf_engine.eng_exception);
3830: Wf_Core.Clear;
3831: end;
3832:
3833: -- Commit work to insure this activity thread doesn't interfere

Line 3844: Wf_Core.Context('Wf_Engine', 'ProcessStuckProcess', l_itemkey, l_itemtype,

3840: end loop;
3841:
3842: exception
3843: when others then
3844: Wf_Core.Context('Wf_Engine', 'ProcessStuckProcess', l_itemkey, l_itemtype,
3845: to_char(l_actid));
3846: raise;
3847: end ProcessStuckProcess;
3848:

Line 3893: wf_engine.preserved_context := FALSE;

3889: --Enable the deferred and inbound queues.
3890: wf_queue.Enablebackgroundqueues;
3891:
3892: -- Do not need to preserve context
3893: wf_engine.preserved_context := FALSE;
3894:
3895: -- Process deferred activities
3896: if (process_deferred) then
3897: -- process the inbound queue first - it may place events on the deferred Q

Line 3899: wf_engine.ProcessDeferred(itemtype, minthreshold, maxthreshold);

3895: -- Process deferred activities
3896: if (process_deferred) then
3897: -- process the inbound queue first - it may place events on the deferred Q
3898: wf_queue.ProcessInboundQueue(itemtype);
3899: wf_engine.ProcessDeferred(itemtype, minthreshold, maxthreshold);
3900: end if;
3901:
3902: -- Process timeout activities
3903: if (process_timeout) then

Line 3904: wf_engine.ProcessTimeout(itemtype);

3900: end if;
3901:
3902: -- Process timeout activities
3903: if (process_timeout) then
3904: wf_engine.ProcessTimeout(itemtype);
3905: end if;
3906:
3907: -- Process stuck activities
3908: if (process_stuck) then

Line 3909: wf_engine.ProcessStuckProcess(itemtype);

3905: end if;
3906:
3907: -- Process stuck activities
3908: if (process_stuck) then
3909: wf_engine.ProcessStuckProcess(itemtype);
3910: end if;
3911:
3912: exception
3913: when others then

Line 3914: Wf_Core.Context('Wf_Engine', 'Background', itemtype,

3910: end if;
3911:
3912: exception
3913: when others then
3914: Wf_Core.Context('Wf_Engine', 'Background', itemtype,
3915: to_char(minthreshold), to_char(maxthreshold));
3916: raise;
3917: end Background;
3918:

Line 3978: Wf_Engine.Background(

3974: process_stuck_bool := FALSE;
3975: end if;
3976:
3977: -- Call background engine with new args
3978: Wf_Engine.Background(
3979: itemtype,
3980: minthreshold_num,
3981: maxthreshold_num,
3982: process_deferred_bool,

Line 4050: if (itemkey = wf_engine.eng_synch) then

4046: null;
4047: end if;
4048:
4049: -- Check for duplicate item
4050: if (itemkey = wf_engine.eng_synch) then
4051: if (Wf_Item.Item_Exist(itemtype, itemkey)) then
4052: -- SYNCHMODE: If duplicate is a synch process, check the status
4053: -- of the root process of the existing item.
4054: -- If the cached item is already complete, then it is ok to

Line 4065: if (nvl(status, 'x') <> wf_engine.eng_completed) then

4061: exception
4062: when others then
4063: status := 'x'; -- Treat errors like incomplete process
4064: end;
4065: if (nvl(status, 'x') <> wf_engine.eng_completed) then
4066: Wf_Core.Token('ITEMTYPE', itemtype);
4067: Wf_Core.Token('ITEMKEY', itemkey);
4068: Wf_Core.Raise('WFENG_SYNCH_ITEM');
4069: end if;

Line 4084: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey);

4080: end if;
4081:
4082: if (process is null) then
4083: -- Call the selector function to get the process
4084: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey);
4085: if (root is null) then
4086: Wf_Core.Token('TYPE', itemtype);
4087: Wf_Core.Token('KEY', itemkey);
4088: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');

Line 4101: if ((typ is null) or (typ <> wf_engine.eng_process)) then

4097: -- The check that the process is runnable can't be done until AFTER
4098: -- create_item so the date has been established.
4099: actdate := sysdate;
4100: typ := Wf_Activity.Type(itemtype, root, actdate);
4101: if ((typ is null) or (typ <> wf_engine.eng_process)) then
4102: Wf_Core.Token('TYPE', itemtype);
4103: Wf_Core.Token('NAME', root);
4104: Wf_Core.Raise('WFENG_PROCESS_NAME');
4105: end if;

Line 4120: if (itemkey <> WF_ENGINE.eng_synch) then

4116: Wf_Core.Token('NAME', root);
4117: Wf_Core.Raise('WFENG_PROCESS_RUNNABLE');
4118: end if;
4119:
4120: if (itemkey <> WF_ENGINE.eng_synch) then
4121: -- Create monitor access key attributes
4122: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.wfmon_mon_key,
4123: Wf_Core.Random);
4124: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.wfmon_acc_key,

Line 4122: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.wfmon_mon_key,

4118: end if;
4119:
4120: if (itemkey <> WF_ENGINE.eng_synch) then
4121: -- Create monitor access key attributes
4122: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.wfmon_mon_key,
4123: Wf_Core.Random);
4124: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.wfmon_acc_key,
4125: Wf_Core.Random);
4126: end if;

Line 4124: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.wfmon_acc_key,

4120: if (itemkey <> WF_ENGINE.eng_synch) then
4121: -- Create monitor access key attributes
4122: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.wfmon_mon_key,
4123: Wf_Core.Random);
4124: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.wfmon_acc_key,
4125: Wf_Core.Random);
4126: end if;
4127:
4128: -- Create a schema attribute

Line 4129: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.eng_schema,

4125: Wf_Core.Random);
4126: end if;
4127:
4128: -- Create a schema attribute
4129: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.eng_schema,
4130: Wf_Engine.Current_Schema);
4131:
4132: -- Initialize all EVENT-type item attributes
4133: -- Not done here, it is deferred until GetItemAttrEvent

Line 4130: Wf_Engine.Current_Schema);

4126: end if;
4127:
4128: -- Create a schema attribute
4129: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.eng_schema,
4130: Wf_Engine.Current_Schema);
4131:
4132: -- Initialize all EVENT-type item attributes
4133: -- Not done here, it is deferred until GetItemAttrEvent
4134: /* for evtattr in evtcurs loop

Line 4136: Wf_Engine.SetItemAttrEvent(

4132: -- Initialize all EVENT-type item attributes
4133: -- Not done here, it is deferred until GetItemAttrEvent
4134: /* for evtattr in evtcurs loop
4135: Wf_Event_T.Initialize(l_event);
4136: Wf_Engine.SetItemAttrEvent(
4137: itemtype => itemtype,
4138: itemkey => itemkey,
4139: name => evtattr.name,
4140: event => l_event);

Line 4147: if ((itemkey = WF_ENGINE.eng_synch) and

4143: exception
4144: when others then
4145: -- Bug 4117740
4146: -- Call clearcache() when #SYNCH flow is in error
4147: if ((itemkey = WF_ENGINE.eng_synch) and
4148: (wf_core.error_name is null or wf_core.error_name <> 'WFENG_SYNCH_ITEM') and
4149: (not WF_ENGINE.debug)) then
4150: Wf_Item.ClearCache;
4151: end if;

Line 4149: (not WF_ENGINE.debug)) then

4145: -- Bug 4117740
4146: -- Call clearcache() when #SYNCH flow is in error
4147: if ((itemkey = WF_ENGINE.eng_synch) and
4148: (wf_core.error_name is null or wf_core.error_name <> 'WFENG_SYNCH_ITEM') and
4149: (not WF_ENGINE.debug)) then
4150: Wf_Item.ClearCache;
4151: end if;
4152:
4153: Wf_Core.Context('Wf_Engine', 'CreateProcess', itemtype, itemkey, process);

Line 4153: Wf_Core.Context('Wf_Engine', 'CreateProcess', itemtype, itemkey, process);

4149: (not WF_ENGINE.debug)) then
4150: Wf_Item.ClearCache;
4151: end if;
4152:
4153: Wf_Core.Context('Wf_Engine', 'CreateProcess', itemtype, itemkey, process);
4154: raise;
4155: end CreateProcess;
4156:
4157: --

Line 4174: Wf_Engine_Util.Start_Process_Internal(

4170: if (WF_CACHE.MetaRefreshed) then
4171: null;
4172: end if;
4173: --Bug 2259039
4174: Wf_Engine_Util.Start_Process_Internal(
4175: itemtype=> itemtype,
4176: itemkey => itemkey,
4177: runmode => 'START');
4178: exception

Line 4180: Wf_Core.Context('Wf_Engine', 'StartProcess', itemtype, itemkey);

4176: itemkey => itemkey,
4177: runmode => 'START');
4178: exception
4179: when others then
4180: Wf_Core.Context('Wf_Engine', 'StartProcess', itemtype, itemkey);
4181: raise;
4182: end StartProcess;
4183:
4184: --

Line 4212: wf_engine.CreateProcess (itemtype,itemkey,process);

4208: Wf_Core.Raise('WFSQL_ARGS');
4209:
4210: end if;
4211:
4212: wf_engine.CreateProcess (itemtype,itemkey,process);
4213:
4214: if userkey is not null then
4215: wf_engine.SetItemUserKey(itemtype,itemkey,userkey);
4216: end if;

Line 4215: wf_engine.SetItemUserKey(itemtype,itemkey,userkey);

4211:
4212: wf_engine.CreateProcess (itemtype,itemkey,process);
4213:
4214: if userkey is not null then
4215: wf_engine.SetItemUserKey(itemtype,itemkey,userkey);
4216: end if;
4217:
4218: if owner is not null then
4219: wf_engine.SetItemOwner(itemtype,itemkey,owner);

Line 4219: wf_engine.SetItemOwner(itemtype,itemkey,owner);

4215: wf_engine.SetItemUserKey(itemtype,itemkey,userkey);
4216: end if;
4217:
4218: if owner is not null then
4219: wf_engine.SetItemOwner(itemtype,itemkey,owner);
4220: end if;
4221:
4222: wf_engine.StartProcess (itemtype,itemkey);
4223: exception

Line 4222: wf_engine.StartProcess (itemtype,itemkey);

4218: if owner is not null then
4219: wf_engine.SetItemOwner(itemtype,itemkey,owner);
4220: end if;
4221:
4222: wf_engine.StartProcess (itemtype,itemkey);
4223: exception
4224: when others then
4225: Wf_Core.Context('Wf_Engine', 'LaunchProcess', itemtype, itemkey,
4226: process, userkey, owner);

Line 4225: Wf_Core.Context('Wf_Engine', 'LaunchProcess', itemtype, itemkey,

4221:
4222: wf_engine.StartProcess (itemtype,itemkey);
4223: exception
4224: when others then
4225: Wf_Core.Context('Wf_Engine', 'LaunchProcess', itemtype, itemkey,
4226: process, userkey, owner);
4227: raise;
4228: end LaunchProcess;
4229:

Line 4262: and ACTIVITY_STATUS = wf_engine.eng_deferred;

4258: select PROCESS_ACTIVITY, BEGIN_DATE
4259: from WF_ITEM_ACTIVITY_STATUSES
4260: where ITEM_TYPE = itemtype
4261: and ITEM_KEY = itemkey
4262: and ACTIVITY_STATUS = wf_engine.eng_deferred;
4263:
4264: begin
4265: -- Check Arguments
4266: if (itemtype is null) then

Line 4271: elsif (itemkey = wf_engine.eng_synch) then

4267: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4268: Wf_Core.Raise('WFSQL_ARGS');
4269:
4270: -- Not allowed in synch mode
4271: elsif (itemkey = wf_engine.eng_synch) then
4272: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
4273: wf_core.raise('WFENG_SYNCH_DISABLED');
4274:
4275: elsif (itemkey is null) then

Line 4272: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');

4268: Wf_Core.Raise('WFSQL_ARGS');
4269:
4270: -- Not allowed in synch mode
4271: elsif (itemkey = wf_engine.eng_synch) then
4272: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
4273: wf_core.raise('WFENG_SYNCH_DISABLED');
4274:
4275: elsif (itemkey is null) then
4276: WF_ENGINE.SuspendAll(itemtype, process); --

Line 4276: WF_ENGINE.SuspendAll(itemtype, process); --

4272: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
4273: wf_core.raise('WFENG_SYNCH_DISABLED');
4274:
4275: elsif (itemkey is null) then
4276: WF_ENGINE.SuspendAll(itemtype, process); --
4277: return;
4278:
4279: end if;
4280:

Line 4320: wf_engine.eng_process) then

4316:
4317: -- Check that activity is a PROCESS-type.
4318: -- Only PROCESS activities may be suspended.
4319: if (Wf_Activity.Instance_Type(procid, actdate) <>
4320: wf_engine.eng_process) then
4321: Wf_Core.Token('NAME', proc);
4322: Wf_Core.Token('TYPE', itemtype);
4323: Wf_Core.Raise('WFENG_PROCESS_NAME');
4324: end if;

Line 4340: wf_engine.eng_suspended, wf_engine.eng_null, null, null,

4336: if (status is null) then
4337: -- This process has not been run yet. Create a pre-suspended
4338: -- status row so engine does not run process later
4339: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4340: wf_engine.eng_suspended, wf_engine.eng_null, null, null,
4341: newStatus=>TRUE);
4342: elsif (status = wf_engine.eng_deferred) then
4343: -- Change status from 'deferred' to 'suspended'
4344: -- Doing this prevents the background processor from picking it up.

Line 4342: elsif (status = wf_engine.eng_deferred) then

4338: -- status row so engine does not run process later
4339: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4340: wf_engine.eng_suspended, wf_engine.eng_null, null, null,
4341: newStatus=>TRUE);
4342: elsif (status = wf_engine.eng_deferred) then
4343: -- Change status from 'deferred' to 'suspended'
4344: -- Doing this prevents the background processor from picking it up.
4345: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4346: wf_engine.eng_suspended, null,

Line 4346: wf_engine.eng_suspended, null,

4342: elsif (status = wf_engine.eng_deferred) then
4343: -- Change status from 'deferred' to 'suspended'
4344: -- Doing this prevents the background processor from picking it up.
4345: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4346: wf_engine.eng_suspended, null,
4347: null, null);
4348: elsif (status = wf_engine.eng_active) then
4349: -- Mark process as 'suspended', 'null' in WIAS table
4350: -- Doing this stops the engine from going through the rest of the flow

Line 4348: elsif (status = wf_engine.eng_active) then

4344: -- Doing this prevents the background processor from picking it up.
4345: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4346: wf_engine.eng_suspended, null,
4347: null, null);
4348: elsif (status = wf_engine.eng_active) then
4349: -- Mark process as 'suspended', 'null' in WIAS table
4350: -- Doing this stops the engine from going through the rest of the flow
4351: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4352: wf_engine.eng_suspended, null,

Line 4352: wf_engine.eng_suspended, null,

4348: elsif (status = wf_engine.eng_active) then
4349: -- Mark process as 'suspended', 'null' in WIAS table
4350: -- Doing this stops the engine from going through the rest of the flow
4351: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4352: wf_engine.eng_suspended, null,
4353: null, null);
4354:
4355: -- Suspend all the children processes
4356: Wf_Engine_Util.Suspend_Child_Processes(itemtype, itemkey, procid);

Line 4356: Wf_Engine_Util.Suspend_Child_Processes(itemtype, itemkey, procid);

4352: wf_engine.eng_suspended, null,
4353: null, null);
4354:
4355: -- Suspend all the children processes
4356: Wf_Engine_Util.Suspend_Child_Processes(itemtype, itemkey, procid);
4357: else
4358: Wf_Core.Token('TYPE', itemtype);
4359: Wf_Core.Token('KEY', itemkey);
4360: Wf_Core.Token('NAME', proc);

Line 4366: Wf_Core.Context('Wf_Engine', 'SuspendProcess', itemtype, itemkey, process);

4362: end if;
4363:
4364: exception
4365: when others then
4366: Wf_Core.Context('Wf_Engine', 'SuspendProcess', itemtype, itemkey, process);
4367: raise;
4368: end SuspendProcess;
4369:
4370: --

Line 4433: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode

4429: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4430: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
4431: Wf_Core.Raise('WFSQL_ARGS');
4432:
4433: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4434: wf_core.token('OPERATION', 'Wf_Engine.AbortProcess');
4435: wf_core.raise('WFENG_SYNCH_DISABLED');
4436: end if;
4437:

Line 4434: wf_core.token('OPERATION', 'Wf_Engine.AbortProcess');

4430: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
4431: Wf_Core.Raise('WFSQL_ARGS');
4432:
4433: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4434: wf_core.token('OPERATION', 'Wf_Engine.AbortProcess');
4435: wf_core.raise('WFENG_SYNCH_DISABLED');
4436: end if;
4437:
4438: --Do the check for lock ONLY if there is an explicit

Line 4449: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey, process);

4445:
4446: -- Get the root process for this key and also validate the item
4447: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4448: if (root is null) then
4449: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey, process);
4450: Wf_Core.Token('TYPE', itemtype);
4451: Wf_Core.Token('KEY', itemkey);
4452: Wf_Core.Raise('WFENG_ITEM');
4453: end if;

Line 4486: wf_engine.eng_process) then

4482:
4483: -- Check that activity is a PROCESS-type.
4484: -- Only PROCESS activities may be aborted.
4485: if (Wf_Activity.Instance_Type(procid, actdate) <>
4486: wf_engine.eng_process) then
4487: Wf_Core.Token('NAME', proc);
4488: Wf_Core.Token('TYPE', itemtype);
4489: Wf_Core.Raise('WFENG_PROCESS_NAME');
4490: end if;

Line 4507: elsif (status = wf_engine.eng_completed) then

4503: Wf_core.Token('NAME', proc);
4504: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4505: end if;
4506:
4507: elsif (status = wf_engine.eng_completed) then
4508: Wf_Core.Token('TYPE', itemtype);
4509: Wf_Core.Token('KEY', itemkey);
4510: Wf_Core.Token('NAME', proc);
4511: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');

Line 4516: wf_engine.eng_completed, result,

4512: else
4513: -- Mark process as 'COMPLETE', 'result' in WIAS table
4514: -- Doing this stops the engine from going through the rest of the flow
4515: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4516: wf_engine.eng_completed, result,
4517: null, SYSDATE);
4518:
4519: -- Kill child activities recursively
4520: Wf_Engine_Util.Process_Kill_Children(itemtype, itemkey, procid);

Line 4520: Wf_Engine_Util.Process_Kill_Children(itemtype, itemkey, procid);

4516: wf_engine.eng_completed, result,
4517: null, SYSDATE);
4518:
4519: -- Kill child activities recursively
4520: Wf_Engine_Util.Process_Kill_Children(itemtype, itemkey, procid);
4521: --If cascade option is set to true abort all child
4522: --processes aswell
4523: if cascade then
4524: Wf_Engine_Util.Process_Kill_ChildProcess(itemtype, itemkey);

Line 4524: Wf_Engine_Util.Process_Kill_ChildProcess(itemtype, itemkey);

4520: Wf_Engine_Util.Process_Kill_Children(itemtype, itemkey, procid);
4521: --If cascade option is set to true abort all child
4522: --processes aswell
4523: if cascade then
4524: Wf_Engine_Util.Process_Kill_ChildProcess(itemtype, itemkey);
4525: end if;
4526: end if;
4527:
4528: --Cancel any OPEN FYI notifications

Line 4542: wf_event.Raise(p_event_name => 'oracle.apps.wf.engine.abort',

4538: wf_event.AddParameterToList('PROCESS', process, l_parameterlist);
4539: wf_event.AddParameterToList('RESULT', result, l_parameterlist);
4540:
4541: -- Raise the event
4542: wf_event.Raise(p_event_name => 'oracle.apps.wf.engine.abort',
4543: p_event_key => itemkey,
4544: p_parameters => l_parameterlist);
4545:
4546: exception

Line 4553: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey,

4549: wf_core.token('KEY',itemkey);
4550: wf_core.raise('WFENG_RESOURCE_BUSY');
4551:
4552: when others then
4553: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey,
4554: process, result);
4555: raise;
4556: end AbortProcess;
4557:

Line 4588: and ACTIVITY_STATUS = wf_engine.eng_deferred;

4584: PROCESS_ACTIVITY, BEGIN_DATE
4585: from WF_ITEM_ACTIVITY_STATUSES
4586: where ITEM_TYPE = itemtype
4587: and ITEM_KEY = itemkey
4588: and ACTIVITY_STATUS = wf_engine.eng_deferred;
4589:
4590: actidarr InstanceArrayTyp; -- Deferred activities array
4591: i pls_integer := 0; -- Counter for the for loop
4592:

Line 4607: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode

4603: if (itemtype is null) then
4604: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4605: Wf_Core.Raise('WFSQL_ARGS');
4606:
4607: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4608: wf_core.token('OPERATION', 'Wf_Engine.ResumeProcess');
4609: wf_core.raise('WFENG_SYNCH_DISABLED');
4610:
4611: elsif (itemkey is NULL) then

Line 4608: wf_core.token('OPERATION', 'Wf_Engine.ResumeProcess');

4604: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4605: Wf_Core.Raise('WFSQL_ARGS');
4606:
4607: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4608: wf_core.token('OPERATION', 'Wf_Engine.ResumeProcess');
4609: wf_core.raise('WFENG_SYNCH_DISABLED');
4610:
4611: elsif (itemkey is NULL) then
4612: WF_ENGINE.ResumeAll(itemtype, process); --

Line 4612: WF_ENGINE.ResumeAll(itemtype, process); --

4608: wf_core.token('OPERATION', 'Wf_Engine.ResumeProcess');
4609: wf_core.raise('WFENG_SYNCH_DISABLED');
4610:
4611: elsif (itemkey is NULL) then
4612: WF_ENGINE.ResumeAll(itemtype, process); --
4613: return;
4614:
4615: end if;
4616:

Line 4656: wf_engine.eng_process) then

4652:
4653: -- Check that activity is a PROCESS-type.
4654: -- Only PROCESS activities may be resumed.
4655: if (Wf_Activity.Instance_Type(procid, actdate) <>
4656: wf_engine.eng_process) then
4657: Wf_Core.Token('NAME', proc);
4658: Wf_Core.Token('TYPE', itemtype);
4659: Wf_Core.Raise('WFENG_PROCESS_NAME');
4660: end if;

Line 4673: elsif (status <> wf_engine.eng_suspended) then

4669: Wf_Core.Token('TYPE', itemtype);
4670: Wf_Core.Token('KEY', itemkey);
4671: Wf_Core.Token('NAME', proc);
4672: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4673: elsif (status <> wf_engine.eng_suspended) then
4674: Wf_Core.Token('TYPE', itemtype);
4675: Wf_Core.Token('KEY', itemkey);
4676: Wf_Core.Token('NAME', proc);
4677: Wf_Core.Raise('WFENG_ITEM_PROCESS_SUSPENDED');

Line 4682: wf_engine.eng_active, null, null, null);

4678: else
4679: -- If we came here, that means the process is currently suspended.
4680: -- Mark process as eng_active 'active', 'null' in WIAS table
4681: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4682: wf_engine.eng_active, null, null, null);
4683:
4684: -- Mark any sub-processes as active again
4685: Wf_Engine_Util.Resume_Child_Processes(itemtype, itemkey, procid);
4686:

Line 4685: Wf_Engine_Util.Resume_Child_Processes(itemtype, itemkey, procid);

4681: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4682: wf_engine.eng_active, null, null, null);
4683:
4684: -- Mark any sub-processes as active again
4685: Wf_Engine_Util.Resume_Child_Processes(itemtype, itemkey, procid);
4686:
4687: -- Restart any activities that were deferred because completion
4688: -- came in while process was suspended.
4689: --

Line 4716: wf_engine.eng_active, null, sysdate, null);

4712: --Also set the status to active only if begin_date <= sysdate
4713:
4714: if (nvl(act_begin_date(i),sysdate) <= sysdate) then
4715: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actidarr(i),
4716: wf_engine.eng_active, null, sysdate, null);
4717: begin
4718: savepoint wf_savepoint;
4719: Wf_Engine_Util.Process_Activity(itemtype, itemkey, actidarr(i),
4720: Wf_Engine.Threshold, TRUE);

Line 4719: Wf_Engine_Util.Process_Activity(itemtype, itemkey, actidarr(i),

4715: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actidarr(i),
4716: wf_engine.eng_active, null, sysdate, null);
4717: begin
4718: savepoint wf_savepoint;
4719: Wf_Engine_Util.Process_Activity(itemtype, itemkey, actidarr(i),
4720: Wf_Engine.Threshold, TRUE);
4721: exception
4722: when trig_savepoint or dist_savepoint then
4723: -- Can't restart process here, re-defer for the

Line 4720: Wf_Engine.Threshold, TRUE);

4716: wf_engine.eng_active, null, sysdate, null);
4717: begin
4718: savepoint wf_savepoint;
4719: Wf_Engine_Util.Process_Activity(itemtype, itemkey, actidarr(i),
4720: Wf_Engine.Threshold, TRUE);
4721: exception
4722: when trig_savepoint or dist_savepoint then
4723: -- Can't restart process here, re-defer for the
4724: -- background process to pick up.

Line 4726: actidarr(i),wf_engine.eng_deferred, null, sysdate, null);

4722: when trig_savepoint or dist_savepoint then
4723: -- Can't restart process here, re-defer for the
4724: -- background process to pick up.
4725: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey,
4726: actidarr(i),wf_engine.eng_deferred, null, sysdate, null);
4727: when others then
4728: -- If anything in this process raises an exception:
4729: -- 1. rollback any work in this process thread
4730: -- 2. set this activity to error status

Line 4734: Wf_Core.Context('Wf_Engine', 'ResumeProcess', itemtype, itemkey,

4730: -- 2. set this activity to error status
4731: -- 3. execute the error process (if any)
4732: -- 4. clear the error to continue with next activity
4733: rollback to wf_savepoint;
4734: Wf_Core.Context('Wf_Engine', 'ResumeProcess', itemtype, itemkey,
4735: process);
4736: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actidarr(i),
4737: wf_engine.eng_exception, FALSE);
4738: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actidarr(i),

Line 4737: wf_engine.eng_exception, FALSE);

4733: rollback to wf_savepoint;
4734: Wf_Core.Context('Wf_Engine', 'ResumeProcess', itemtype, itemkey,
4735: process);
4736: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actidarr(i),
4737: wf_engine.eng_exception, FALSE);
4738: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actidarr(i),
4739: wf_engine.eng_exception);
4740:
4741: Wf_Core.Clear;

Line 4738: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actidarr(i),

4734: Wf_Core.Context('Wf_Engine', 'ResumeProcess', itemtype, itemkey,
4735: process);
4736: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actidarr(i),
4737: wf_engine.eng_exception, FALSE);
4738: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actidarr(i),
4739: wf_engine.eng_exception);
4740:
4741: Wf_Core.Clear;
4742: end;

Line 4739: wf_engine.eng_exception);

4735: process);
4736: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actidarr(i),
4737: wf_engine.eng_exception, FALSE);
4738: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actidarr(i),
4739: wf_engine.eng_exception);
4740:
4741: Wf_Core.Clear;
4742: end;
4743: --else case status is same as right now that is deferred.

Line 4752: Wf_Core.Context('Wf_Engine', 'ResumeProcess', itemtype, itemkey, process);

4748: end if;
4749:
4750: exception
4751: when others then
4752: Wf_Core.Context('Wf_Engine', 'ResumeProcess', itemtype, itemkey, process);
4753: raise;
4754: end ResumeProcess;
4755:
4756:

Line 4783: WF_ENGINE.SuspendProcess(c.item_type, c.item_key, p_process);

4779:
4780: if (p_itemType is NULL) then
4781: for c in All_Open_items loop
4782: begin
4783: WF_ENGINE.SuspendProcess(c.item_type, c.item_key, p_process);
4784:
4785: exception
4786: when others then
4787: if ( wf_core.error_name = 'WFENG_ITEM_PROCESS_ACTIVE' ) then

Line 4802: WF_ENGINE.SuspendProcess(p_itemType, c.item_key, p_process);

4798:
4799: else
4800: for c in Open_Items(p_itemType) loop
4801: begin
4802: WF_ENGINE.SuspendProcess(p_itemType, c.item_key, p_process);
4803:
4804: exception
4805: when others then
4806: if ( wf_core.error_name = 'WFENG_ITEM_PROCESS_ACTIVE' ) then

Line 4821: Wf_Core.Context('Wf_Engine', 'SuspendAll', p_itemType, p_process);

4817: end if;
4818:
4819: exception
4820: when others then
4821: Wf_Core.Context('Wf_Engine', 'SuspendAll', p_itemType, p_process);
4822: raise;
4823:
4824: end SuspendAll;
4825:

Line 4839: AND wias.activity_status = wf_engine.eng_suspended;

4835: cursor suspended_items(p_itemType in varchar2) is
4836: SELECT distinct wias.item_key
4837: FROM wf_item_activity_statuses wias
4838: WHERE wias.item_type = p_itemType
4839: AND wias.activity_status = wf_engine.eng_suspended;
4840:
4841: cursor all_suspended_items is
4842: SELECT distinct wias.item_type, wias.item_key
4843: FROM wf_item_activity_statuses wias

Line 4844: WHERE wias.activity_status = wf_engine.eng_suspended;

4840:
4841: cursor all_suspended_items is
4842: SELECT distinct wias.item_type, wias.item_key
4843: FROM wf_item_activity_statuses wias
4844: WHERE wias.activity_status = wf_engine.eng_suspended;
4845:
4846: begin
4847:
4848: if (p_itemType is NULL) then

Line 4851: WF_ENGINE.ResumeProcess(c.item_type, c.item_key, p_process);

4847:
4848: if (p_itemType is NULL) then
4849: for c in all_suspended_items loop
4850: begin
4851: WF_ENGINE.ResumeProcess(c.item_type, c.item_key, p_process);
4852:
4853: exception
4854: when others then
4855: null;

Line 4864: WF_ENGINE.ResumeProcess(p_itemType, c.item_key, p_process);

4860:
4861: else
4862: for c in suspended_items(p_itemType) loop
4863: begin
4864: WF_ENGINE.ResumeProcess(p_itemType, c.item_key, p_process);
4865:
4866: exception
4867: when others then
4868: null;

Line 4912: if (new_itemkey = wf_engine.eng_synch)

4908: Wf_Core.Raise('WFSQL_ARGS');
4909: end if;
4910:
4911: -- Not allowed in synch mode
4912: if (new_itemkey = wf_engine.eng_synch)
4913: or (copy_itemkey = wf_engine.eng_synch) then
4914: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
4915: wf_core.raise('WFENG_SYNCH_DISABLED');
4916: end if;

Line 4913: or (copy_itemkey = wf_engine.eng_synch) then

4909: end if;
4910:
4911: -- Not allowed in synch mode
4912: if (new_itemkey = wf_engine.eng_synch)
4913: or (copy_itemkey = wf_engine.eng_synch) then
4914: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
4915: wf_core.raise('WFENG_SYNCH_DISABLED');
4916: end if;
4917:

Line 4914: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');

4910:
4911: -- Not allowed in synch mode
4912: if (new_itemkey = wf_engine.eng_synch)
4913: or (copy_itemkey = wf_engine.eng_synch) then
4914: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
4915: wf_core.raise('WFENG_SYNCH_DISABLED');
4916: end if;
4917:
4918: -- Check status

Line 4919: Wf_engine.ItemStatus(copy_itemtype, copy_itemkey, status, result);

4915: wf_core.raise('WFENG_SYNCH_DISABLED');
4916: end if;
4917:
4918: -- Check status
4919: Wf_engine.ItemStatus(copy_itemtype, copy_itemkey, status, result);
4920: if (status = wf_engine.eng_error) then
4921: Wf_Core.Raise('WFENG_NOFORK_ONERROR');
4922: end if;
4923:

Line 4920: if (status = wf_engine.eng_error) then

4916: end if;
4917:
4918: -- Check status
4919: Wf_engine.ItemStatus(copy_itemtype, copy_itemkey, status, result);
4920: if (status = wf_engine.eng_error) then
4921: Wf_Core.Raise('WFENG_NOFORK_ONERROR');
4922: end if;
4923:
4924: -- Check for duplicate item

Line 4964: wf_engine.CreateProcess(copy_itemtype,new_itemkey,root_process);

4960: itemkey => copy_itemkey,
4961: wflow => root_process,
4962: version =>root_process_version);
4963:
4964: wf_engine.CreateProcess(copy_itemtype,new_itemkey,root_process);
4965:
4966: --delete any defaulted attributes because we will copy the existing ones.
4967: delete from wf_item_attribute_values
4968: where item_type = copy_itemtype

Line 5001: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,

4997: and name not like '#CNT_');
4998:
4999:
5000: -- reset the access_keys to make them unique
5001: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5002: wf_engine.wfmon_mon_key, Wf_Core.Random);
5003: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5004: wf_engine.wfmon_acc_key, Wf_Core.Random);
5005:

Line 5002: wf_engine.wfmon_mon_key, Wf_Core.Random);

4998:
4999:
5000: -- reset the access_keys to make them unique
5001: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5002: wf_engine.wfmon_mon_key, Wf_Core.Random);
5003: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5004: wf_engine.wfmon_acc_key, Wf_Core.Random);
5005:
5006:

Line 5003: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,

4999:
5000: -- reset the access_keys to make them unique
5001: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5002: wf_engine.wfmon_mon_key, Wf_Core.Random);
5003: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5004: wf_engine.wfmon_acc_key, Wf_Core.Random);
5005:
5006:
5007: -- reset the schema, just in case, if the #SCHEMA attribute does not exist

Line 5004: wf_engine.wfmon_acc_key, Wf_Core.Random);

5000: -- reset the access_keys to make them unique
5001: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5002: wf_engine.wfmon_mon_key, Wf_Core.Random);
5003: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5004: wf_engine.wfmon_acc_key, Wf_Core.Random);
5005:
5006:
5007: -- reset the schema, just in case, if the #SCHEMA attribute does not exist
5008: -- it will be added. The CreateProcess api now adds the #SCHEMA.

Line 5009: -- Only items created before WF_ENGINE was upgraded will encounter the

5005:
5006:
5007: -- reset the schema, just in case, if the #SCHEMA attribute does not exist
5008: -- it will be added. The CreateProcess api now adds the #SCHEMA.
5009: -- Only items created before WF_ENGINE was upgraded will encounter the
5010: -- exception to be handled, so this is for backward compatibility.
5011:
5012: begin
5013: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,

Line 5013: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,

5009: -- Only items created before WF_ENGINE was upgraded will encounter the
5010: -- exception to be handled, so this is for backward compatibility.
5011:
5012: begin
5013: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5014: wf_engine.eng_schema, Wf_Engine.Current_Schema);
5015:
5016: exception
5017: when others then

Line 5014: wf_engine.eng_schema, Wf_Engine.Current_Schema);

5010: -- exception to be handled, so this is for backward compatibility.
5011:
5012: begin
5013: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5014: wf_engine.eng_schema, Wf_Engine.Current_Schema);
5015:
5016: exception
5017: when others then
5018: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then

Line 5020: WF_ENGINE.AddItemAttr(copy_itemtype, new_itemkey,

5016: exception
5017: when others then
5018: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
5019: wf_core.clear;
5020: WF_ENGINE.AddItemAttr(copy_itemtype, new_itemkey,
5021: wf_engine.eng_schema,
5022: Wf_Engine.Current_Schema);
5023:
5024: else

Line 5021: wf_engine.eng_schema,

5017: when others then
5018: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
5019: wf_core.clear;
5020: WF_ENGINE.AddItemAttr(copy_itemtype, new_itemkey,
5021: wf_engine.eng_schema,
5022: Wf_Engine.Current_Schema);
5023:
5024: else
5025:

Line 5022: Wf_Engine.Current_Schema);

5018: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
5019: wf_core.clear;
5020: WF_ENGINE.AddItemAttr(copy_itemtype, new_itemkey,
5021: wf_engine.eng_schema,
5022: Wf_Engine.Current_Schema);
5023:
5024: else
5025:
5026: raise;

Line 5034: Wf_Engine.AddItemAttr(copy_itemtype, new_itemkey, '#FORKED_FROM',

5030: end;
5031:
5032: -- Finally set an itemkey to record what this originated from
5033: begin
5034: Wf_Engine.AddItemAttr(copy_itemtype, new_itemkey, '#FORKED_FROM',
5035: copy_itemkey);
5036: exception
5037: when others then
5038: --

Line 5043: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,

5039: -- If item attribute already exists then ignore the error
5040: --
5041: if ( wf_core.error_name = 'WFENG_ITEM_ATTR_UNIQUE' ) then
5042: wf_core.clear;
5043: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5044: '#FORKED_FROM', copy_itemkey);
5045: else
5046: raise;
5047: end if;

Line 5054: dummyNum := WF_ENGINE.AddToItemAttrNumber(copy_itemType, new_itemKey,

5050: if (masterdetail) then
5051: --The caller has signaled that this is a master/detail process
5052: --We first will attempt to zero out any #WAITFORDETAIL attribute that may be
5053: --on this forked process (it is a master itself).
5054: dummyNum := WF_ENGINE.AddToItemAttrNumber(copy_itemType, new_itemKey,
5055: '#WAITFORDETAIL',
5056: to_number(NULL));
5057:
5058: if ((l_parent_itemType is NOT null) and (l_parent_itemKey is NOT null)) then

Line 5061: if (WF_ENGINE.AddToItemAttrNumber(l_parent_itemType, l_parent_itemKey,

5057:
5058: if ((l_parent_itemType is NOT null) and (l_parent_itemKey is NOT null)) then
5059: --There is a parent item to this forked item, so we will validate and
5060: --increment the parent's #WAITFORDETAIL counter.
5061: if (WF_ENGINE.AddToItemAttrNumber(l_parent_itemType, l_parent_itemKey,
5062: '#WAITFORDETAIL', 1) is NOT null) then
5063: --The parent has a #WAITFORDETAIL, so we can proceed on to check for
5064: --parent context.
5065: if (l_parent_context is NOT null) then

Line 5070: WF_ENGINE.AddItemAttr(itemtype=>copy_itemType, itemkey=>new_itemkey,

5066: --There is a parent context, so we will add the #LBL_ attribute to
5067: --the child flow, and will increment the corresponding #CNT_ attribute
5068: --in the parent flow.
5069: begin
5070: WF_ENGINE.AddItemAttr(itemtype=>copy_itemType, itemkey=>new_itemkey,
5071: aname=>'#LBL_'||l_parent_context,
5072: text_value=>l_parent_context);
5073:
5074: --Since there was a parent context in the forked_from flow, we know

Line 5076: dummyNum := WF_ENGINE.AddToItemAttrNumber(l_parent_itemType,

5072: text_value=>l_parent_context);
5073:
5074: --Since there was a parent context in the forked_from flow, we know
5075: --The parent has a counter for this label, so we can just increment.
5076: dummyNum := WF_ENGINE.AddToItemAttrNumber(l_parent_itemType,
5077: l_parent_itemKey,
5078: '#CNT_'||l_parent_context,
5079: 1);
5080: exception

Line 5082: Wf_Core.Context('WF_ENGINE', 'CreateForkProcess', copy_itemtype,

5078: '#CNT_'||l_parent_context,
5079: 1);
5080: exception
5081: when ValTooLarge then
5082: Wf_Core.Context('WF_ENGINE', 'CreateForkProcess', copy_itemtype,
5083: copy_itemkey, new_itemkey, l_parent_itemtype,
5084: l_parent_itemkey, l_parent_context, 'TRUE');
5085: WF_CORE.Token('LABEL', l_parent_context);
5086: WF_CORE.Token('LENGTH', 25);

Line 5104: Wf_Core.Context('Wf_Engine', 'CreateForkProcess');

5100: end if; --There is a parent item to this forked process.
5101: end if; --The caller signalled that this is a master/detail process.
5102: exception
5103: when others then
5104: Wf_Core.Context('Wf_Engine', 'CreateForkProcess');
5105: raise;
5106: end CreateForkProcess;
5107:
5108:

Line 5196: copy_itemkey := Wf_Engine.GetItemAttrText(itemtype, itemkey,'#FORKED_FROM');

5192:
5193: -- get the forked_from attribute: if it doesnt exist then this cannot be
5194: -- a forked item
5195: begin
5196: copy_itemkey := Wf_Engine.GetItemAttrText(itemtype, itemkey,'#FORKED_FROM');
5197: exception when others then
5198: Wf_Core.Raise('WF_NOFORK');
5199: end;
5200:

Line 5203: if (itemkey = wf_engine.eng_synch)

5199: end;
5200:
5201:
5202: -- Not allowed in synch mode
5203: if (itemkey = wf_engine.eng_synch)
5204: or (copy_itemkey = wf_engine.eng_synch) then
5205: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
5206: wf_core.raise('WFENG_SYNCH_DISABLED');
5207: end if;

Line 5204: or (copy_itemkey = wf_engine.eng_synch) then

5200:
5201:
5202: -- Not allowed in synch mode
5203: if (itemkey = wf_engine.eng_synch)
5204: or (copy_itemkey = wf_engine.eng_synch) then
5205: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
5206: wf_core.raise('WFENG_SYNCH_DISABLED');
5207: end if;
5208:

Line 5205: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');

5201:
5202: -- Not allowed in synch mode
5203: if (itemkey = wf_engine.eng_synch)
5204: or (copy_itemkey = wf_engine.eng_synch) then
5205: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
5206: wf_core.raise('WFENG_SYNCH_DISABLED');
5207: end if;
5208:
5209:

Line 5255: wf_engine.startprocess(itemtype,itemkey);

5251: if copy_root_process <> new_root_process
5252: or copy_process_version <> new_process_version
5253: or copy_active_date <> new_active_date then
5254: begin
5255: wf_engine.startprocess(itemtype,itemkey);
5256: exception when others then
5257: Wf_Core.raise('WF_CANNOT_FORK');
5258: end;
5259: return;

Line 5272: if act.activity_status = wf_engine.eng_completed then

5268:
5269: if act.notification_id is not null then
5270:
5271: --if complete then copy else ignore (we re-execute later)
5272: if act.activity_status = wf_engine.eng_completed then
5273: wf_engine_util.notification_copy (act.notification_id,
5274: act.item_key, itemkey, nid);
5275: end if;
5276:

Line 5273: wf_engine_util.notification_copy (act.notification_id,

5269: if act.notification_id is not null then
5270:
5271: --if complete then copy else ignore (we re-execute later)
5272: if act.activity_status = wf_engine.eng_completed then
5273: wf_engine_util.notification_copy (act.notification_id,
5274: act.item_key, itemkey, nid);
5275: end if;
5276:
5277: elsif act.activity_status = wf_engine.eng_deferred then

Line 5277: elsif act.activity_status = wf_engine.eng_deferred then

5273: wf_engine_util.notification_copy (act.notification_id,
5274: act.item_key, itemkey, nid);
5275: end if;
5276:
5277: elsif act.activity_status = wf_engine.eng_deferred then
5278:
5279: --process defered activity
5280: act_fname:= Wf_Activity.activity_function
5281: (act.item_type,act.item_key,act.process_activity);

Line 5357: wf_engine_util.notification_copy (hist.notification_id,

5353: for hist in all_activities_hist loop
5354:
5355: nid := null;
5356: if hist.notification_id is not null then
5357: wf_engine_util.notification_copy (hist.notification_id,
5358: hist.item_key, itemkey, nid);
5359: end if;
5360:
5361: -- now insert the status

Line 5381: set activity_status = wf_engine.eng_notified

5377:
5378: -- update any active functions to notified state
5379: begin
5380: update wf_item_activity_statuses ias
5381: set activity_status = wf_engine.eng_notified
5382: where item_type = itemtype
5383: and item_key = itemkey
5384: and activity_status = 'ACTIVE'
5385: and activity_status = wf_engine.eng_active

Line 5385: and activity_status = wf_engine.eng_active

5381: set activity_status = wf_engine.eng_notified
5382: where item_type = itemtype
5383: and item_key = itemkey
5384: and activity_status = 'ACTIVE'
5385: and activity_status = wf_engine.eng_active
5386: and exists (select 'its a function, not subprocess'
5387: from wf_process_activities pa,
5388: wf_activities ac
5389: where pa.activity_name = ac.name

Line 5398: wf_engine_util.notification_refresh(itemtype,itemkey);

5394: end;
5395:
5396:
5397: -- update item attributes on all copied notifications
5398: wf_engine_util.notification_refresh(itemtype,itemkey);
5399:
5400:
5401: -- as last step, launch all notifications still open
5402: -- keep this as last step because routing rules may allow

Line 5406: Wf_Engine_Util.Process_Activity(itemtype, itemkey,

5402: -- keep this as last step because routing rules may allow
5403: -- continuation of thread.
5404:
5405: for ntf in ntf_open loop
5406: Wf_Engine_Util.Process_Activity(itemtype, itemkey,
5407: ntf.process_activity,wf_engine.threshold);
5408: end loop;
5409:
5410:

Line 5407: ntf.process_activity,wf_engine.threshold);

5403: -- continuation of thread.
5404:
5405: for ntf in ntf_open loop
5406: Wf_Engine_Util.Process_Activity(itemtype, itemkey,
5407: ntf.process_activity,wf_engine.threshold);
5408: end loop;
5409:
5410:
5411: exception

Line 5413: Wf_Core.Context('Wf_Engine', 'StartForkProcess');

5409:
5410:
5411: exception
5412: when others then
5413: Wf_Core.Context('Wf_Engine', 'StartForkProcess');
5414: raise;
5415: end StartForkProcess;
5416:
5417:

Line 5440: if (itemkey = wf_engine.eng_synch) then

5436: actdate date; -- Active date of item
5437: actid pls_integer; -- activity instance id
5438: begin
5439: -- Not allowed in synch mode
5440: if (itemkey = wf_engine.eng_synch) then
5441: wf_core.token('OPERATION', 'Wf_Engine.BeginActivity');
5442: wf_core.raise('WFENG_SYNCH_DISABLED');
5443: end if;
5444:

Line 5441: wf_core.token('OPERATION', 'Wf_Engine.BeginActivity');

5437: actid pls_integer; -- activity instance id
5438: begin
5439: -- Not allowed in synch mode
5440: if (itemkey = wf_engine.eng_synch) then
5441: wf_core.token('OPERATION', 'Wf_Engine.BeginActivity');
5442: wf_core.raise('WFENG_SYNCH_DISABLED');
5443: end if;
5444:
5445: -- Argument validation

Line 5471: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey, activity);

5467: -- Note must do this here, instead of relying on CreateProcess
5468: -- to call the selector, because CreateProcess can't take the
5469: -- start activity as an argument to implicitly choose a root
5470: -- process when no selector function is defined.
5471: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey, activity);
5472: if (root is null) then
5473: Wf_Core.Token('TYPE', itemtype);
5474: Wf_Core.Token('KEY', itemkey);
5475: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');

Line 5482: activity, wf_engine.eng_notified);

5478: else
5479: -- Item exists. Must be case (2).
5480: -- Check that the activity is currently notified.
5481: actid := Wf_Process_Activity.ActiveInstanceId(itemtype, itemkey,
5482: activity, wf_engine.eng_notified);
5483:
5484: -- Any other status, or no status at all, is an error.
5485: if (actid is null) then
5486: Wf_Core.Token('TYPE', itemtype);

Line 5495: Wf_Core.Context('Wf_Engine', 'BeginActivity', itemtype, itemkey, activity);

5491:
5492: end if;
5493: exception
5494: when others then
5495: Wf_Core.Context('Wf_Engine', 'BeginActivity', itemtype, itemkey, activity);
5496: raise;
5497: end BeginActivity;
5498:
5499: --

Line 5568: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey, activity);

5564: -- Note must do this here, instead of relying on CreateProcess
5565: -- to call the selector, because CreateProcess can't take the
5566: -- start activity as an argument to implicitly choose a root
5567: -- process when no selector function is defined.
5568: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey, activity);
5569: if (root is null) then
5570: Wf_Core.Token('TYPE', itemtype);
5571: Wf_Core.Token('KEY', itemkey);
5572: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');

Line 5576: Wf_Engine.CreateProcess(itemtype, itemkey, root);

5572: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
5573: end if;
5574:
5575: -- Create new process
5576: Wf_Engine.CreateProcess(itemtype, itemkey, root);
5577:
5578: --Bug 2259039
5579: -- Start the process for this activity.
5580: -- The activity to be completed will be left in NOTIFIED status

Line 5582: Wf_Engine_Util.Start_Process_Internal(

5578: --Bug 2259039
5579: -- Start the process for this activity.
5580: -- The activity to be completed will be left in NOTIFIED status
5581: -- as a side-effect of this call.
5582: Wf_Engine_Util.Start_Process_Internal(
5583: itemtype => itemtype,
5584: itemkey => itemkey,
5585: runmode => 'ACTIVITY');
5586:

Line 5596: wf_engine.eng_active, wf_engine.eng_null, sysdate, null, newStatus=>TRUE);

5592: activity);
5593:
5594: -- Create a status row for new activity
5595: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
5596: wf_engine.eng_active, wf_engine.eng_null, sysdate, null, newStatus=>TRUE);
5597: else
5598:
5599: --Bug 2607770
5600: --Its only in the else condition that you need to get

Line 5607: activity, wf_engine.eng_notified);

5603:
5604: -- Item exists. Must be case (2).
5605: -- Check that the activity is currently notified.
5606: actid := Wf_Process_Activity.ActiveInstanceId(itemtype, itemkey,
5607: activity, wf_engine.eng_notified);
5608:
5609: -- Any other status, or no status at all, is an error.
5610: if (actid is null) then
5611: Wf_Core.Token('TYPE', itemtype);

Line 5620: if (itemkey <> wf_engine.eng_synch) then

5616:
5617: --If acquire lock returns true we will continue
5618: --If it returns false we raise exception to the user
5619: --Any other exception we let the caller decide what to do
5620: if (itemkey <> wf_engine.eng_synch) then
5621: --If its an async process and you cannot acquire a lock
5622: --raise the exception to the user
5623: l_lock := wf_item.acquire_lock(itemtype,itemkey,true);
5624: end if;

Line 5646: if (itemkey = wf_engine.eng_synch) then

5642: end if;
5643: end if;
5644:
5645: -- Finally, complete our lovely new activity.
5646: if (itemkey = wf_engine.eng_synch) then
5647: -- SYNCHMODE: No error trapping in synchmode.
5648: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);
5649: else
5650: begin

Line 5648: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);

5644:
5645: -- Finally, complete our lovely new activity.
5646: if (itemkey = wf_engine.eng_synch) then
5647: -- SYNCHMODE: No error trapping in synchmode.
5648: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);
5649: else
5650: begin
5651: savepoint wf_savepoint;
5652: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);

Line 5652: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);

5648: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);
5649: else
5650: begin
5651: savepoint wf_savepoint;
5652: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);
5653: exception
5654: when trig_savepoint or dist_savepoint then
5655: -- You must be in a restricted environment,
5656: -- no fancy error processing for you!

Line 5662: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);

5658: -- deferring directly, because the activity must be marked as
5659: -- complete. Any following activities started by completing
5660: -- this activity will be caught and deferred in another
5661: -- savepoint trap in process_activity.
5662: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);
5663: when others then
5664: -- If anything in this process raises an exception:
5665: -- 1. rollback any work in this process thread
5666: -- 2. set this activity to error status

Line 5670: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,

5666: -- 2. set this activity to error status
5667: -- 3. execute the error process (if any)
5668: -- 4. clear the error to continue with next activity
5669: rollback to wf_savepoint;
5670: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,
5671: activity, result);
5672: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
5673: wf_engine.eng_exception, FALSE);
5674: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,

Line 5673: wf_engine.eng_exception, FALSE);

5669: rollback to wf_savepoint;
5670: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,
5671: activity, result);
5672: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
5673: wf_engine.eng_exception, FALSE);
5674: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
5675: wf_engine.eng_exception);
5676: Wf_Core.Clear;
5677: end;

Line 5674: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,

5670: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,
5671: activity, result);
5672: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
5673: wf_engine.eng_exception, FALSE);
5674: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
5675: wf_engine.eng_exception);
5676: Wf_Core.Clear;
5677: end;
5678: end if;

Line 5675: wf_engine.eng_exception);

5671: activity, result);
5672: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
5673: wf_engine.eng_exception, FALSE);
5674: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
5675: wf_engine.eng_exception);
5676: Wf_Core.Clear;
5677: end;
5678: end if;
5679:

Line 5686: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,

5682: wf_core.token('TYPE',itemtype);
5683: wf_core.token('KEY',itemkey);
5684: wf_core.raise('WFENG_RESOURCE_BUSY');
5685: when others then
5686: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,
5687: activity, result);
5688: raise;
5689: end CompleteActivity;
5690:

Line 5722: if (itemkey = wf_engine.eng_synch) then

5718: actname varchar2(30);
5719: label varchar2(30);
5720: begin
5721: -- Not allowed in synch mode
5722: if (itemkey = wf_engine.eng_synch) then
5723: wf_core.token('OPERATION', 'Wf_Engine.CompleteActivityInternalName');
5724: wf_core.raise('WFENG_SYNCH_DISABLED');
5725: end if;
5726:

Line 5723: wf_core.token('OPERATION', 'Wf_Engine.CompleteActivityInternalName');

5719: label varchar2(30);
5720: begin
5721: -- Not allowed in synch mode
5722: if (itemkey = wf_engine.eng_synch) then
5723: wf_core.token('OPERATION', 'Wf_Engine.CompleteActivityInternalName');
5724: wf_core.raise('WFENG_SYNCH_DISABLED');
5725: end if;
5726:
5727: -- Argument validation

Line 5754: and WIAS.ACTIVITY_STATUS = wf_engine.eng_notified

5750: into process, label
5751: from WF_ITEM_ACTIVITY_STATUSES WIAS, WF_PROCESS_ACTIVITIES WPA
5752: where WIAS.ITEM_TYPE = itemtype
5753: and WIAS.ITEM_KEY = itemkey
5754: and WIAS.ACTIVITY_STATUS = wf_engine.eng_notified
5755: and WIAS.PROCESS_ACTIVITY = WPA.INSTANCE_ID
5756: and WPA.ACTIVITY_NAME = actname
5757: and WPA.PROCESS_NAME = nvl(process, WPA.PROCESS_NAME);
5758: exception

Line 5767: Wf_Engine.CompleteActivity(itemtype, itemkey, process||':'||label,

5763: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5764: end;
5765:
5766: -- Complete activity with the correct arguments
5767: Wf_Engine.CompleteActivity(itemtype, itemkey, process||':'||label,
5768: result);
5769:
5770: exception
5771: when others then

Line 5772: Wf_Core.Context('Wf_Engine', 'CompleteActivityInternalName',

5768: result);
5769:
5770: exception
5771: when others then
5772: Wf_Core.Context('Wf_Engine', 'CompleteActivityInternalName',
5773: itemtype, itemkey, activity, result);
5774: raise;
5775: end CompleteActivityInternalName;
5776:

Line 5812: if (itemkey = wf_engine.eng_synch) then

5808: msgtype varchar2(8);
5809: expand_role varchar2(1);
5810: begin
5811: -- Not allowed in synch mode
5812: if (itemkey = wf_engine.eng_synch) then
5813: wf_core.token('OPERATION', 'Wf_Engine.AssignActivity');
5814: wf_core.raise('WFENG_SYNCH_DISABLED');
5815: end if;
5816:

Line 5813: wf_core.token('OPERATION', 'Wf_Engine.AssignActivity');

5809: expand_role varchar2(1);
5810: begin
5811: -- Not allowed in synch mode
5812: if (itemkey = wf_engine.eng_synch) then
5813: wf_core.token('OPERATION', 'Wf_Engine.AssignActivity');
5814: wf_core.raise('WFENG_SYNCH_DISABLED');
5815: end if;
5816:
5817: -- Argument validation

Line 5858: if (acttype <> wf_engine.eng_notification) then

5854: end if;
5855:
5856: -- Check if this activity is a notification type of activity
5857: acttype := Wf_Activity.Type(itemtype, activity, actdate);
5858: if (acttype <> wf_engine.eng_notification) then
5859: Wf_Core.Token('NAME', activity);
5860: Wf_Core.Raise('WFENG_NOTIFICATION_NAME');
5861: end if;
5862:

Line 5869: wf_engine.eng_waiting, '', null, null, newStatus=>TRUE);

5865:
5866: if (status is null) then
5867: -- Insert one row with the performer
5868: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
5869: wf_engine.eng_waiting, '', null, null, newStatus=>TRUE);
5870: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5871: '', performer);
5872: elsif (status = wf_engine.eng_waiting) then
5873: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,

Line 5872: elsif (status = wf_engine.eng_waiting) then

5868: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
5869: wf_engine.eng_waiting, '', null, null, newStatus=>TRUE);
5870: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5871: '', performer);
5872: elsif (status = wf_engine.eng_waiting) then
5873: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5874: '', performer);
5875: elsif (status in (wf_engine.eng_notified, wf_engine.eng_error)) then
5876: -- Check this is not a voting activity.

Line 5875: elsif (status in (wf_engine.eng_notified, wf_engine.eng_error)) then

5871: '', performer);
5872: elsif (status = wf_engine.eng_waiting) then
5873: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5874: '', performer);
5875: elsif (status in (wf_engine.eng_notified, wf_engine.eng_error)) then
5876: -- Check this is not a voting activity.
5877: -- Voting activities cannot be re-assigned.
5878: Wf_Activity.Notification_Info(itemtype, itemkey, actid, msg, msgtype,
5879: expand_role);

Line 5894: if (reassignType = Wf_Engine.eng_delegate) then

5890: notid, performer);
5891:
5892: if (notid is not null) then
5893: -- 16-DEC-03 shanjgik bug fix 2722369 check for reassignType added
5894: if (reassignType = Wf_Engine.eng_delegate) then
5895: -- delegate the notification
5896: Wf_Notification.Forward(notid, performer, ntfComments);
5897: else -- case reassignType is TRANSFER or null
5898: -- Call Wf_Notification.Transfer(notid, performer) to transfer

Line 5914: Wf_Core.Context('Wf_Engine', 'AssignActivity', itemtype, itemkey,

5910: end if;
5911:
5912: EXCEPTION
5913: when OTHERS then
5914: Wf_Core.Context('Wf_Engine', 'AssignActivity', itemtype, itemkey,
5915: activity, performer);
5916: raise;
5917: end AssignActivity;
5918:

Line 5973: if (not Wf_Engine_Util.Reset_Tree(itemtype, itemkey, rootid,

5969: -- This reset behaves similar to loop reset, cancelling activities,
5970: -- moving rows to history, etc. It then resets the activity status
5971: -- to active, AND resets or creates status rows for any parent process
5972: -- to active if necessary.
5973: if (not Wf_Engine_Util.Reset_Tree(itemtype, itemkey, rootid,
5974: actid, actdate)) then
5975: Wf_Core.Token('TYPE', itemtype);
5976: Wf_Core.Token('KEY', itemkey);
5977: Wf_Core.Token('NAME', activity);

Line 5981: if (command = wf_engine.eng_skip) then

5977: Wf_Core.Token('NAME', activity);
5978: Wf_Core.Raise('WFENG_ITEM_ACTIVITY');
5979: end if;
5980:
5981: if (command = wf_engine.eng_skip) then
5982: -- *** SKIP ***
5983: -- Mark activity complete with given result
5984: begin
5985: savepoint wf_savepoint;

Line 5992: Wf_Engine_Util.Function_Call(funcname, itemtype, itemkey, actid, wf_engine.eng_skip,

5988: funcname := Wf_Activity.Activity_Function(itemtype, itemkey, actid);
5989:
5990: if (funcname is not null) then -- <6636968>
5991:
5992: Wf_Engine_Util.Function_Call(funcname, itemtype, itemkey, actid, wf_engine.eng_skip,
5993: resultout);
5994:
5995: -- Check if skip is allowed on this activity
5996: if (resultout = wf_engine.eng_noskip) then

Line 5996: if (resultout = wf_engine.eng_noskip) then

5992: Wf_Engine_Util.Function_Call(funcname, itemtype, itemkey, actid, wf_engine.eng_skip,
5993: resultout);
5994:
5995: -- Check if skip is allowed on this activity
5996: if (resultout = wf_engine.eng_noskip) then
5997: Wf_Core.Token('LABEL', Wf_Engine.GetActivityLabel(actid));
5998: Wf_Core.Raise('WFENG_NOSKIP');
5999: end if;
6000: end if;--

Line 5997: Wf_Core.Token('LABEL', Wf_Engine.GetActivityLabel(actid));

5993: resultout);
5994:
5995: -- Check if skip is allowed on this activity
5996: if (resultout = wf_engine.eng_noskip) then
5997: Wf_Core.Token('LABEL', Wf_Engine.GetActivityLabel(actid));
5998: Wf_Core.Raise('WFENG_NOSKIP');
5999: end if;
6000: end if;--
6001:

Line 6002: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result, FALSE);

5998: Wf_Core.Raise('WFENG_NOSKIP');
5999: end if;
6000: end if;--
6001:
6002: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result, FALSE);
6003:
6004: exception
6005: when trig_savepoint or dist_savepoint then
6006: -- You must be in a restricted environment,

Line 6008: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid,

6004: exception
6005: when trig_savepoint or dist_savepoint then
6006: -- You must be in a restricted environment,
6007: -- no fancy error processing for you! Try running directly.
6008: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid,
6009: result, FALSE);
6010: when others then
6011: if (Wf_Core.Error_Name = 'WFENG_NOSKIP') then
6012: -- No processing. Raise to the caller that the activity cannot be skipped.

Line 6021: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal', itemtype, itemkey,

6017: -- 2. set this activity to error status
6018: -- 3. execute the error process (if any)
6019: -- 4. clear the error to continue with next activity
6020: rollback to wf_savepoint;
6021: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal', itemtype, itemkey,
6022: activity, command, result);
6023: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6024: wf_engine.eng_exception, FALSE);
6025: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,

Line 6024: wf_engine.eng_exception, FALSE);

6020: rollback to wf_savepoint;
6021: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal', itemtype, itemkey,
6022: activity, command, result);
6023: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6024: wf_engine.eng_exception, FALSE);
6025: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6026: wf_engine.eng_exception);
6027: Wf_Core.Clear;
6028: end if;

Line 6025: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,

6021: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal', itemtype, itemkey,
6022: activity, command, result);
6023: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6024: wf_engine.eng_exception, FALSE);
6025: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6026: wf_engine.eng_exception);
6027: Wf_Core.Clear;
6028: end if;
6029: end;

Line 6026: wf_engine.eng_exception);

6022: activity, command, result);
6023: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6024: wf_engine.eng_exception, FALSE);
6025: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6026: wf_engine.eng_exception);
6027: Wf_Core.Clear;
6028: end if;
6029: end;
6030: --We will raise the skip event here .

Line 6031: event_name := 'oracle.apps.wf.engine.skip';

6027: Wf_Core.Clear;
6028: end if;
6029: end;
6030: --We will raise the skip event here .
6031: event_name := 'oracle.apps.wf.engine.skip';
6032: else
6033: -- *** RETRY ***
6034: if (actid = rootid) then
6035: -- Restart root process from beginnning

Line 6036: Wf_Engine.StartProcess(itemtype, itemkey);

6032: else
6033: -- *** RETRY ***
6034: if (actid = rootid) then
6035: -- Restart root process from beginnning
6036: Wf_Engine.StartProcess(itemtype, itemkey);
6037: else
6038: -- Start at given activity
6039: begin
6040: savepoint wf_savepoint;

Line 6041: Wf_Engine_Util.Process_Activity(itemtype, itemkey, actid,

6037: else
6038: -- Start at given activity
6039: begin
6040: savepoint wf_savepoint;
6041: Wf_Engine_Util.Process_Activity(itemtype, itemkey, actid,
6042: Wf_Engine.Threshold, TRUE);
6043: exception
6044: when trig_savepoint or dist_savepoint then
6045: -- You must be in a restricted environment,

Line 6042: Wf_Engine.Threshold, TRUE);

6038: -- Start at given activity
6039: begin
6040: savepoint wf_savepoint;
6041: Wf_Engine_Util.Process_Activity(itemtype, itemkey, actid,
6042: Wf_Engine.Threshold, TRUE);
6043: exception
6044: when trig_savepoint or dist_savepoint then
6045: -- You must be in a restricted environment,
6046: -- no fancy error processing for you!

Line 6049: actid, wf_engine.eng_deferred, wf_engine.eng_null,

6045: -- You must be in a restricted environment,
6046: -- no fancy error processing for you!
6047: -- Immediately defer activity to background engine.
6048: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey,
6049: actid, wf_engine.eng_deferred, wf_engine.eng_null,
6050: SYSDATE, null);
6051: when others then
6052: -- If anything in this process raises an exception:
6053: -- 1. rollback any work in this process thread

Line 6058: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal',itemtype,itemkey,

6054: -- 2. set this activity to error status
6055: -- 3. execute the error process (if any)
6056: -- 4. clear the error to continue with next activity
6057: rollback to wf_savepoint;
6058: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal',itemtype,itemkey,
6059: activity, command, result);
6060: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6061: wf_engine.eng_exception, FALSE);
6062: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,

Line 6061: wf_engine.eng_exception, FALSE);

6057: rollback to wf_savepoint;
6058: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal',itemtype,itemkey,
6059: activity, command, result);
6060: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6061: wf_engine.eng_exception, FALSE);
6062: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6063: wf_engine.eng_exception);
6064: Wf_Core.Clear;
6065: end;

Line 6062: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,

6058: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal',itemtype,itemkey,
6059: activity, command, result);
6060: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6061: wf_engine.eng_exception, FALSE);
6062: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6063: wf_engine.eng_exception);
6064: Wf_Core.Clear;
6065: end;
6066: end if;

Line 6063: wf_engine.eng_exception);

6059: activity, command, result);
6060: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6061: wf_engine.eng_exception, FALSE);
6062: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6063: wf_engine.eng_exception);
6064: Wf_Core.Clear;
6065: end;
6066: end if;
6067: event_name := 'oracle.apps.wf.engine.retry';

Line 6067: event_name := 'oracle.apps.wf.engine.retry';

6063: wf_engine.eng_exception);
6064: Wf_Core.Clear;
6065: end;
6066: end if;
6067: event_name := 'oracle.apps.wf.engine.retry';
6068: end if;
6069:
6070: -- Store the info for Audit (Bug 5903106 - moved from HandleError to here)
6071: Wf_Item_Activity_Status.Audit(itemtype, itemkey, actid, upper(command), null);

Line 6089: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal', itemtype, itemkey,

6085: p_parameters => l_parameterlist);
6086:
6087: exception
6088: when others then
6089: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal', itemtype, itemkey,
6090: activity, command, result);
6091: raise;
6092: end HandleErrorInternal;
6093:

Line 6126: if (itemkey = wf_engine.eng_synch) then

6122: dist_savepoint exception;
6123: pragma exception_init(dist_savepoint, -02074);
6124: begin
6125: -- Not allowed in synch mode
6126: if (itemkey = wf_engine.eng_synch) then
6127: wf_core.token('OPERATION', 'Wf_Engine.HandleError');
6128: wf_core.raise('WFENG_SYNCH_DISABLED');
6129: end if;
6130:

Line 6127: wf_core.token('OPERATION', 'Wf_Engine.HandleError');

6123: pragma exception_init(dist_savepoint, -02074);
6124: begin
6125: -- Not allowed in synch mode
6126: if (itemkey = wf_engine.eng_synch) then
6127: wf_core.token('OPERATION', 'Wf_Engine.HandleError');
6128: wf_core.raise('WFENG_SYNCH_DISABLED');
6129: end if;
6130:
6131: -- Argument validation

Line 6133: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry))) then

6129: end if;
6130:
6131: -- Argument validation
6132: if ((itemtype is null) or (itemkey is null) or (activity is null) or
6133: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry))) then
6134: Wf_Core.Token('ITEMTYPE', itemtype);
6135: Wf_Core.Token('ITEMKEY', itemkey);
6136: Wf_Core.Token('ACTIVITY', activity);
6137: Wf_Core.Token('COMMAND', command);

Line 6182: Wf_Core.Context('Wf_Engine', 'HandleError', itemtype, itemkey, activity,

6178: HandleErrorInternal(itemtype, itemkey, root, rootid, activity, actid,
6179: actdate, upper(command), result);
6180: exception
6181: when others then
6182: Wf_Core.Context('Wf_Engine', 'HandleError', itemtype, itemkey, activity,
6183: command, result);
6184: raise;
6185: end HandleError;
6186:

Line 6199: -- n is defined as wf_engine.commit_frequency

6195: -- [:]
6196: -- command - SKIP or RETRY.
6197: -- - Activity result for the "SKIP" command.
6198: -- docommit - True if you want a commit for every n iterations.
6199: -- n is defined as wf_engine.commit_frequency
6200: --
6201: procedure HandleErrorAll(itemtype in varchar2,
6202: itemkey in varchar2,
6203: activity in varchar2,

Line 6257: if (c_item_key = wf_engine.eng_synch) then

6253: exit outer_handle;
6254: end if;
6255:
6256: -- Not allowed in synch mode
6257: if (c_item_key = wf_engine.eng_synch) then
6258: wf_core.token('OPERATION', 'Wf_Engine.HandleErrorAll');
6259: wf_core.raise('WFENG_SYNCH_DISABLED');
6260: end if;
6261:

Line 6258: wf_core.token('OPERATION', 'Wf_Engine.HandleErrorAll');

6254: end if;
6255:
6256: -- Not allowed in synch mode
6257: if (c_item_key = wf_engine.eng_synch) then
6258: wf_core.token('OPERATION', 'Wf_Engine.HandleErrorAll');
6259: wf_core.raise('WFENG_SYNCH_DISABLED');
6260: end if;
6261:
6262: -- Argument validation

Line 6264: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry)))

6260: end if;
6261:
6262: -- Argument validation
6263: if ((itemtype is null) or (c_item_key is null) or (c_activity is null) or
6264: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry)))
6265: then
6266: Wf_Core.Token('ITEMTYPE', itemtype);
6267: Wf_Core.Token('ITEMKEY', c_item_key);
6268: Wf_Core.Token('ACTIVITY', c_activity);

Line 6296: (docommit and (actc%rowcount = wf_engine.commit_frequency));

6292: HandleErrorInternal(itemtype, c_item_key, root, rootid, c_activity,
6293: c_actid, actdate, upper(command), result);
6294:
6295: exit handle_loop when
6296: (docommit and (actc%rowcount = wf_engine.commit_frequency));
6297:
6298: end loop handle_loop;
6299:
6300: if (actc%ISOPEN) then

Line 6321: Wf_Core.Context('Wf_Engine', 'HandleErrorAll', itemtype, itemkey);

6317: end if;
6318:
6319: exception
6320: when others then
6321: Wf_Core.Context('Wf_Engine', 'HandleErrorAll', itemtype, itemkey);
6322: raise;
6323: end HandleErrorAll;
6324:
6325: --

Line 6353: Wf_Core.Context('Wf_Engine', 'ItemStatus', itemtype, itemkey);

6349:
6350: wf_item_activity_status.root_status(itemtype,itemkey,status,result);
6351: exception
6352: when others then
6353: Wf_Core.Context('Wf_Engine', 'ItemStatus', itemtype, itemkey);
6354: raise;
6355: end ItemStatus;
6356:
6357: -- API to reterive more granular information from the

Line 6403: and ias.activity_status = wf_engine.eng_completed

6399: wf_items i,
6400: wf_notifications ntf
6401: where ias.item_type = p_itemtype
6402: and ias.item_key = p_itemkey
6403: and ias.activity_status = wf_engine.eng_completed
6404: and ias.process_activity = pa.instance_id
6405: and pa.activity_name = ac.name
6406: and pa.activity_item_type = ac.item_type
6407: and pa.process_name = ap.name

Line 6421: wf_engine.ItemStatus(itemtype ,itemkey ,l_status,l_result);

6417:
6418: begin
6419: --Get the item status
6420: --Use the API above for the same
6421: wf_engine.ItemStatus(itemtype ,itemkey ,l_status,l_result);
6422:
6423: --Now check the status if root has completed
6424: --we do not want to go further lower
6425: --Else if the root is still active , lets find

Line 6444: and activity_status <> wf_engine.eng_completed

6440: activity_result_code
6441: from wf_item_activity_statuses
6442: where item_type = itemtype
6443: and item_key = itemkey
6444: and activity_status <> wf_engine.eng_completed
6445: order by decode(activity_status, 'ERROR',1, 'NOTIFIED',2, 'DEFERRED',3,
6446: 'SUSPEND',4, 'WAITING',5, 'ACTIVE',6, 7) asc,
6447: begin_date desc, execution_time desc
6448: )

Line 6472: Wf_Core.Context('Wf_Engine', 'ItemInfo', itemtype, itemkey);

6468: result := l_result ;
6469: end if;
6470: exception
6471: when others then
6472: Wf_Core.Context('Wf_Engine', 'ItemInfo', itemtype, itemkey);
6473: raise;
6474: end ItemInfo;
6475:
6476:

Line 6517: return(Wf_Engine.Activity_Exist(

6513: when OTHERS then
6514: raise;
6515: end;
6516:
6517: return(Wf_Engine.Activity_Exist(
6518: p_process_item_type=>p_item_type,
6519: p_process_name=>rootactivity,
6520: p_activity_item_type=>p_activity_item_type,
6521: p_activity_name=>p_activity_name,

Line 6526: Wf_Core.Context('Wf_Engine', 'Activity_Exist_In_Process',

6522: active_date=>active_date));
6523:
6524: exception
6525: when others then
6526: Wf_Core.Context('Wf_Engine', 'Activity_Exist_In_Process',
6527: p_item_type, p_item_key,
6528: nvl(p_activity_item_type, p_item_type),
6529: p_activity_name);
6530: raise;

Line 6608: if (Wf_Engine.Activity_Exist(

6604:
6605: if (n = 0) then
6606: -- recursively check subprocesses
6607: for actr in actcur(m_version) loop
6608: if (Wf_Engine.Activity_Exist(
6609: actr.activity_item_type,
6610: actr.activity_name,
6611: nvl(p_activity_item_type, p_process_item_type),
6612: p_activity_name,

Line 6627: Wf_Core.Context('Wf_Engine', 'Activity_Exist',

6623: end if;
6624:
6625: exception
6626: when OTHERS then
6627: Wf_Core.Context('Wf_Engine', 'Activity_Exist',
6628: p_process_item_type, p_process_name,
6629: nvl(p_activity_item_type, p_process_item_type),
6630: p_activity_name);
6631: raise;

Line 6708: if (itemkey = wf_engine.eng_synch) then

6704: Wf_Core.Raise('WFSQL_ARGS');
6705: end if;
6706:
6707: -- Not allowed in synch mode
6708: if (itemkey = wf_engine.eng_synch) then
6709: Wf_Core.Token('OPERATION', 'Wf_Engine.Set_Item_Parent');
6710: Wf_Core.Raise('WFENG_SYNCH_DISABLED');
6711: end if;
6712:

Line 6709: Wf_Core.Token('OPERATION', 'Wf_Engine.Set_Item_Parent');

6705: end if;
6706:
6707: -- Not allowed in synch mode
6708: if (itemkey = wf_engine.eng_synch) then
6709: Wf_Core.Token('OPERATION', 'Wf_Engine.Set_Item_Parent');
6710: Wf_Core.Raise('WFENG_SYNCH_DISABLED');
6711: end if;
6712:
6713: -- Retrieve event name from message

Line 6745: Wf_Engine.CreateProcess(itemtype, itemkey, process_name);

6741:
6742: else
6743: -- Process not running yet, create it.
6744: -- If process_name is null then will use selector function.
6745: Wf_Engine.CreateProcess(itemtype, itemkey, process_name);
6746: actdate := WF_Item.Active_Date(itemtype, itemkey);
6747:
6748: -- Bug 2259039
6749: -- Start the new process

Line 6750: Wf_Engine_Util.Start_Process_Internal(

6746: actdate := WF_Item.Active_Date(itemtype, itemkey);
6747:
6748: -- Bug 2259039
6749: -- Start the new process
6750: Wf_Engine_Util.Start_Process_Internal(
6751: itemtype => itemtype,
6752: itemkey => itemkey,
6753: runmode => 'EVENT');
6754:

Line 6760: wf_engine.eng_notified, wf_engine.eng_null, sysdate, null);

6756: actdate := WF_Item.Active_Date(itemtype, itemkey);
6757: for act in evtacts loop
6758: actarr(i) := act.actid;
6759: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, act.actid,
6760: wf_engine.eng_notified, wf_engine.eng_null, sysdate, null);
6761: i := i + 1;
6762: end loop;
6763: actarr(i) := '';
6764: end if;

Line 6794: Wf_Engine.SetItemParent(itemtype => itemtype,

6790: WHERE item_type = itemtype
6791: AND item_key = itemkey;
6792:
6793: if (parent_itemtype is null and parent_itemkey is null ) then
6794: Wf_Engine.SetItemParent(itemtype => itemtype,
6795: itemkey => itemkey,
6796: parent_itemtype =>
6797: substr(avalue,1,
6798: instr(avalue,':')-1),

Line 6808: wf_engine.SetItemowner(itemtype,itemkey,avalue);

6804: elsif aname = '#OWNER_ROLE' then
6805: --Bug 2388634
6806: --This is for the applications to set their item owner
6807: --by including a #OWNER_ROLE parameter for the event
6808: wf_engine.SetItemowner(itemtype,itemkey,avalue);
6809:
6810: else
6811: -- event item attributes may use canonical masks.
6812: Wf_Engine.SetEventItemAttr(itemtype, itemkey, aname, avalue);

Line 6812: Wf_Engine.SetEventItemAttr(itemtype, itemkey, aname, avalue);

6808: wf_engine.SetItemowner(itemtype,itemkey,avalue);
6809:
6810: else
6811: -- event item attributes may use canonical masks.
6812: Wf_Engine.SetEventItemAttr(itemtype, itemkey, aname, avalue);
6813: end if;
6814: exception
6815: when others then
6816: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then

Line 6819: Wf_Engine.AddItemAttr(itemtype, itemkey, aname, avalue);

6815: when others then
6816: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
6817: -- If attr doesn't exist create runtime itemattr
6818: Wf_Core.Clear;
6819: Wf_Engine.AddItemAttr(itemtype, itemkey, aname, avalue);
6820: else
6821: raise; -- All other errors are raised up.
6822: end if;
6823: end;

Line 6834: aname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actarr(i),

6830: begin
6831: savepoint wf_savepoint;
6832: -- Save event data to itemattrs requested by this activity.
6833: -- #EVENTNAME
6834: aname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actarr(i),
6835: wf_engine.eng_eventname);
6836: if (aname is not null) then
6837: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname, event_name);
6838: end if;

Line 6835: wf_engine.eng_eventname);

6831: savepoint wf_savepoint;
6832: -- Save event data to itemattrs requested by this activity.
6833: -- #EVENTNAME
6834: aname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actarr(i),
6835: wf_engine.eng_eventname);
6836: if (aname is not null) then
6837: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname, event_name);
6838: end if;
6839: -- #EVENTKEY

Line 6837: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname, event_name);

6833: -- #EVENTNAME
6834: aname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actarr(i),
6835: wf_engine.eng_eventname);
6836: if (aname is not null) then
6837: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname, event_name);
6838: end if;
6839: -- #EVENTKEY
6840: aname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actarr(i),
6841: wf_engine.eng_eventkey);

Line 6840: aname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actarr(i),

6836: if (aname is not null) then
6837: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname, event_name);
6838: end if;
6839: -- #EVENTKEY
6840: aname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actarr(i),
6841: wf_engine.eng_eventkey);
6842: if (aname is not null) then
6843: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname,
6844: event_message.GetEventKey);

Line 6841: wf_engine.eng_eventkey);

6837: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname, event_name);
6838: end if;
6839: -- #EVENTKEY
6840: aname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actarr(i),
6841: wf_engine.eng_eventkey);
6842: if (aname is not null) then
6843: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname,
6844: event_message.GetEventKey);
6845: end if;

Line 6843: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname,

6839: -- #EVENTKEY
6840: aname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actarr(i),
6841: wf_engine.eng_eventkey);
6842: if (aname is not null) then
6843: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname,
6844: event_message.GetEventKey);
6845: end if;
6846: -- #EVENTMESSAGE
6847: aname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actarr(i),

Line 6847: aname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actarr(i),

6843: Wf_Engine.SetItemAttrText(itemtype, itemkey, aname,
6844: event_message.GetEventKey);
6845: end if;
6846: -- #EVENTMESSAGE
6847: aname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actarr(i),
6848: wf_engine.eng_eventmessage);
6849: if (aname is not null) then
6850: Wf_Engine.SetItemAttrEvent(itemtype, itemkey, aname, event_message);
6851: end if;

Line 6848: wf_engine.eng_eventmessage);

6844: event_message.GetEventKey);
6845: end if;
6846: -- #EVENTMESSAGE
6847: aname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actarr(i),
6848: wf_engine.eng_eventmessage);
6849: if (aname is not null) then
6850: Wf_Engine.SetItemAttrEvent(itemtype, itemkey, aname, event_message);
6851: end if;
6852:

Line 6850: Wf_Engine.SetItemAttrEvent(itemtype, itemkey, aname, event_message);

6846: -- #EVENTMESSAGE
6847: aname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actarr(i),
6848: wf_engine.eng_eventmessage);
6849: if (aname is not null) then
6850: Wf_Engine.SetItemAttrEvent(itemtype, itemkey, aname, event_message);
6851: end if;
6852:
6853: -- Execute our lovely event activity (result is always null).
6854: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actarr(i),

Line 6854: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actarr(i),

6850: Wf_Engine.SetItemAttrEvent(itemtype, itemkey, aname, event_message);
6851: end if;
6852:
6853: -- Execute our lovely event activity (result is always null).
6854: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actarr(i),
6855: wf_engine.eng_null);
6856: exception
6857: when others then
6858: -- If anything in this process raises an exception:

Line 6855: wf_engine.eng_null);

6851: end if;
6852:
6853: -- Execute our lovely event activity (result is always null).
6854: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actarr(i),
6855: wf_engine.eng_null);
6856: exception
6857: when others then
6858: -- If anything in this process raises an exception:
6859: -- 1. rollback any work in this process thread

Line 6864: Wf_Core.Context('Wf_Engine', 'Event', itemtype, itemkey,

6860: -- 2. set this activity to error status
6861: -- 3. execute the error process (if any)
6862: -- 4. clear the error to continue with next activity
6863: rollback to wf_savepoint;
6864: Wf_Core.Context('Wf_Engine', 'Event', itemtype, itemkey,
6865: process_name, event_name);
6866: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actarr(i),
6867: wf_engine.eng_exception, FALSE);
6868: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actarr(i),

Line 6867: wf_engine.eng_exception, FALSE);

6863: rollback to wf_savepoint;
6864: Wf_Core.Context('Wf_Engine', 'Event', itemtype, itemkey,
6865: process_name, event_name);
6866: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actarr(i),
6867: wf_engine.eng_exception, FALSE);
6868: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actarr(i),
6869: wf_engine.eng_exception);
6870: Wf_Core.Clear;
6871: end;

Line 6868: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actarr(i),

6864: Wf_Core.Context('Wf_Engine', 'Event', itemtype, itemkey,
6865: process_name, event_name);
6866: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actarr(i),
6867: wf_engine.eng_exception, FALSE);
6868: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actarr(i),
6869: wf_engine.eng_exception);
6870: Wf_Core.Clear;
6871: end;
6872: i := i + 1;

Line 6869: wf_engine.eng_exception);

6865: process_name, event_name);
6866: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actarr(i),
6867: wf_engine.eng_exception, FALSE);
6868: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actarr(i),
6869: wf_engine.eng_exception);
6870: Wf_Core.Clear;
6871: end;
6872: i := i + 1;
6873: end loop;

Line 6877: Wf_Core.Context('Wf_Engine', 'Event', itemtype, itemkey,

6873: end loop;
6874:
6875: exception
6876: when others then
6877: Wf_Core.Context('Wf_Engine', 'Event', itemtype, itemkey,
6878: process_name, event_name);
6879: raise;
6880: end Event;
6881:

Line 6992: Wf_Engine.SetItemParent(itemtype => evtacts_rec.item_type,

6988: aname := plist(i).GetName;
6989: avalue := plist(i).GetValue;
6990: begin
6991: if aname = '#CONTEXT' then
6992: Wf_Engine.SetItemParent(itemtype => evtacts_rec.item_type,
6993: itemkey => evtacts_rec.item_key,
6994: parent_itemtype =>substr(avalue,1,instr(avalue,':')-1),
6995: parent_itemkey =>substr(avalue,instr(avalue,':')+1),
6996: parent_context => null);

Line 6999: Wf_Engine.SetEventItemAttr(evtacts_rec.item_type,

6995: parent_itemkey =>substr(avalue,instr(avalue,':')+1),
6996: parent_context => null);
6997: else
6998: -- event item attributes may use canonical masks.
6999: Wf_Engine.SetEventItemAttr(evtacts_rec.item_type,
7000: evtacts_rec.item_key, aname, avalue);
7001: end if;
7002: exception
7003: when others then

Line 7008: Wf_Engine.AddItemAttr(evtacts_rec.item_type,

7004: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
7005: -- If attr doesn't exist create runtime itemattr
7006: Wf_Core.Clear;
7007:
7008: Wf_Engine.AddItemAttr(evtacts_rec.item_type,
7009: evtacts_rec.item_key,
7010: aname, avalue);
7011: else
7012: raise; -- All other errors are raised up.

Line 7022: aname := Wf_Engine.GetActivityAttrText(evtacts_rec.item_type,

7018: begin
7019: savepoint wf_savepoint;
7020: -- Save event data to itemattrs requested by this activity.
7021: -- #EVENTNAME
7022: aname := Wf_Engine.GetActivityAttrText(evtacts_rec.item_type,
7023: evtacts_rec.item_key,
7024: evtacts_rec.actid,
7025: wf_engine.eng_eventname);
7026: if (aname is not null) then

Line 7025: wf_engine.eng_eventname);

7021: -- #EVENTNAME
7022: aname := Wf_Engine.GetActivityAttrText(evtacts_rec.item_type,
7023: evtacts_rec.item_key,
7024: evtacts_rec.actid,
7025: wf_engine.eng_eventname);
7026: if (aname is not null) then
7027: Wf_Engine.SetItemAttrText(evtacts_rec.item_type,
7028: evtacts_rec.item_key,
7029: aname,

Line 7027: Wf_Engine.SetItemAttrText(evtacts_rec.item_type,

7023: evtacts_rec.item_key,
7024: evtacts_rec.actid,
7025: wf_engine.eng_eventname);
7026: if (aname is not null) then
7027: Wf_Engine.SetItemAttrText(evtacts_rec.item_type,
7028: evtacts_rec.item_key,
7029: aname,
7030: event_name);
7031: end if;

Line 7033: aname := Wf_Engine.GetActivityAttrText(evtacts_rec.item_type,

7029: aname,
7030: event_name);
7031: end if;
7032: -- #EVENTKEY
7033: aname := Wf_Engine.GetActivityAttrText(evtacts_rec.item_type,
7034: evtacts_rec.item_key,
7035: evtacts_rec.actid,
7036: wf_engine.eng_eventkey);
7037: if (aname is not null) then

Line 7036: wf_engine.eng_eventkey);

7032: -- #EVENTKEY
7033: aname := Wf_Engine.GetActivityAttrText(evtacts_rec.item_type,
7034: evtacts_rec.item_key,
7035: evtacts_rec.actid,
7036: wf_engine.eng_eventkey);
7037: if (aname is not null) then
7038: Wf_Engine.SetItemAttrText(evtacts_rec.item_type,
7039: evtacts_rec.item_key, aname,
7040: event_message.GetEventKey);

Line 7038: Wf_Engine.SetItemAttrText(evtacts_rec.item_type,

7034: evtacts_rec.item_key,
7035: evtacts_rec.actid,
7036: wf_engine.eng_eventkey);
7037: if (aname is not null) then
7038: Wf_Engine.SetItemAttrText(evtacts_rec.item_type,
7039: evtacts_rec.item_key, aname,
7040: event_message.GetEventKey);
7041: end if;
7042: -- #EVENTMESSAGE

Line 7043: aname := Wf_Engine.GetActivityAttrText(evtacts_rec.item_type,

7039: evtacts_rec.item_key, aname,
7040: event_message.GetEventKey);
7041: end if;
7042: -- #EVENTMESSAGE
7043: aname := Wf_Engine.GetActivityAttrText(evtacts_rec.item_type,
7044: evtacts_rec.item_key,
7045: evtacts_rec.actid,
7046: wf_engine.eng_eventmessage);
7047: if (aname is not null) then

Line 7046: wf_engine.eng_eventmessage);

7042: -- #EVENTMESSAGE
7043: aname := Wf_Engine.GetActivityAttrText(evtacts_rec.item_type,
7044: evtacts_rec.item_key,
7045: evtacts_rec.actid,
7046: wf_engine.eng_eventmessage);
7047: if (aname is not null) then
7048: Wf_Engine.SetItemAttrEvent(evtacts_rec.item_type,
7049: evtacts_rec.item_key,
7050: aname,

Line 7048: Wf_Engine.SetItemAttrEvent(evtacts_rec.item_type,

7044: evtacts_rec.item_key,
7045: evtacts_rec.actid,
7046: wf_engine.eng_eventmessage);
7047: if (aname is not null) then
7048: Wf_Engine.SetItemAttrEvent(evtacts_rec.item_type,
7049: evtacts_rec.item_key,
7050: aname,
7051: event_message);
7052: end if;

Line 7055: Wf_Engine_Util.Complete_Activity(evtacts_rec.item_type,

7051: event_message);
7052: end if;
7053:
7054: -- Execute our lovely event activity (result is always null).
7055: Wf_Engine_Util.Complete_Activity(evtacts_rec.item_type,
7056: evtacts_rec.item_key, evtacts_rec.actid,
7057: wf_engine.eng_null);
7058: exception
7059: when others then

Line 7057: wf_engine.eng_null);

7053:
7054: -- Execute our lovely event activity (result is always null).
7055: Wf_Engine_Util.Complete_Activity(evtacts_rec.item_type,
7056: evtacts_rec.item_key, evtacts_rec.actid,
7057: wf_engine.eng_null);
7058: exception
7059: when others then
7060: -- If anything in this process raises an exception:
7061: -- 1. rollback any work in this process thread

Line 7066: Wf_Core.Context('Wf_Engine', 'Event2', evtacts_rec.item_type,

7062: -- 2. set this activity to error status
7063: -- 3. execute the error process (if any)
7064: -- 4. clear the error to continue with next activity
7065: rollback to wf_savepoint;
7066: Wf_Core.Context('Wf_Engine', 'Event2', evtacts_rec.item_type,
7067: evtacts_rec.item_key, event_name);
7068: Wf_Item_Activity_Status.Set_Error(evtacts_rec.item_type,
7069: evtacts_rec.item_key,
7070: evtacts_rec.actid,

Line 7071: wf_engine.eng_exception, FALSE);

7067: evtacts_rec.item_key, event_name);
7068: Wf_Item_Activity_Status.Set_Error(evtacts_rec.item_type,
7069: evtacts_rec.item_key,
7070: evtacts_rec.actid,
7071: wf_engine.eng_exception, FALSE);
7072: Wf_Engine_Util.Execute_Error_Process(evtacts_rec.item_type,
7073: evtacts_rec.item_key,
7074: evtacts_rec.actid,
7075: wf_engine.eng_exception);

Line 7072: Wf_Engine_Util.Execute_Error_Process(evtacts_rec.item_type,

7068: Wf_Item_Activity_Status.Set_Error(evtacts_rec.item_type,
7069: evtacts_rec.item_key,
7070: evtacts_rec.actid,
7071: wf_engine.eng_exception, FALSE);
7072: Wf_Engine_Util.Execute_Error_Process(evtacts_rec.item_type,
7073: evtacts_rec.item_key,
7074: evtacts_rec.actid,
7075: wf_engine.eng_exception);
7076: Wf_Core.Clear;

Line 7075: wf_engine.eng_exception);

7071: wf_engine.eng_exception, FALSE);
7072: Wf_Engine_Util.Execute_Error_Process(evtacts_rec.item_type,
7073: evtacts_rec.item_key,
7074: evtacts_rec.actid,
7075: wf_engine.eng_exception);
7076: Wf_Core.Clear;
7077: end;
7078:
7079: i := i + 1;

Line 7094: Wf_Core.Context('Wf_Engine', 'Event2', businesskey, event_name);

7090: --Rollback to ensure that we aren't locking anything here
7091: rollback to wf_savepoint_event2;
7092: raise;
7093: when others then
7094: Wf_Core.Context('Wf_Engine', 'Event2', businesskey, event_name);
7095: raise;
7096: end Event2;
7097:
7098: --

Line 7133: if (p_itemkey = wf_engine.eng_synch) then

7129: Wf_Core.Token('P_ANAME', nvl(p_aname, 'NULL'));
7130: Wf_Core.Raise('WFSQL_ARGS');
7131: end if;
7132:
7133: if (p_itemkey = wf_engine.eng_synch) then
7134: WF_CACHE.GetItemAttrValue(p_itemtype, p_itemKey, p_aname, iStatus,
7135: wiavIND);
7136:
7137: if (iStatus <> WF_CACHE.task_SUCCESS) then

Line 7181: Wf_Core.Context('Wf_Engine', 'AddToItemAttrNumber', p_itemtype, p_itemkey,

7177: when no_data_found then
7178: return NULL;
7179:
7180: when others then
7181: Wf_Core.Context('Wf_Engine', 'AddToItemAttrNumber', p_itemtype, p_itemkey,
7182: p_aname, to_char(p_addend));
7183: raise;
7184: end AddToItemAttrNumber;
7185:

Line 7202: -- n is defined as wf_engine.commit_frequency

7198: -- p_start_date - Errored On or After date
7199: -- p_end_date - Errored On or Before date
7200: -- p_max_retry - Maximum retries allowed on an activity
7201: -- p_docommit - Y (Yes) if you want a commit for every n iterations.
7202: -- n is defined as wf_engine.commit_frequency
7203: --
7204: procedure HandleErrorConcurrent(p_errbuf out nocopy varchar2,
7205: p_retcode out nocopy varchar2,
7206: p_itemtype in varchar2,

Line 7279: Fnd_File.Put_Line(Fnd_File.Log, 'Wf_Engine.HandleErrorConcurrent');

7275:
7276: l_max_retry := to_number(nvl(p_max_retry, '5'));
7277:
7278: -- Write parameters to log file
7279: Fnd_File.Put_Line(Fnd_File.Log, 'Wf_Engine.HandleErrorConcurrent');
7280: Fnd_File.Put_Line(Fnd_File.Log, 'p_itemtype - '||p_itemtype);
7281: Fnd_File.Put_Line(Fnd_File.Log, 'p_itemkey - '||p_itemkey);
7282: Fnd_File.Put_Line(Fnd_File.Log, 'p_process - '||p_process);
7283: Fnd_File.Put_Line(Fnd_File.Log, 'p_activity - '||p_activity);

Line 7309: Wf_Engine.HandleError(itemtype => p_itemtype,

7305: l_end_date,
7306: l_max_retry)
7307: loop
7308:
7309: Wf_Engine.HandleError(itemtype => p_itemtype,
7310: itemkey => l_rec.item_key,
7311: activity => l_rec.process_name||':'||l_rec.activity,
7312: command => wf_engine.eng_retry,
7313: result => '');

Line 7312: command => wf_engine.eng_retry,

7308:
7309: Wf_Engine.HandleError(itemtype => p_itemtype,
7310: itemkey => l_rec.item_key,
7311: activity => l_rec.process_name||':'||l_rec.activity,
7312: command => wf_engine.eng_retry,
7313: result => '');
7314:
7315: if (l_docommit and c_err_acts%rowcount = wf_engine.commit_frequency) then
7316: commit;

Line 7315: if (l_docommit and c_err_acts%rowcount = wf_engine.commit_frequency) then

7311: activity => l_rec.process_name||':'||l_rec.activity,
7312: command => wf_engine.eng_retry,
7313: result => '');
7314:
7315: if (l_docommit and c_err_acts%rowcount = wf_engine.commit_frequency) then
7316: commit;
7317: Fnd_Concurrent.Set_Preferred_RBS;
7318: end if;
7319: l_count := c_err_acts%rowcount;

Line 7346: result in varchar2 default wf_engine.eng_force,

7342: -- bug 6161171
7343: procedure AbortProcess2(itemtype in varchar2,
7344: itemkey in varchar2,
7345: process in varchar2 default '',
7346: result in varchar2 default wf_engine.eng_force,
7347: verify_lock in binary_integer default 0,
7348: cascade in binary_integer default 0)
7349: is
7350: l_verify_lock boolean;

Line 7363: wf_engine.AbortProcess(itemtype, itemkey, process, result, l_verify_lock, l_cascade);

7359: if (cascade <> 0) then
7360: l_cascade := true;
7361: end if;
7362:
7363: wf_engine.AbortProcess(itemtype, itemkey, process, result, l_verify_lock, l_cascade);
7364:
7365: end AbortProcess2;
7366:
7367: end Wf_Engine;

Line 7367: end Wf_Engine;

7363: wf_engine.AbortProcess(itemtype, itemkey, process, result, l_verify_lock, l_cascade);
7364:
7365: end AbortProcess2;
7366:
7367: end Wf_Engine;