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: --
81: -- Check Arguments
82: if ((itemtype is null) or
83: (itemkey is null) or
84: (aname is null)) then
85: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
86: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
87: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
88: Wf_Core.Raise('WFSQL_ARGS');
89:
82: if ((itemtype is null) or
83: (itemkey is null) or
84: (aname is null)) then
85: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
86: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
87: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
88: Wf_Core.Raise('WFSQL_ARGS');
89:
90: -- Insure this is a valid item
83: (itemkey is null) or
84: (aname is null)) then
85: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
86: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
87: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
88: Wf_Core.Raise('WFSQL_ARGS');
89:
90: -- Insure this is a valid item
91: elsif (not Wf_Item.Item_Exist(itemtype, itemkey)) then
84: (aname is null)) then
85: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
86: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
87: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
88: Wf_Core.Raise('WFSQL_ARGS');
89:
90: -- Insure this is a valid item
91: elsif (not Wf_Item.Item_Exist(itemtype, itemkey)) then
92: Wf_Core.Token('TYPE', itemtype);
88: Wf_Core.Raise('WFSQL_ARGS');
89:
90: -- Insure this is a valid item
91: elsif (not Wf_Item.Item_Exist(itemtype, itemkey)) then
92: Wf_Core.Token('TYPE', itemtype);
93: Wf_Core.Token('KEY', itemkey);
94: Wf_Core.Raise('WFENG_ITEM');
95:
96: end if;
89:
90: -- Insure this is a valid item
91: elsif (not Wf_Item.Item_Exist(itemtype, itemkey)) then
92: Wf_Core.Token('TYPE', itemtype);
93: Wf_Core.Token('KEY', itemkey);
94: Wf_Core.Raise('WFENG_ITEM');
95:
96: end if;
97:
90: -- Insure this is a valid item
91: elsif (not Wf_Item.Item_Exist(itemtype, itemkey)) then
92: Wf_Core.Token('TYPE', itemtype);
93: Wf_Core.Token('KEY', itemkey);
94: Wf_Core.Raise('WFENG_ITEM');
95:
96: end if;
97:
98: if (itemkey = wf_engine.eng_synch) then
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');
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');
135: when others then
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');
135: when others then
136: Wf_Core.Context('Wf_Engine', 'AddItemAttr', itemtype, itemkey, aname);
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');
135: when others then
136: Wf_Core.Context('Wf_Engine', 'AddItemAttr', itemtype, itemkey, aname);
137: raise;
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');
135: when others then
136: Wf_Core.Context('Wf_Engine', 'AddItemAttr', itemtype, itemkey, aname);
137: raise;
138: end AddItemAttr;
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: --
164: begin
165: -- Check Arguments
166: if ((itemtype is null) or
167: (itemkey is null)) then
168: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
169: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
170: Wf_Core.Raise('WFSQL_ARGS');
171:
172: -- Insure this is a valid item and validate that the text array
165: -- Check Arguments
166: if ((itemtype is null) or
167: (itemkey is null)) then
168: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
169: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
170: Wf_Core.Raise('WFSQL_ARGS');
171:
172: -- Insure this is a valid item and validate that the text array
173: -- tables passed in are in proper order.
166: if ((itemtype is null) or
167: (itemkey is null)) then
168: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
169: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
170: Wf_Core.Raise('WFSQL_ARGS');
171:
172: -- Insure this is a valid item and validate that the text array
173: -- tables passed in are in proper order.
174:
172: -- Insure this is a valid item and validate that the text array
173: -- tables passed in are in proper order.
174:
175: elsif (not Wf_Item.Item_Exist(itemtype, itemkey)) then
176: Wf_Core.Token('TYPE', itemtype);
177: Wf_Core.Token('KEY', itemkey);
178: Wf_Core.Raise('WFENG_ITEM');
179:
180: elsif (aname.COUNT = 0 or avalue.COUNT = 0) then
173: -- tables passed in are in proper order.
174:
175: elsif (not Wf_Item.Item_Exist(itemtype, itemkey)) then
176: Wf_Core.Token('TYPE', itemtype);
177: Wf_Core.Token('KEY', itemkey);
178: Wf_Core.Raise('WFENG_ITEM');
179:
180: elsif (aname.COUNT = 0 or avalue.COUNT = 0) then
181: -- Do not do anything if index table is empty.
174:
175: elsif (not Wf_Item.Item_Exist(itemtype, itemkey)) then
176: Wf_Core.Token('TYPE', itemtype);
177: Wf_Core.Token('KEY', itemkey);
178: Wf_Core.Raise('WFENG_ITEM');
179:
180: elsif (aname.COUNT = 0 or avalue.COUNT = 0) then
181: -- Do not do anything if index table is empty.
182: return;
183:
184: elsif (aname.LAST <> avalue.LAST or aname.COUNT <> avalue.COUNT) then
185: -- Raise an error if the two index tables do not end at the same index
186: -- or do not have the same number of elements.
187: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY_MISMATCH');
188:
189: end if;
190:
191: -- Check to see if we are in synch mode and use WF_CACHE.
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));
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));
243: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
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));
243: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
244: when others then
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));
243: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
244: when others then
245: Wf_Core.Context('Wf_Engine', 'AddItemAttrTextArray', itemtype, itemkey);
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));
243: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
244: when others then
245: Wf_Core.Context('Wf_Engine', 'AddItemAttrTextArray', itemtype, itemkey);
246: raise;
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));
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;
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: --
271: begin
272: -- Check Arguments
273: if ((itemtype is null) or
274: (itemkey is null)) then
275: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
276: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
277: Wf_Core.Raise('WFSQL_ARGS');
278:
279: -- Insure this is a valid item, and that the attribute arrays are
272: -- Check Arguments
273: if ((itemtype is null) or
274: (itemkey is null)) then
275: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
276: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
277: Wf_Core.Raise('WFSQL_ARGS');
278:
279: -- Insure this is a valid item, and that the attribute arrays are
280: -- matching and in the proper form.
273: if ((itemtype is null) or
274: (itemkey is null)) then
275: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
276: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
277: Wf_Core.Raise('WFSQL_ARGS');
278:
279: -- Insure this is a valid item, and that the attribute arrays are
280: -- matching and in the proper form.
281: elsif (not Wf_Item.Item_Exist(itemtype, itemkey)) then
278:
279: -- Insure this is a valid item, and that the attribute arrays are
280: -- matching and in the proper form.
281: elsif (not Wf_Item.Item_Exist(itemtype, itemkey)) then
282: Wf_Core.Token('TYPE', itemtype);
283: Wf_Core.Token('KEY', itemkey);
284: Wf_Core.Raise('WFENG_ITEM');
285:
286: elsif (aname.COUNT = 0 or avalue.COUNT = 0) then
279: -- Insure this is a valid item, and that the attribute arrays are
280: -- matching and in the proper form.
281: elsif (not Wf_Item.Item_Exist(itemtype, itemkey)) then
282: Wf_Core.Token('TYPE', itemtype);
283: Wf_Core.Token('KEY', itemkey);
284: Wf_Core.Raise('WFENG_ITEM');
285:
286: elsif (aname.COUNT = 0 or avalue.COUNT = 0) then
287: -- Do not do anything if index table is empty.
280: -- matching and in the proper form.
281: elsif (not Wf_Item.Item_Exist(itemtype, itemkey)) then
282: Wf_Core.Token('TYPE', itemtype);
283: Wf_Core.Token('KEY', itemkey);
284: Wf_Core.Raise('WFENG_ITEM');
285:
286: elsif (aname.COUNT = 0 or avalue.COUNT = 0) then
287: -- Do not do anything if index table is empty.
288: return;
289:
290: elsif (aname.LAST <> avalue.LAST or aname.COUNT <> avalue.COUNT) then
291: -- Raise an error if the two index tables do not end at the same index
292: -- or do not have the same number of elements.
293: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY_MISMATCH');
294:
295: end if;
296:
297: success_cnt := 0;
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));
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));
344: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
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));
344: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
345: when others then
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));
344: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
345: when others then
346: Wf_Core.Context('Wf_Engine', 'AddItemAttrNumberArray', itemtype, itemkey);
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));
344: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
345: when others then
346: Wf_Core.Context('Wf_Engine', 'AddItemAttrNumberArray', itemtype, itemkey);
347: raise;
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));
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;
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: --
372: begin
373: -- Check Arguments
374: if ((itemtype is null) or
375: (itemkey is null)) then
376: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
377: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
378: Wf_Core.Raise('WFSQL_ARGS');
379: end if;
380:
373: -- Check Arguments
374: if ((itemtype is null) or
375: (itemkey is null)) then
376: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
377: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
378: Wf_Core.Raise('WFSQL_ARGS');
379: end if;
380:
381: -- Insure this is a valid item, and the array tables match and are
374: if ((itemtype is null) or
375: (itemkey is null)) then
376: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
377: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
378: Wf_Core.Raise('WFSQL_ARGS');
379: end if;
380:
381: -- Insure this is a valid item, and the array tables match and are
382: -- in proper form.
381: -- Insure this is a valid item, and the array tables match and are
382: -- in proper form.
383:
384: if (not Wf_Item.Item_Exist(itemtype, itemkey)) then
385: Wf_Core.Token('TYPE', itemtype);
386: Wf_Core.Token('KEY', itemkey);
387: Wf_Core.Raise('WFENG_ITEM');
388:
389: elsif (aname.COUNT = 0 or avalue.COUNT = 0) then
382: -- in proper form.
383:
384: if (not Wf_Item.Item_Exist(itemtype, itemkey)) then
385: Wf_Core.Token('TYPE', itemtype);
386: Wf_Core.Token('KEY', itemkey);
387: Wf_Core.Raise('WFENG_ITEM');
388:
389: elsif (aname.COUNT = 0 or avalue.COUNT = 0) then
390: -- Do not do anything if index table is empty.
383:
384: if (not Wf_Item.Item_Exist(itemtype, itemkey)) then
385: Wf_Core.Token('TYPE', itemtype);
386: Wf_Core.Token('KEY', itemkey);
387: Wf_Core.Raise('WFENG_ITEM');
388:
389: elsif (aname.COUNT = 0 or avalue.COUNT = 0) then
390: -- Do not do anything if index table is empty.
391: return;
392:
393: elsif (aname.LAST <> avalue.LAST or aname.COUNT <> avalue.COUNT) then
394: -- Raise an error if the two index tables do not end at the same index
395: -- or do not have the same number of elements.
396: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY_MISMATCH');
397: end if;
398:
399: success_cnt := 0;
400: -- If in #SYNCH mode, we will use WF_CACHE to store the attributes.
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));
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));
443: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
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));
443: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
444: when others then
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));
443: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
444: when others then
445: Wf_Core.Context('Wf_Engine', 'AddItemAttrDateArray', itemtype, itemkey);
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));
443: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
444: when others then
445: Wf_Core.Context('Wf_Engine', 'AddItemAttrDateArray', itemtype, itemkey);
446: raise;
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));
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;
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: --
479: -- Check Arguments
480: if ((itemtype is null) or
481: (itemkey is null) or
482: (aname is null)) then
483: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
484: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
485: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
486: Wf_Core.Raise('WFSQL_ARGS');
487: end if;
480: if ((itemtype is null) or
481: (itemkey is null) or
482: (aname is null)) then
483: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
484: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
485: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
486: Wf_Core.Raise('WFSQL_ARGS');
487: end if;
488:
481: (itemkey is null) or
482: (aname is null)) then
483: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
484: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
485: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
486: Wf_Core.Raise('WFSQL_ARGS');
487: end if;
488:
489: -- Get type and format of attr.
482: (aname is null)) then
483: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
484: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
485: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
486: Wf_Core.Raise('WFSQL_ARGS');
487: end if;
488:
489: -- Get type and format of attr.
490: -- This is used for translating number/date strings.
561: AND rownum = 1;
562: exception
563: when no_data_found then
564: -- Not displayed or internal role name, error
565: wf_core.token('ROLE', avalue);
566: wf_core.raise('WFNTF_ROLE');
567: end;
568: end if;
569: end if;
562: exception
563: when no_data_found then
564: -- Not displayed or internal role name, error
565: wf_core.token('ROLE', avalue);
566: wf_core.raise('WFNTF_ROLE');
567: end;
568: end if;
569: end if;
570: else
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);
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);
629: Wf_Core.Raise('WFENG_ITEM_ATTR');
630:
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);
629: Wf_Core.Raise('WFENG_ITEM_ATTR');
630:
631: when bad_format 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);
629: Wf_Core.Raise('WFENG_ITEM_ATTR');
630:
631: when bad_format then --
632: 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);
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);
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:
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:
637: if (WF_CACHE.ItemAttributes(wiaIND).FORMAT is not null) then
638: WF_CORE.Token('FORMAT', '('||WF_CACHE.ItemAttributes(wiaIND).FORMAT||')');
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:
637: if (WF_CACHE.ItemAttributes(wiaIND).FORMAT is not null) then
638: WF_CORE.Token('FORMAT', '('||WF_CACHE.ItemAttributes(wiaIND).FORMAT||')');
639:
634: Wf_Core.Token('VALUE', avalue);
635: Wf_Core.Token('TYPE', WF_CACHE.ItemAttributes(wiaIND).TYPE);
636:
637: if (WF_CACHE.ItemAttributes(wiaIND).FORMAT is not null) then
638: WF_CORE.Token('FORMAT', '('||WF_CACHE.ItemAttributes(wiaIND).FORMAT||')');
639:
640: else
641: WF_CORE.Token('FORMAT', '');
642:
637: if (WF_CACHE.ItemAttributes(wiaIND).FORMAT is not null) then
638: WF_CORE.Token('FORMAT', '('||WF_CACHE.ItemAttributes(wiaIND).FORMAT||')');
639:
640: else
641: WF_CORE.Token('FORMAT', '');
642:
643: end if;
644:
645: Wf_Core.Raise('WFENG_BAD_FORMAT');
641: WF_CORE.Token('FORMAT', '');
642:
643: end if;
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);
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:
675: -- Check Arguments
676: if ((p_itemtype is null) or
677: (p_itemkey is null) or
678: (p_aname is null)) then
679: Wf_Core.Token('p_itemtype', nvl(p_itemtype, 'NULL'));
680: Wf_Core.Token('p_itemkey', nvl(p_itemkey, 'NULL'));
681: Wf_Core.Token('p_aname', nvl(p_aname, 'NULL'));
682: Wf_Core.Raise('WFSQL_ARGS');
683: end if;
676: if ((p_itemtype is null) or
677: (p_itemkey is null) or
678: (p_aname is null)) then
679: Wf_Core.Token('p_itemtype', nvl(p_itemtype, 'NULL'));
680: Wf_Core.Token('p_itemkey', nvl(p_itemkey, 'NULL'));
681: Wf_Core.Token('p_aname', nvl(p_aname, 'NULL'));
682: Wf_Core.Raise('WFSQL_ARGS');
683: end if;
684:
677: (p_itemkey is null) or
678: (p_aname is null)) then
679: Wf_Core.Token('p_itemtype', nvl(p_itemtype, 'NULL'));
680: Wf_Core.Token('p_itemkey', nvl(p_itemkey, 'NULL'));
681: Wf_Core.Token('p_aname', nvl(p_aname, 'NULL'));
682: Wf_Core.Raise('WFSQL_ARGS');
683: end if;
684:
685: -- Set the text value.
678: (p_aname is null)) then
679: Wf_Core.Token('p_itemtype', nvl(p_itemtype, 'NULL'));
680: Wf_Core.Token('p_itemkey', nvl(p_itemkey, 'NULL'));
681: Wf_Core.Token('p_aname', nvl(p_aname, 'NULL'));
682: Wf_Core.Raise('WFSQL_ARGS');
683: end if;
684:
685: -- Set the text value.
686: if (p_itemkey = wf_engine.eng_synch) then
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:
795: -- Update attribute value in appropriate type column.
796: if (WF_CACHE.ItemAttributes(wiaIND).TYPE = 'NUMBER') then
797:
798: if (WF_CACHE.ItemAttributes(wiaIND).FORMAT is null) then
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
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);
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);
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);
827: Wf_Core.Raise('WFENG_ITEM_ATTR');
828:
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);
827: Wf_Core.Raise('WFENG_ITEM_ATTR');
828:
829: when others 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);
827: Wf_Core.Raise('WFENG_ITEM_ATTR');
828:
829: when others then
830: 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);
827: Wf_Core.Raise('WFENG_ITEM_ATTR');
828:
829: when others then
830: Wf_Core.Context('Wf_Engine', 'SetEventItemAttr', itemtype, itemkey,
831: aname, avalue);
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:
854: -- Check Arguments
855: if ((itemtype is null) or
856: (itemkey is null) or
857: (aname is null)) then
858: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
859: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
860: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
861: Wf_Core.Raise('WFSQL_ARGS');
862: end if;
855: if ((itemtype is null) or
856: (itemkey is null) or
857: (aname is null)) then
858: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
859: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
860: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
861: Wf_Core.Raise('WFSQL_ARGS');
862: end if;
863:
856: (itemkey is null) or
857: (aname is null)) then
858: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
859: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
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
857: (aname is null)) then
858: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
859: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
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);
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);
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);
913: Wf_Core.Raise('WFENG_ITEM_ATTR');
914:
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);
913: Wf_Core.Raise('WFENG_ITEM_ATTR');
914:
915: when others 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);
913: Wf_Core.Raise('WFENG_ITEM_ATTR');
914:
915: when others then
916: 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);
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));
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:
941: -- Check Arguments
942: if ((itemtype is null) or
943: (itemkey is null) or
944: (aname is null)) then
945: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
946: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
947: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
948: Wf_Core.Raise('WFSQL_ARGS');
949: end if;
942: if ((itemtype is null) or
943: (itemkey is null) or
944: (aname is null)) then
945: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
946: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
947: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
948: Wf_Core.Raise('WFSQL_ARGS');
949: end if;
950:
943: (itemkey is null) or
944: (aname is null)) then
945: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
946: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
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
944: (aname is null)) then
945: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
946: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
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);
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);
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);
1000: Wf_Core.Raise('WFENG_ITEM_ATTR');
1001:
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);
1000: Wf_Core.Raise('WFENG_ITEM_ATTR');
1001:
1002: when bad_format 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);
1000: Wf_Core.Raise('WFENG_ITEM_ATTR');
1001:
1002: when bad_format then --
1003: Wf_Core.Context('Wf_Engine', 'SetItemAttr', 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);
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);
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');
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');
1008:
1009: when others then
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');
1008:
1009: when others then
1010: Wf_Core.Context('Wf_Engine', 'SetItemAttrDate', itemtype, itemkey,
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');
1008:
1009: when others then
1010: Wf_Core.Context('Wf_Engine', 'SetItemAttrDate', itemtype, itemkey,
1011: aname, to_char(avalue));
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:
1033: -- Check Arguments
1034: if ((itemtype is null) or
1035: (itemkey is null) or
1036: (aname is null)) then
1037: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1038: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1039: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1040: Wf_Core.Raise('WFSQL_ARGS');
1041: end if;
1034: if ((itemtype is null) or
1035: (itemkey is null) or
1036: (aname is null)) then
1037: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1038: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1039: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1040: Wf_Core.Raise('WFSQL_ARGS');
1041: end if;
1042:
1035: (itemkey is null) or
1036: (aname is null)) then
1037: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1038: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
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);
1036: (aname is null)) then
1037: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1038: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
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
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:
1067: -- Check Arguments
1068: if ((itemtype is null) or
1069: (itemkey is null) or
1070: (name is null)) then
1071: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1072: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1073: Wf_Core.Token('NAME', nvl(name, 'NULL'));
1074: Wf_Core.Raise('WFSQL_ARGS');
1075: end if;
1068: if ((itemtype is null) or
1069: (itemkey is null) or
1070: (name is null)) then
1071: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1072: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1073: Wf_Core.Token('NAME', nvl(name, 'NULL'));
1074: Wf_Core.Raise('WFSQL_ARGS');
1075: end if;
1076:
1069: (itemkey is null) or
1070: (name is null)) then
1071: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1072: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1073: Wf_Core.Token('NAME', nvl(name, 'NULL'));
1074: Wf_Core.Raise('WFSQL_ARGS');
1075: end if;
1076:
1077: -- Not allowed in synch mode
1070: (name is null)) then
1071: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1072: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1073: Wf_Core.Token('NAME', nvl(name, 'NULL'));
1074: Wf_Core.Raise('WFSQL_ARGS');
1075: end if;
1076:
1077: -- Not allowed in synch mode
1078: if (itemkey = wf_engine.eng_synch) then
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
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
1084: EVENT_VALUE = SetItemAttrEvent.event
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);
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);
1119: Wf_Core.Raise('WFENG_ITEM_ATTR');
1120: when others then
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);
1119: Wf_Core.Raise('WFENG_ITEM_ATTR');
1120: when others then
1121: Wf_Core.Context('Wf_Engine', 'SetItemAttrEvent', itemtype, itemkey,
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);
1119: Wf_Core.Raise('WFENG_ITEM_ATTR');
1120: when others then
1121: Wf_Core.Context('Wf_Engine', 'SetItemAttrEvent', itemtype, itemkey,
1122: name);
1115: name);
1116: Wf_Core.Token('TYPE', itemtype);
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;
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:
1147: begin
1148: -- Check Arguments
1149: if ((itemtype is null) or
1150: (itemkey is null)) then
1151: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1152: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1153: Wf_Core.Raise('WFSQL_ARGS');
1154: end if;
1155:
1148: -- Check Arguments
1149: if ((itemtype is null) or
1150: (itemkey is null)) then
1151: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1152: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1153: Wf_Core.Raise('WFSQL_ARGS');
1154: end if;
1155:
1156: if (aname.COUNT = 0 or avalue.COUNT = 0) then
1149: if ((itemtype is null) or
1150: (itemkey is null)) then
1151: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1152: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1153: Wf_Core.Raise('WFSQL_ARGS');
1154: end if;
1155:
1156: if (aname.COUNT = 0 or avalue.COUNT = 0) then
1157: -- Do not do anything if index table is empty.
1159:
1160: elsif (aname.LAST <> avalue.LAST or aname.COUNT <> avalue.COUNT) then
1161: -- Raise an error if the two index tables do not end at the same index
1162: -- or do not have the same number of elements.
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
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));
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));
1230: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
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));
1230: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
1231:
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));
1230: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
1231:
1232: when others 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));
1230: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
1231:
1232: when others then
1233: 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));
1230: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
1231:
1232: when others then
1233: Wf_Core.Context('Wf_Engine', 'SetItemAttrTextArray', itemtype, itemkey);
1234: raise;
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:
1259: begin
1260: -- Check Arguments
1261: if ((itemtype is null) or
1262: (itemkey is null)) then
1263: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1264: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1265: Wf_Core.Raise('WFSQL_ARGS');
1266:
1267: elsif (aname.COUNT = 0 or avalue.COUNT = 0) then
1260: -- Check Arguments
1261: if ((itemtype is null) or
1262: (itemkey is null)) then
1263: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1264: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1265: Wf_Core.Raise('WFSQL_ARGS');
1266:
1267: elsif (aname.COUNT = 0 or avalue.COUNT = 0) then
1268: -- Do not do anything if index table is empty.
1261: if ((itemtype is null) or
1262: (itemkey is null)) then
1263: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1264: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1265: Wf_Core.Raise('WFSQL_ARGS');
1266:
1267: elsif (aname.COUNT = 0 or avalue.COUNT = 0) then
1268: -- Do not do anything if index table is empty.
1269: return;
1270:
1271: elsif (aname.LAST <> avalue.LAST or aname.COUNT <> avalue.COUNT) then
1272: -- Raise an error if the two index tables do not end at the same index
1273: -- or do not have the same number of elements.
1274: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY_MISMATCH');
1275:
1276: end if;
1277:
1278: -- Set the number value.
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));
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));
1343: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
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));
1343: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
1344:
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));
1343: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
1344:
1345: when others 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));
1343: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
1344:
1345: when others then
1346: 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));
1343: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
1344:
1345: when others then
1346: Wf_Core.Context('Wf_Engine', 'SetItemAttrNumberArray', itemtype, itemkey);
1347: raise;
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: --
1371: begin
1372: -- Check Arguments
1373: if ((itemtype is null) or
1374: (itemkey is null)) then
1375: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1376: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1377: Wf_Core.Raise('WFSQL_ARGS');
1378:
1379: elsif (aname.COUNT = 0 or avalue.COUNT = 0) then
1372: -- Check Arguments
1373: if ((itemtype is null) or
1374: (itemkey is null)) then
1375: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1376: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1377: Wf_Core.Raise('WFSQL_ARGS');
1378:
1379: elsif (aname.COUNT = 0 or avalue.COUNT = 0) then
1380: -- Do not do anything if index table is empty.
1373: if ((itemtype is null) or
1374: (itemkey is null)) then
1375: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1376: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1377: Wf_Core.Raise('WFSQL_ARGS');
1378:
1379: elsif (aname.COUNT = 0 or avalue.COUNT = 0) then
1380: -- Do not do anything if index table is empty.
1381: return;
1382:
1383: elsif (aname.LAST <> avalue.LAST or aname.COUNT <> avalue.COUNT) then
1384: -- Raise an error if the two index tables do not end at the same index
1385: -- or do not have the same number of elements.
1386: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY_MISMATCH');
1387:
1388: end if;
1389:
1390: success_cnt := 0;
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));
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));
1454: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
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));
1454: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
1455:
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));
1454: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
1455:
1456: when others 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));
1454: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
1455:
1456: when others then
1457: 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));
1454: Wf_Core.Raise('WFENG_ITEM_ATTR_ARRAY');
1455:
1456: when others then
1457: Wf_Core.Context('Wf_Engine', 'SetItemAttrDateArray', itemtype, itemkey);
1458: raise;
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: --
1482: begin
1483: -- Check Arguments
1484: if ((itemtype is null) or
1485: (aname is null)) then
1486: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1487: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1488: Wf_Core.Raise('WFSQL_ARGS');
1489: end if;
1490:
1483: -- Check Arguments
1484: if ((itemtype is null) or
1485: (aname is null)) then
1486: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1487: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1488: Wf_Core.Raise('WFSQL_ARGS');
1489: end if;
1490:
1491: WF_CACHE.GetItemAttribute(itemtype, aname, status, wiaIND);
1484: if ((itemtype is null) or
1485: (aname is null)) then
1486: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1487: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1488: Wf_Core.Raise('WFSQL_ARGS');
1489: end if;
1490:
1491: WF_CACHE.GetItemAttribute(itemtype, aname, status, wiaIND);
1492:
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');
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');
1514:
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');
1514:
1515: when others then
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');
1514:
1515: when others then
1516: Wf_Core.Context('Wf_Engine', 'GetItemAttrInfo', itemtype, aname);
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');
1514:
1515: when others then
1516: Wf_Core.Context('Wf_Engine', 'GetItemAttrInfo', itemtype, aname);
1517: raise;
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: --
1548: -- Check Arguments
1549: if ((itemtype is null) or
1550: (itemkey is null) or
1551: (aname is null)) then
1552: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1553: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1554: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1555: Wf_Core.Raise('WFSQL_ARGS');
1556: end if;
1549: if ((itemtype is null) or
1550: (itemkey is null) or
1551: (aname is null)) then
1552: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1553: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1554: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1555: Wf_Core.Raise('WFSQL_ARGS');
1556: end if;
1557:
1550: (itemkey is null) or
1551: (aname is null)) then
1552: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1553: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1554: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1555: Wf_Core.Raise('WFSQL_ARGS');
1556: end if;
1557:
1558: -- Get type and format of attr.
1551: (aname is null)) then
1552: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1553: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1554: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1555: Wf_Core.Raise('WFSQL_ARGS');
1556: end if;
1557:
1558: -- Get type and format of attr.
1559: -- This is used for translating number/date strings.
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);
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);
1656: Wf_Core.Raise('WFENG_ITEM_ATTR');
1657:
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);
1656: Wf_Core.Raise('WFENG_ITEM_ATTR');
1657:
1658: end if;
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);
1656: Wf_Core.Raise('WFENG_ITEM_ATTR');
1657:
1658: end if;
1659:
1652: aname);
1653: Wf_Core.Token('TYPE', itemtype);
1654: Wf_Core.Token('KEY', itemkey);
1655: Wf_Core.Token('ATTRIBUTE', aname);
1656: Wf_Core.Raise('WFENG_ITEM_ATTR');
1657:
1658: end if;
1659:
1660: when others then
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;
1689: -- Check Arguments
1690: if ((itemtype is null) or
1691: (itemkey is null) or
1692: (aname is null)) then
1693: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1694: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1695: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1696: Wf_Core.Raise('WFSQL_ARGS');
1697: end if;
1690: if ((itemtype is null) or
1691: (itemkey is null) or
1692: (aname is null)) then
1693: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1694: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1695: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1696: Wf_Core.Raise('WFSQL_ARGS');
1697: end if;
1698:
1691: (itemkey is null) or
1692: (aname is null)) then
1693: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1694: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
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
1692: (aname is null)) then
1693: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1694: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
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
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);
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);
1749: Wf_Core.Raise('WFENG_ITEM_ATTR');
1750:
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);
1749: Wf_Core.Raise('WFENG_ITEM_ATTR');
1750:
1751: end if;
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);
1749: Wf_Core.Raise('WFENG_ITEM_ATTR');
1750:
1751: end if;
1752:
1745: aname);
1746: Wf_Core.Token('TYPE', itemtype);
1747: Wf_Core.Token('KEY', itemkey);
1748: Wf_Core.Token('ATTRIBUTE', aname);
1749: Wf_Core.Raise('WFENG_ITEM_ATTR');
1750:
1751: end if;
1752:
1753: when others then
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:
1780: -- Check Arguments
1781: if ((itemtype is null) or
1782: (itemkey is null) or
1783: (aname is null)) then
1784: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1785: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1786: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1787: Wf_Core.Raise('WFSQL_ARGS');
1788: end if;
1781: if ((itemtype is null) or
1782: (itemkey is null) or
1783: (aname is null)) then
1784: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1785: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1786: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1787: Wf_Core.Raise('WFSQL_ARGS');
1788: end if;
1789:
1782: (itemkey is null) or
1783: (aname is null)) then
1784: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1785: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
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
1783: (aname is null)) then
1784: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1785: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
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
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);
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);
1840: Wf_Core.Raise('WFENG_ITEM_ATTR');
1841:
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);
1840: Wf_Core.Raise('WFENG_ITEM_ATTR');
1841:
1842: end if;
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);
1840: Wf_Core.Raise('WFENG_ITEM_ATTR');
1841:
1842: end if;
1843: when others then
1836: aname);
1837: Wf_Core.Token('TYPE', itemtype);
1838: Wf_Core.Token('KEY', itemkey);
1839: Wf_Core.Token('ATTRIBUTE', aname);
1840: Wf_Core.Raise('WFENG_ITEM_ATTR');
1841:
1842: end if;
1843: when others then
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:
1869: -- Check Arguments
1870: if ((itemtype is null) or
1871: (itemkey is null) or
1872: (aname is null)) then
1873: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1874: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1875: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1876: Wf_Core.Raise('WFSQL_ARGS');
1877: end if;
1870: if ((itemtype is null) or
1871: (itemkey is null) or
1872: (aname is null)) then
1873: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1874: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1875: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1876: Wf_Core.Raise('WFSQL_ARGS');
1877: end if;
1878:
1871: (itemkey is null) or
1872: (aname is null)) then
1873: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1874: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
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));
1872: (aname is null)) then
1873: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1874: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
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
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:
1916: -- Check Arguments
1917: if ((itemtype is null) or
1918: (itemkey is null) or
1919: (aname is null)) then
1920: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1921: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1922: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1923: Wf_Core.Raise('WFSQL_ARGS');
1924: end if;
1917: if ((itemtype is null) or
1918: (itemkey is null) or
1919: (aname is null)) then
1920: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1921: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1922: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1923: Wf_Core.Raise('WFSQL_ARGS');
1924: end if;
1925:
1918: (itemkey is null) or
1919: (aname is null)) then
1920: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1921: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1922: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1923: Wf_Core.Raise('WFSQL_ARGS');
1924: end if;
1925:
1926: -- ### Needs to be integrated with document support in wf_notifications!
1919: (aname is null)) then
1920: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
1921: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
1922: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
1923: Wf_Core.Raise('WFSQL_ARGS');
1924: end if;
1925:
1926: -- ### Needs to be integrated with document support in wf_notifications!
1927:
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:
1998: -- Check Arguments
1999: if ((itemtype is null) or
2000: (itemkey is null) or
2001: (name is null)) then
2002: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2003: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2004: Wf_Core.Token('NAME', nvl(name, 'NULL'));
2005: Wf_Core.Raise('WFSQL_ARGS');
2006: end if;
1999: if ((itemtype is null) or
2000: (itemkey is null) or
2001: (name is null)) then
2002: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2003: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2004: Wf_Core.Token('NAME', nvl(name, 'NULL'));
2005: Wf_Core.Raise('WFSQL_ARGS');
2006: end if;
2007:
2000: (itemkey is null) or
2001: (name is null)) then
2002: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2003: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2004: Wf_Core.Token('NAME', nvl(name, 'NULL'));
2005: Wf_Core.Raise('WFSQL_ARGS');
2006: end if;
2007:
2008: -- Not allowed in synch mode
2001: (name is null)) then
2002: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2003: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2004: Wf_Core.Token('NAME', nvl(name, 'NULL'));
2005: Wf_Core.Raise('WFSQL_ARGS');
2006: end if;
2007:
2008: -- Not allowed in synch mode
2009: if (itemkey = wf_engine.eng_synch) then
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
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
2015: select EVENT_VALUE
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);
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);
2058: Wf_Core.Raise('WFENG_ITEM_ATTR');
2059: when others then
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);
2058: Wf_Core.Raise('WFENG_ITEM_ATTR');
2059: when others then
2060: Wf_Core.Context('Wf_Engine', 'GetItemAttrEvent', itemtype,
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);
2058: Wf_Core.Raise('WFENG_ITEM_ATTR');
2059: when others then
2060: Wf_Core.Context('Wf_Engine', 'GetItemAttrEvent', itemtype,
2061: itemkey, name);
2054: name);
2055: Wf_Core.Token('TYPE', 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;
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:
2094: if ((itemtype is null) or
2095: (itemkey is null) or
2096: (actid is null) or
2097: (aname is null)) then
2098: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2099: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2100: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2101: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2102: Wf_Core.Raise('WFSQL_ARGS');
2095: (itemkey is null) or
2096: (actid is null) or
2097: (aname is null)) then
2098: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2099: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2100: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2101: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2102: Wf_Core.Raise('WFSQL_ARGS');
2103:
2096: (actid is null) or
2097: (aname is null)) then
2098: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2099: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2100: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2101: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2102: Wf_Core.Raise('WFSQL_ARGS');
2103:
2104: end if;
2097: (aname is null)) then
2098: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2099: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2100: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2101: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2102: Wf_Core.Raise('WFSQL_ARGS');
2103:
2104: end if;
2105:
2098: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2099: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2100: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2101: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2102: Wf_Core.Raise('WFSQL_ARGS');
2103:
2104: end if;
2105:
2106: actdate := Wf_Item.Active_Date(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));
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));
2201: Wf_Core.Token('ATTRIBUTE', aname);
2202: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
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));
2201: Wf_Core.Token('ATTRIBUTE', aname);
2202: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2203: when others 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));
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,
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));
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);
2198: Wf_Core.Token('TYPE', itemtype);
2199: Wf_Core.Token('KEY', 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;
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:
2240: if ((itemtype is null) or
2241: (itemkey is null) or
2242: (actid is null) or
2243: (aname is null)) then
2244: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2245: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2246: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2247: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2248: Wf_Core.Raise('WFSQL_ARGS');
2241: (itemkey is null) or
2242: (actid is null) or
2243: (aname is null)) then
2244: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2245: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2246: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2247: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2248: Wf_Core.Raise('WFSQL_ARGS');
2249: end if;
2242: (actid is null) or
2243: (aname is null)) then
2244: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2245: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2246: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2247: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2248: Wf_Core.Raise('WFSQL_ARGS');
2249: end if;
2250:
2243: (aname is null)) then
2244: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2245: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2246: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2247: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2248: Wf_Core.Raise('WFSQL_ARGS');
2249: end if;
2250:
2251: -- First check value_type flag for possible item_attribute ref.
2244: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2245: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2246: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2247: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2248: Wf_Core.Raise('WFSQL_ARGS');
2249: end if;
2250:
2251: -- First check value_type flag for possible item_attribute ref.
2252: -- Checking to see if the Attribute Value is in cache.
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));
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));
2485: Wf_Core.Token('ATTRIBUTE', aname);
2486: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
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));
2485: Wf_Core.Token('ATTRIBUTE', aname);
2486: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2487:
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));
2485: Wf_Core.Token('ATTRIBUTE', aname);
2486: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2487:
2488: end if;
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));
2485: Wf_Core.Token('ATTRIBUTE', aname);
2486: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2487:
2488: end if;
2489:
2482: Wf_Core.Token('TYPE', itemtype);
2483: Wf_Core.Token('KEY', itemkey);
2484: Wf_Core.Token('ACTIVITY', to_char(actid));
2485: Wf_Core.Token('ATTRIBUTE', aname);
2486: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2487:
2488: end if;
2489:
2490: when others then
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:
2526: if ((itemtype is null) or
2527: (itemkey is null) or
2528: (actid is null) or
2529: (aname is null)) then
2530: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2531: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2532: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2533: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2534: Wf_Core.Raise('WFSQL_ARGS');
2527: (itemkey is null) or
2528: (actid is null) or
2529: (aname is null)) then
2530: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2531: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2532: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2533: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2534: Wf_Core.Raise('WFSQL_ARGS');
2535: end if;
2528: (actid is null) or
2529: (aname is null)) then
2530: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2531: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2532: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2533: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2534: Wf_Core.Raise('WFSQL_ARGS');
2535: end if;
2536:
2529: (aname is null)) then
2530: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2531: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2532: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2533: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2534: Wf_Core.Raise('WFSQL_ARGS');
2535: end if;
2536:
2537: WF_CACHE.GetActivityAttrValue(actid, aname, status, waavIND);
2530: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2531: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2532: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2533: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2534: Wf_Core.Raise('WFSQL_ARGS');
2535: end if;
2536:
2537: WF_CACHE.GetActivityAttrValue(actid, aname, status, waavIND);
2538:
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));
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));
2579: Wf_Core.Token('ATTRIBUTE', aname);
2580: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
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));
2579: Wf_Core.Token('ATTRIBUTE', aname);
2580: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2581:
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));
2579: Wf_Core.Token('ATTRIBUTE', aname);
2580: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2581:
2582: end if;
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));
2579: Wf_Core.Token('ATTRIBUTE', aname);
2580: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2581:
2582: end if;
2583:
2576: Wf_Core.Token('TYPE', itemtype);
2577: Wf_Core.Token('KEY', itemkey);
2578: Wf_Core.Token('ACTIVITY', to_char(actid));
2579: Wf_Core.Token('ATTRIBUTE', aname);
2580: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2581:
2582: end if;
2583:
2584: when others then
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:
2619: if ((itemtype is null) or
2620: (itemkey is null) or
2621: (actid is null) or
2622: (aname is null)) then
2623: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2624: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2625: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2626: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2627: Wf_Core.Raise('WFSQL_ARGS');
2620: (itemkey is null) or
2621: (actid is null) or
2622: (aname is null)) then
2623: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2624: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2625: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2626: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2627: Wf_Core.Raise('WFSQL_ARGS');
2628: end if;
2621: (actid is null) or
2622: (aname is null)) then
2623: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2624: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2625: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2626: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2627: Wf_Core.Raise('WFSQL_ARGS');
2628: end if;
2629:
2622: (aname is null)) then
2623: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2624: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2625: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2626: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2627: Wf_Core.Raise('WFSQL_ARGS');
2628: end if;
2629:
2630: -- First check value_type flag for possible item_attribute ref.
2623: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2624: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2625: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2626: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2627: Wf_Core.Raise('WFSQL_ARGS');
2628: end if;
2629:
2630: -- First check value_type flag for possible item_attribute ref.
2631: WF_CACHE.GetActivityAttrValue(actid, aname, status, waavIND);
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));
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));
2672: Wf_Core.Token('ATTRIBUTE', aname);
2673: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
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));
2672: Wf_Core.Token('ATTRIBUTE', aname);
2673: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2674:
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));
2672: Wf_Core.Token('ATTRIBUTE', aname);
2673: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2674:
2675: end if;
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));
2672: Wf_Core.Token('ATTRIBUTE', aname);
2673: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2674:
2675: end if;
2676:
2669: Wf_Core.Token('TYPE', itemtype);
2670: Wf_Core.Token('KEY', itemkey);
2671: Wf_Core.Token('ACTIVITY', to_char(actid));
2672: Wf_Core.Token('ATTRIBUTE', aname);
2673: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2674:
2675: end if;
2676:
2677: when others then
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:
2722: if ((itemtype is null) or
2723: (itemkey is null) or
2724: (actid is null) or
2725: (aname is null)) then
2726: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2727: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2728: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2729: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2730: Wf_Core.Raise('WFSQL_ARGS');
2723: (itemkey is null) or
2724: (actid is null) or
2725: (aname is null)) then
2726: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2727: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2728: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2729: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2730: Wf_Core.Raise('WFSQL_ARGS');
2731: end if;
2724: (actid is null) or
2725: (aname is null)) then
2726: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2727: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2728: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2729: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2730: Wf_Core.Raise('WFSQL_ARGS');
2731: end if;
2732:
2725: (aname is null)) then
2726: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2727: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2728: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2729: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2730: Wf_Core.Raise('WFSQL_ARGS');
2731: end if;
2732:
2733: -- First check value_type flag for possible item_attribute ref.
2726: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2727: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2728: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2729: Wf_Core.Token('ANAME', nvl(aname, 'NULL'));
2730: Wf_Core.Raise('WFSQL_ARGS');
2731: end if;
2732:
2733: -- First check value_type flag for possible item_attribute ref.
2734: WF_CACHE.GetActivityAttrValue(actid, aname, status, waavIND);
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:
2806: if ((itemtype is null) or
2807: (itemkey is null) or
2808: (actid is null) or
2809: (name is null)) then
2810: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2811: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2812: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2813: Wf_Core.Token('NAME', nvl(name, 'NULL'));
2814: Wf_Core.Raise('WFSQL_ARGS');
2807: (itemkey is null) or
2808: (actid is null) or
2809: (name is null)) then
2810: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2811: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2812: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2813: Wf_Core.Token('NAME', nvl(name, 'NULL'));
2814: Wf_Core.Raise('WFSQL_ARGS');
2815: end if;
2808: (actid is null) or
2809: (name is null)) then
2810: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2811: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2812: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2813: Wf_Core.Token('NAME', nvl(name, 'NULL'));
2814: Wf_Core.Raise('WFSQL_ARGS');
2815: end if;
2816:
2809: (name is null)) then
2810: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2811: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2812: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2813: Wf_Core.Token('NAME', nvl(name, 'NULL'));
2814: Wf_Core.Raise('WFSQL_ARGS');
2815: end if;
2816:
2817: -- First check value_type flag for possible item_attribute ref.
2810: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2811: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2812: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
2813: Wf_Core.Token('NAME', nvl(name, 'NULL'));
2814: Wf_Core.Raise('WFSQL_ARGS');
2815: end if;
2816:
2817: -- First check value_type flag for possible item_attribute ref.
2818:
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));
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));
2851: Wf_Core.Token('ATTRIBUTE', name);
2852: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
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));
2851: Wf_Core.Token('ATTRIBUTE', name);
2852: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2853:
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));
2851: Wf_Core.Token('ATTRIBUTE', name);
2852: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2853:
2854: when others then
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));
2851: Wf_Core.Token('ATTRIBUTE', name);
2852: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2853:
2854: when others then
2855: --Check to ensure that cursor is not open
2848: Wf_Core.Token('TYPE', itemtype);
2849: Wf_Core.Token('KEY', itemkey);
2850: Wf_Core.Token('ACTIVITY', to_char(actid));
2851: Wf_Core.Token('ATTRIBUTE', name);
2852: Wf_Core.Raise('WFENG_ACTIVITY_ATTR');
2853:
2854: when others then
2855: --Check to ensure that cursor is not open
2856: if (curs_activityattr%ISOPEN) then
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:
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,
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,
2883: parent_context);
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:
2911: if ((itemtype is null) or
2912: (itemkey is null) or
2913: (parent_itemtype is null) or
2914: (parent_itemkey is null)) then
2915: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2916: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2917: Wf_Core.Token('PARENT_ITEMTYPE', nvl(parent_itemtype, 'NULL'));
2918: Wf_Core.Token('PARENT_ITEMKEY', nvl(parent_itemkey, 'NULL'));
2919: Wf_Core.Raise('WFSQL_ARGS');
2912: (itemkey is null) or
2913: (parent_itemtype is null) or
2914: (parent_itemkey is null)) then
2915: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2916: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2917: Wf_Core.Token('PARENT_ITEMTYPE', nvl(parent_itemtype, 'NULL'));
2918: Wf_Core.Token('PARENT_ITEMKEY', nvl(parent_itemkey, 'NULL'));
2919: Wf_Core.Raise('WFSQL_ARGS');
2920:
2913: (parent_itemtype is null) or
2914: (parent_itemkey is null)) then
2915: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2916: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2917: Wf_Core.Token('PARENT_ITEMTYPE', nvl(parent_itemtype, 'NULL'));
2918: Wf_Core.Token('PARENT_ITEMKEY', nvl(parent_itemkey, 'NULL'));
2919: Wf_Core.Raise('WFSQL_ARGS');
2920:
2921: end if;
2914: (parent_itemkey is null)) then
2915: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2916: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2917: Wf_Core.Token('PARENT_ITEMTYPE', nvl(parent_itemtype, 'NULL'));
2918: Wf_Core.Token('PARENT_ITEMKEY', nvl(parent_itemkey, 'NULL'));
2919: Wf_Core.Raise('WFSQL_ARGS');
2920:
2921: end if;
2922:
2915: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2916: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2917: Wf_Core.Token('PARENT_ITEMTYPE', nvl(parent_itemtype, 'NULL'));
2918: Wf_Core.Token('PARENT_ITEMKEY', nvl(parent_itemkey, 'NULL'));
2919: Wf_Core.Raise('WFSQL_ARGS');
2920:
2921: end if;
2922:
2923: -- Not allowed in synch mode
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,
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,
2930: parent_itemkey, parent_context, masterdetail);
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:
2951: begin
2952: -- Check Arguments
2953: if ((itemtype is null) or
2954: (itemkey is null)) then
2955: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2956: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2957: Wf_Core.Raise('WFSQL_ARGS');
2958:
2959: end if;
2952: -- Check Arguments
2953: if ((itemtype is null) or
2954: (itemkey is null)) then
2955: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2956: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2957: Wf_Core.Raise('WFSQL_ARGS');
2958:
2959: end if;
2960:
2953: if ((itemtype is null) or
2954: (itemkey is null)) then
2955: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2956: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2957: Wf_Core.Raise('WFSQL_ARGS');
2958:
2959: end if;
2960:
2961: -- Not allowed in synch mode
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);
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);
2968: exception
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:
2989: begin
2990: -- Check Arguments
2991: if ((itemtype is null) or
2992: (itemkey is null)) then
2993: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2994: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2995: Wf_Core.Raise('WFSQL_ARGS');
2996: end if;
2997:
2990: -- Check Arguments
2991: if ((itemtype is null) or
2992: (itemkey is null)) then
2993: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2994: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2995: Wf_Core.Raise('WFSQL_ARGS');
2996: end if;
2997:
2998: return(Wf_Item.GetItemUserKey(itemtype, itemkey));
2991: if ((itemtype is null) or
2992: (itemkey is null)) then
2993: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
2994: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
2995: Wf_Core.Raise('WFSQL_ARGS');
2996: end if;
2997:
2998: return(Wf_Item.GetItemUserKey(itemtype, itemkey));
2999: exception
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: --
3018: begin
3019: -- Check Arguments
3020: if ((itemtype is null) or
3021: (itemkey is null)) then
3022: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
3023: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
3024: Wf_Core.Raise('WFSQL_ARGS');
3025:
3026: end if;
3019: -- Check Arguments
3020: if ((itemtype is null) or
3021: (itemkey is null)) then
3022: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
3023: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
3024: Wf_Core.Raise('WFSQL_ARGS');
3025:
3026: end if;
3027:
3020: if ((itemtype is null) or
3021: (itemkey is null)) then
3022: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
3023: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
3024: Wf_Core.Raise('WFSQL_ARGS');
3025:
3026: end if;
3027:
3028: -- Not allowed in synch mode
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);
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);
3035: exception
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:
3057:
3058: begin
3059: -- Check Arguments
3060: if (actid is null) then
3061: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
3062: Wf_Core.Raise('WFSQL_ARGS');
3063: end if;
3064:
3065: WF_CACHE.GetProcessActivity(actid, status);
3058: begin
3059: -- Check Arguments
3060: if (actid is null) then
3061: Wf_Core.Token('ACTID', nvl(actid, 'NULL'));
3062: Wf_Core.Raise('WFSQL_ARGS');
3063: end if;
3064:
3065: WF_CACHE.GetProcessActivity(actid, status);
3066:
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));
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));
3089: raise;
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));
3089: raise;
3090: end GetActivityLabel;
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
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: --
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: --
3198: -- Handle the command now ... Get value and type Return Null
3223: exception
3224: when OTHERS then
3225: -- If attr is not already defined, add a runtime attribute
3226: -- with this name, then try the set again.
3227: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
3228: if (attr_type = 'EVENT') then
3229: raise;
3230: end if;
3231: wf_core.clear;
3227: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
3228: if (attr_type = 'EVENT') then
3229: raise;
3230: end if;
3231: wf_core.clear;
3232: if (attr_type = 'NUMBER') then
3233: AddItemAttr(itemtype=>itemtype,
3234: itemkey=>itemkey,
3235: aname=>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);
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:
3308: -- Set the error status
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');
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');
3362:
3363: when wf_invalid_argument then
3364: Wf_Core.Context('Wf_Engine', 'CB', command, context, attr_name, attr_type,
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');
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)||':'||
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');
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');
3369:
3370: when OTHERS then
3371: Wf_Core.Context('Wf_Engine', 'CB', command, context, attr_name, attr_type,
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');
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)||':'||
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;
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:
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:
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
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
3603: -- Remaining steps for completing activity raises an exception:
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,
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:
3617: -- bug 7828862 - Resynch apps context from cached values if it changed
3626: end loop;
3627:
3628: exception
3629: when others then
3630: Wf_Core.Context('Wf_Engine', 'ProcessTimeout', l_itemkey, l_itemtype,
3631: to_char(l_actid));
3632: raise;
3633: end ProcessTimeOut;
3634:
3814: end;
3815: exception
3816: when NO_SAVEPOINT then
3817: -- Catch any savepoint error in case of a commit happened.
3818: Wf_Core.Token('ACTIVITY', Wf_Engine.GetActivityLabel(l_actid));
3819: Wf_Core.Raise('WFENG_COMMIT_IN_ERRPROC');
3820: end;
3821: exception
3822: when OTHERS then
3815: exception
3816: when NO_SAVEPOINT then
3817: -- Catch any savepoint error in case of a commit happened.
3818: Wf_Core.Token('ACTIVITY', Wf_Engine.GetActivityLabel(l_actid));
3819: Wf_Core.Raise('WFENG_COMMIT_IN_ERRPROC');
3820: end;
3821: exception
3822: when OTHERS then
3823: -- Remaining steps for completing activity raises an exception:
3823: -- Remaining steps for completing activity raises an exception:
3824: -- 2. set this activity to error status
3825: -- 3. execute the error process (if any)
3826: -- 4. clear the error to continue with next activity
3827: Wf_Core.Context('Wf_Engine', 'ProcessStuckProcess', l_itemkey,
3828: l_itemtype, to_char(l_actid));
3829: Wf_Item_Activity_Status.Set_Error(l_itemtype, l_itemkey, l_actid,
3830: wf_engine.eng_exception, FALSE);
3831: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey,
3829: Wf_Item_Activity_Status.Set_Error(l_itemtype, l_itemkey, l_actid,
3830: wf_engine.eng_exception, FALSE);
3831: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey,
3832: l_actid, wf_engine.eng_exception);
3833: Wf_Core.Clear;
3834: end;
3835:
3836: -- Commit work to insure this activity thread doesn't interfere
3837: -- with others.
3843: end loop;
3844:
3845: exception
3846: when others then
3847: Wf_Core.Context('Wf_Engine', 'ProcessStuckProcess', l_itemkey, l_itemtype,
3848: to_char(l_actid));
3849: raise;
3850: end ProcessStuckProcess;
3851:
3869: process_stuck in boolean)
3870: is
3871: l_aq_tm_processes varchar2(512);
3872: begin
3873: WF_CORE.TAG_DB_SESSION(WF_CORE.CONN_TAG_WF, Background.itemtype);
3874: if (WF_CACHE.MetaRefreshed) then
3875: null;
3876:
3877: end if;
3876:
3877: end if;
3878:
3879: --Bug 3945469: Add check on db major version and cache value for aq_tm_processes
3880: if wf_core.g_oracle_major_version is null then
3881: wf_core.InitCache;
3882: end if;
3883:
3884: --Check the value of aq_tm_processes if oracle version is not 10g
3877: end if;
3878:
3879: --Bug 3945469: Add check on db major version and cache value for aq_tm_processes
3880: if wf_core.g_oracle_major_version is null then
3881: wf_core.InitCache;
3882: end if;
3883:
3884: --Check the value of aq_tm_processes if oracle version is not 10g
3885: if (wf_core.g_oracle_major_version < 10 ) then
3881: wf_core.InitCache;
3882: end if;
3883:
3884: --Check the value of aq_tm_processes if oracle version is not 10g
3885: if (wf_core.g_oracle_major_version < 10 ) then
3886: if (wf_core.g_aq_tm_processes ='0') then
3887: --If the value aq_tm_processes is 0 then raise error
3888: wf_core.raise('WFENG_AQ_TM_PROCESSES_ERROR');
3889: end if;
3882: end if;
3883:
3884: --Check the value of aq_tm_processes if oracle version is not 10g
3885: if (wf_core.g_oracle_major_version < 10 ) then
3886: if (wf_core.g_aq_tm_processes ='0') then
3887: --If the value aq_tm_processes is 0 then raise error
3888: wf_core.raise('WFENG_AQ_TM_PROCESSES_ERROR');
3889: end if;
3890: end if;
3884: --Check the value of aq_tm_processes if oracle version is not 10g
3885: if (wf_core.g_oracle_major_version < 10 ) then
3886: if (wf_core.g_aq_tm_processes ='0') then
3887: --If the value aq_tm_processes is 0 then raise error
3888: wf_core.raise('WFENG_AQ_TM_PROCESSES_ERROR');
3889: end if;
3890: end if;
3891:
3892: --Bug 2307428
3917: end if;
3918:
3919: exception
3920: when others then
3921: Wf_Core.Context('Wf_Engine', 'Background', itemtype,
3922: to_char(minthreshold), to_char(maxthreshold));
3923: -- Restore Apps Context
3924: wfa_sec.Restore_Ctx();
3925: raise;
4004:
4005: exception
4006: when others then
4007: -- Retrieve error message into errbuf
4008: wf_core.get_error(errname, errmsg, errstack);
4009: if (errmsg is not null) then
4010: errbuf := errmsg;
4011: else
4012: errbuf := sqlerrm;
4051:
4052: begin
4053: -- Argument validation
4054: if ((itemtype is null) or (itemkey is null)) then
4055: Wf_Core.Token('ITEMTYPE', itemtype);
4056: Wf_Core.Token('ITEMKEY', itemkey);
4057: Wf_Core.Token('PROCESS', process);
4058: Wf_Core.Raise('WFSQL_ARGS');
4059: end if;
4052: begin
4053: -- Argument validation
4054: if ((itemtype is null) or (itemkey is null)) then
4055: Wf_Core.Token('ITEMTYPE', itemtype);
4056: Wf_Core.Token('ITEMKEY', itemkey);
4057: Wf_Core.Token('PROCESS', process);
4058: Wf_Core.Raise('WFSQL_ARGS');
4059: end if;
4060:
4053: -- Argument validation
4054: if ((itemtype is null) or (itemkey is null)) then
4055: Wf_Core.Token('ITEMTYPE', itemtype);
4056: Wf_Core.Token('ITEMKEY', itemkey);
4057: Wf_Core.Token('PROCESS', process);
4058: Wf_Core.Raise('WFSQL_ARGS');
4059: end if;
4060:
4061: --
4054: if ((itemtype is null) or (itemkey is null)) then
4055: Wf_Core.Token('ITEMTYPE', itemtype);
4056: Wf_Core.Token('ITEMKEY', itemkey);
4057: Wf_Core.Token('PROCESS', process);
4058: Wf_Core.Raise('WFSQL_ARGS');
4059: end if;
4060:
4061: --
4062: if (WF_CACHE.MetaRefreshed) then
4109: when others then
4110: status := 'x'; -- Treat errors like incomplete process
4111: end;
4112: if (nvl(status, 'x') <> wf_engine.eng_completed) then
4113: Wf_Core.Token('ITEMTYPE', itemtype);
4114: Wf_Core.Token('ITEMKEY', itemkey);
4115: Wf_Core.Raise('WFENG_SYNCH_ITEM');
4116: end if;
4117: end if;
4110: status := 'x'; -- Treat errors like incomplete process
4111: end;
4112: if (nvl(status, 'x') <> wf_engine.eng_completed) then
4113: Wf_Core.Token('ITEMTYPE', itemtype);
4114: Wf_Core.Token('ITEMKEY', itemkey);
4115: Wf_Core.Raise('WFENG_SYNCH_ITEM');
4116: end if;
4117: end if;
4118: else
4111: end;
4112: if (nvl(status, 'x') <> wf_engine.eng_completed) then
4113: Wf_Core.Token('ITEMTYPE', itemtype);
4114: Wf_Core.Token('ITEMKEY', itemkey);
4115: Wf_Core.Raise('WFENG_SYNCH_ITEM');
4116: end if;
4117: end if;
4118: else
4119: -- Not synchmode. Clear plsql cache first, just in case previous
4119: -- Not synchmode. Clear plsql cache first, just in case previous
4120: -- item was purged/rolled back, then check for duplicate.
4121: Wf_Item.ClearCache;
4122: if (Wf_Item.Item_Exist(itemtype, itemkey)) then
4123: Wf_Core.Token('TYPE', itemtype);
4124: Wf_Core.Token('KEY', itemkey);
4125: Wf_Core.Raise('WFENG_ITEM_UNIQUE');
4126: end if;
4127: end if;
4120: -- item was purged/rolled back, then check for duplicate.
4121: Wf_Item.ClearCache;
4122: if (Wf_Item.Item_Exist(itemtype, itemkey)) then
4123: Wf_Core.Token('TYPE', itemtype);
4124: Wf_Core.Token('KEY', itemkey);
4125: Wf_Core.Raise('WFENG_ITEM_UNIQUE');
4126: end if;
4127: end if;
4128:
4121: Wf_Item.ClearCache;
4122: if (Wf_Item.Item_Exist(itemtype, itemkey)) then
4123: Wf_Core.Token('TYPE', itemtype);
4124: Wf_Core.Token('KEY', itemkey);
4125: Wf_Core.Raise('WFENG_ITEM_UNIQUE');
4126: end if;
4127: end if;
4128:
4129: if (process is null) then
4129: if (process is null) then
4130: -- Call the selector function to get the process
4131: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey);
4132: if (root is null) then
4133: Wf_Core.Token('TYPE', itemtype);
4134: Wf_Core.Token('KEY', itemkey);
4135: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
4136: end if;
4137: else
4130: -- Call the selector function to get the process
4131: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey);
4132: if (root is null) then
4133: Wf_Core.Token('TYPE', itemtype);
4134: Wf_Core.Token('KEY', itemkey);
4135: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
4136: end if;
4137: else
4138: root := process;
4131: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey);
4132: if (root is null) then
4133: Wf_Core.Token('TYPE', itemtype);
4134: Wf_Core.Token('KEY', itemkey);
4135: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
4136: end if;
4137: else
4138: root := process;
4139: end if;
4145: -- create_item so the date has been established.
4146: actdate := sysdate;
4147: typ := Wf_Activity.Type(itemtype, root, actdate);
4148: if ((typ is null) or (typ <> wf_engine.eng_process)) then
4149: Wf_Core.Token('TYPE', itemtype);
4150: Wf_Core.Token('NAME', root);
4151: Wf_Core.Raise('WFENG_PROCESS_NAME');
4152: end if;
4153:
4146: actdate := sysdate;
4147: typ := Wf_Activity.Type(itemtype, root, actdate);
4148: if ((typ is null) or (typ <> wf_engine.eng_process)) then
4149: Wf_Core.Token('TYPE', itemtype);
4150: Wf_Core.Token('NAME', root);
4151: Wf_Core.Raise('WFENG_PROCESS_NAME');
4152: end if;
4153:
4154: -- Insert row in items table
4147: typ := Wf_Activity.Type(itemtype, root, actdate);
4148: if ((typ is null) or (typ <> wf_engine.eng_process)) then
4149: Wf_Core.Token('TYPE', itemtype);
4150: Wf_Core.Token('NAME', root);
4151: Wf_Core.Raise('WFENG_PROCESS_NAME');
4152: end if;
4153:
4154: -- Insert row in items table
4155: Wf_Item.Create_Item(itemtype, itemkey, root, actdate, createprocess.user_key,
4158: -- Validate the root argument is runnable
4159: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey,
4160: root);
4161: if (rootid is null) then
4162: Wf_Core.Token('TYPE', itemtype);
4163: Wf_Core.Token('NAME', root);
4164: Wf_Core.Raise('WFENG_PROCESS_RUNNABLE');
4165: end if;
4166:
4159: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey,
4160: root);
4161: if (rootid is null) then
4162: Wf_Core.Token('TYPE', itemtype);
4163: Wf_Core.Token('NAME', root);
4164: Wf_Core.Raise('WFENG_PROCESS_RUNNABLE');
4165: end if;
4166:
4167: if (itemkey <> WF_ENGINE.eng_synch) then
4160: root);
4161: if (rootid is null) then
4162: Wf_Core.Token('TYPE', itemtype);
4163: Wf_Core.Token('NAME', root);
4164: Wf_Core.Raise('WFENG_PROCESS_RUNNABLE');
4165: end if;
4166:
4167: if (itemkey <> WF_ENGINE.eng_synch) then
4168: -- Create monitor access key attributes
4166:
4167: if (itemkey <> WF_ENGINE.eng_synch) then
4168: -- Create monitor access key attributes
4169: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.wfmon_mon_key,
4170: Wf_Core.Random);
4171: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.wfmon_acc_key,
4172: Wf_Core.Random);
4173: end if;
4174:
4168: -- Create monitor access key attributes
4169: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.wfmon_mon_key,
4170: Wf_Core.Random);
4171: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.wfmon_acc_key,
4172: Wf_Core.Random);
4173: end if;
4174:
4175: -- Create a schema attribute
4176: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.eng_schema,
4191: when others then
4192: -- Bug 4117740
4193: -- Call clearcache() when #SYNCH flow is in error
4194: if ((itemkey = WF_ENGINE.eng_synch) and
4195: (wf_core.error_name is null or wf_core.error_name <> 'WFENG_SYNCH_ITEM') and
4196: (not WF_ENGINE.debug)) then
4197: Wf_Item.ClearCache;
4198: end if;
4199:
4196: (not WF_ENGINE.debug)) then
4197: Wf_Item.ClearCache;
4198: end if;
4199:
4200: Wf_Core.Context('Wf_Engine', 'CreateProcess', itemtype, itemkey, process);
4201: raise;
4202: end CreateProcess;
4203:
4204: --
4213: procedure StartProcess(itemtype in varchar2,
4214: itemkey in varchar2)
4215: is
4216: begin
4217: WF_CORE.TAG_DB_SESSION(WF_CORE.CONN_TAG_WF, StartProcess.itemtype);
4218:
4219: if (WF_CACHE.MetaRefreshed) then
4220: null;
4221: end if;
4225: itemkey => itemkey,
4226: runmode => 'START');
4227: exception
4228: when others then
4229: Wf_Core.Context('Wf_Engine', 'StartProcess', itemtype, itemkey);
4230: raise;
4231: end StartProcess;
4232:
4233: --
4251: begin
4252: -- Check Arguments
4253: if ((itemtype is null) or
4254: (itemkey is null)) then
4255: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4256: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
4257: Wf_Core.Raise('WFSQL_ARGS');
4258:
4259: end if;
4252: -- Check Arguments
4253: if ((itemtype is null) or
4254: (itemkey is null)) then
4255: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4256: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
4257: Wf_Core.Raise('WFSQL_ARGS');
4258:
4259: end if;
4260:
4253: if ((itemtype is null) or
4254: (itemkey is null)) then
4255: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4256: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
4257: Wf_Core.Raise('WFSQL_ARGS');
4258:
4259: end if;
4260:
4261: wf_engine.CreateProcess (itemtype,itemkey,process);
4270:
4271: wf_engine.StartProcess (itemtype,itemkey);
4272: exception
4273: when others then
4274: Wf_Core.Context('Wf_Engine', 'LaunchProcess', itemtype, itemkey,
4275: process, userkey, owner);
4276: raise;
4277: end LaunchProcess;
4278:
4312:
4313: begin
4314: -- Check Arguments
4315: if (itemtype is null) then
4316: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4317: Wf_Core.Raise('WFSQL_ARGS');
4318:
4319: -- Not allowed in synch mode
4320: elsif (itemkey = wf_engine.eng_synch) then
4313: begin
4314: -- Check Arguments
4315: if (itemtype is null) then
4316: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4317: Wf_Core.Raise('WFSQL_ARGS');
4318:
4319: -- Not allowed in synch mode
4320: elsif (itemkey = wf_engine.eng_synch) then
4321: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
4317: Wf_Core.Raise('WFSQL_ARGS');
4318:
4319: -- Not allowed in synch mode
4320: elsif (itemkey = wf_engine.eng_synch) then
4321: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
4322: wf_core.raise('WFENG_SYNCH_DISABLED');
4323:
4324: elsif (itemkey is null) then
4325: WF_ENGINE.SuspendAll(itemtype, process); --
4318:
4319: -- Not allowed in synch mode
4320: elsif (itemkey = wf_engine.eng_synch) then
4321: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
4322: wf_core.raise('WFENG_SYNCH_DISABLED');
4323:
4324: elsif (itemkey is null) then
4325: WF_ENGINE.SuspendAll(itemtype, process); --
4326: return;
4329:
4330: -- Get the root process for this key and also validate the item
4331: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4332: if (root is null) then
4333: Wf_Core.Token('TYPE', itemtype);
4334: Wf_Core.Token('KEY', itemkey);
4335: Wf_Core.Raise('WFENG_ITEM');
4336: end if;
4337:
4330: -- Get the root process for this key and also validate the item
4331: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4332: if (root is null) then
4333: Wf_Core.Token('TYPE', itemtype);
4334: Wf_Core.Token('KEY', itemkey);
4335: Wf_Core.Raise('WFENG_ITEM');
4336: end if;
4337:
4338: -- Get the process instance id.
4331: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4332: if (root is null) then
4333: Wf_Core.Token('TYPE', itemtype);
4334: Wf_Core.Token('KEY', itemkey);
4335: Wf_Core.Raise('WFENG_ITEM');
4336: end if;
4337:
4338: -- Get the process instance id.
4339: -- Search the process beginnning at the root process of the item for the
4340: -- activity matching process.
4341: actdate := Wf_Item.Active_Date(itemtype, itemkey);
4342: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4343: if (rootid is null) then
4344: Wf_Core.Token('TYPE', itemtype);
4345: Wf_Core.Token('KEY', itemkey);
4346: Wf_Core.Token('NAME', root);
4347: Wf_Core.Raise('WFENG_ITEM_ROOT');
4348: end if;
4341: actdate := Wf_Item.Active_Date(itemtype, itemkey);
4342: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4343: if (rootid is null) then
4344: Wf_Core.Token('TYPE', itemtype);
4345: Wf_Core.Token('KEY', itemkey);
4346: Wf_Core.Token('NAME', root);
4347: Wf_Core.Raise('WFENG_ITEM_ROOT');
4348: end if;
4349:
4342: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4343: if (rootid is null) then
4344: Wf_Core.Token('TYPE', itemtype);
4345: Wf_Core.Token('KEY', itemkey);
4346: Wf_Core.Token('NAME', root);
4347: Wf_Core.Raise('WFENG_ITEM_ROOT');
4348: end if;
4349:
4350: if (process is null) then
4343: if (rootid is null) then
4344: Wf_Core.Token('TYPE', itemtype);
4345: Wf_Core.Token('KEY', itemkey);
4346: Wf_Core.Token('NAME', root);
4347: Wf_Core.Raise('WFENG_ITEM_ROOT');
4348: end if;
4349:
4350: if (process is null) then
4351: -- Suspend the root process
4355: -- Suspend the given process
4356: proc := process;
4357: procid := Wf_Process_Activity.FindActivity(rootid, proc, actdate);
4358: if (procid is null) then
4359: Wf_Core.Token('TYPE', itemtype);
4360: Wf_Core.Token('KEY', itemkey);
4361: Wf_Core.Token('NAME', proc);
4362: Wf_Core.Token('VERSION', to_char(version));
4363: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4356: proc := process;
4357: procid := Wf_Process_Activity.FindActivity(rootid, proc, actdate);
4358: if (procid is null) then
4359: Wf_Core.Token('TYPE', itemtype);
4360: Wf_Core.Token('KEY', itemkey);
4361: Wf_Core.Token('NAME', proc);
4362: Wf_Core.Token('VERSION', to_char(version));
4363: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4364: end if;
4357: procid := Wf_Process_Activity.FindActivity(rootid, proc, actdate);
4358: if (procid is null) then
4359: Wf_Core.Token('TYPE', itemtype);
4360: Wf_Core.Token('KEY', itemkey);
4361: Wf_Core.Token('NAME', proc);
4362: Wf_Core.Token('VERSION', to_char(version));
4363: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4364: end if;
4365:
4358: if (procid is null) then
4359: Wf_Core.Token('TYPE', itemtype);
4360: Wf_Core.Token('KEY', itemkey);
4361: Wf_Core.Token('NAME', proc);
4362: Wf_Core.Token('VERSION', to_char(version));
4363: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4364: end if;
4365:
4366: -- Check that activity is a PROCESS-type.
4359: Wf_Core.Token('TYPE', itemtype);
4360: Wf_Core.Token('KEY', itemkey);
4361: Wf_Core.Token('NAME', proc);
4362: Wf_Core.Token('VERSION', to_char(version));
4363: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4364: end if;
4365:
4366: -- Check that activity is a PROCESS-type.
4367: -- Only PROCESS activities may be suspended.
4366: -- Check that activity is a PROCESS-type.
4367: -- Only PROCESS activities may be suspended.
4368: if (Wf_Activity.Instance_Type(procid, actdate) <>
4369: wf_engine.eng_process) then
4370: Wf_Core.Token('NAME', proc);
4371: Wf_Core.Token('TYPE', itemtype);
4372: Wf_Core.Raise('WFENG_PROCESS_NAME');
4373: end if;
4374: end if;
4367: -- Only PROCESS activities may be suspended.
4368: if (Wf_Activity.Instance_Type(procid, actdate) <>
4369: wf_engine.eng_process) then
4370: Wf_Core.Token('NAME', proc);
4371: Wf_Core.Token('TYPE', itemtype);
4372: Wf_Core.Raise('WFENG_PROCESS_NAME');
4373: end if;
4374: end if;
4375:
4368: if (Wf_Activity.Instance_Type(procid, actdate) <>
4369: wf_engine.eng_process) then
4370: Wf_Core.Token('NAME', proc);
4371: Wf_Core.Token('TYPE', itemtype);
4372: Wf_Core.Raise('WFENG_PROCESS_NAME');
4373: end if;
4374: end if;
4375:
4376: -- Always clear the cache first
4403:
4404: -- Suspend all the children processes
4405: Wf_Engine_Util.Suspend_Child_Processes(itemtype, itemkey, procid);
4406: else
4407: Wf_Core.Token('TYPE', itemtype);
4408: Wf_Core.Token('KEY', itemkey);
4409: Wf_Core.Token('NAME', proc);
4410: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4411: end if;
4404: -- Suspend all the children processes
4405: Wf_Engine_Util.Suspend_Child_Processes(itemtype, itemkey, procid);
4406: else
4407: Wf_Core.Token('TYPE', itemtype);
4408: Wf_Core.Token('KEY', itemkey);
4409: Wf_Core.Token('NAME', proc);
4410: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4411: end if;
4412:
4405: Wf_Engine_Util.Suspend_Child_Processes(itemtype, itemkey, procid);
4406: else
4407: Wf_Core.Token('TYPE', itemtype);
4408: Wf_Core.Token('KEY', itemkey);
4409: Wf_Core.Token('NAME', proc);
4410: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4411: end if;
4412:
4413: exception
4406: else
4407: Wf_Core.Token('TYPE', itemtype);
4408: Wf_Core.Token('KEY', itemkey);
4409: Wf_Core.Token('NAME', proc);
4410: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4411: end if;
4412:
4413: exception
4414: when others then
4411: end if;
4412:
4413: exception
4414: when others then
4415: Wf_Core.Context('Wf_Engine', 'SuspendProcess', itemtype, itemkey, process);
4416: raise;
4417: end SuspendProcess;
4418:
4419: --
4474:
4475: begin
4476: -- Check Arguments
4477: if (itemtype is null) then
4478: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4479: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
4480: Wf_Core.Raise('WFSQL_ARGS');
4481:
4482: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4475: begin
4476: -- Check Arguments
4477: if (itemtype is null) then
4478: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4479: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
4480: Wf_Core.Raise('WFSQL_ARGS');
4481:
4482: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4483: wf_core.token('OPERATION', 'Wf_Engine.AbortProcess');
4476: -- Check Arguments
4477: if (itemtype is null) then
4478: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4479: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
4480: Wf_Core.Raise('WFSQL_ARGS');
4481:
4482: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4483: wf_core.token('OPERATION', 'Wf_Engine.AbortProcess');
4484: wf_core.raise('WFENG_SYNCH_DISABLED');
4479: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
4480: Wf_Core.Raise('WFSQL_ARGS');
4481:
4482: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4483: wf_core.token('OPERATION', 'Wf_Engine.AbortProcess');
4484: wf_core.raise('WFENG_SYNCH_DISABLED');
4485: end if;
4486:
4487: --Do the check for lock ONLY if there is an explicit
4480: Wf_Core.Raise('WFSQL_ARGS');
4481:
4482: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4483: wf_core.token('OPERATION', 'Wf_Engine.AbortProcess');
4484: wf_core.raise('WFENG_SYNCH_DISABLED');
4485: end if;
4486:
4487: --Do the check for lock ONLY if there is an explicit
4488: --request for the same.
4494:
4495: -- Get the root process for this key and also validate the item
4496: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4497: if (root is null) then
4498: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey, process);
4499: Wf_Core.Token('TYPE', itemtype);
4500: Wf_Core.Token('KEY', itemkey);
4501: Wf_Core.Raise('WFENG_ITEM');
4502: end if;
4495: -- Get the root process for this key and also validate the item
4496: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4497: if (root is null) then
4498: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey, process);
4499: Wf_Core.Token('TYPE', itemtype);
4500: Wf_Core.Token('KEY', itemkey);
4501: Wf_Core.Raise('WFENG_ITEM');
4502: end if;
4503:
4496: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4497: if (root is null) then
4498: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey, process);
4499: Wf_Core.Token('TYPE', itemtype);
4500: Wf_Core.Token('KEY', itemkey);
4501: Wf_Core.Raise('WFENG_ITEM');
4502: end if;
4503:
4504: -- Get the process instance id.
4497: if (root is null) then
4498: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey, process);
4499: Wf_Core.Token('TYPE', itemtype);
4500: Wf_Core.Token('KEY', itemkey);
4501: Wf_Core.Raise('WFENG_ITEM');
4502: end if;
4503:
4504: -- Get the process instance id.
4505: -- Search the process beginnning at the root process of the item for the
4506: -- activity matching process.
4507: actdate := Wf_Item.Active_Date(itemtype, itemkey);
4508: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4509: if (rootid is null) then
4510: Wf_Core.Token('TYPE', itemtype);
4511: Wf_Core.Token('KEY', itemkey);
4512: Wf_Core.Token('NAME', root);
4513: Wf_Core.Raise('WFENG_ITEM_ROOT');
4514: end if;
4507: actdate := Wf_Item.Active_Date(itemtype, itemkey);
4508: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4509: if (rootid is null) then
4510: Wf_Core.Token('TYPE', itemtype);
4511: Wf_Core.Token('KEY', itemkey);
4512: Wf_Core.Token('NAME', root);
4513: Wf_Core.Raise('WFENG_ITEM_ROOT');
4514: end if;
4515:
4508: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4509: if (rootid is null) then
4510: Wf_Core.Token('TYPE', itemtype);
4511: Wf_Core.Token('KEY', itemkey);
4512: Wf_Core.Token('NAME', root);
4513: Wf_Core.Raise('WFENG_ITEM_ROOT');
4514: end if;
4515:
4516: if (process is null) then
4509: if (rootid is null) then
4510: Wf_Core.Token('TYPE', itemtype);
4511: Wf_Core.Token('KEY', itemkey);
4512: Wf_Core.Token('NAME', root);
4513: Wf_Core.Raise('WFENG_ITEM_ROOT');
4514: end if;
4515:
4516: if (process is null) then
4517: -- Abort the root process
4521: -- Abort the given process
4522: proc := process;
4523: procid := Wf_Process_Activity.FindActivity(rootid, process, actdate);
4524: if (procid is null) then
4525: Wf_Core.Token('TYPE', itemtype);
4526: Wf_Core.Token('KEY', itemkey);
4527: Wf_Core.Token('NAME', process);
4528: Wf_Core.Token('VERSION', to_char(version));
4529: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4522: proc := process;
4523: procid := Wf_Process_Activity.FindActivity(rootid, process, actdate);
4524: if (procid is null) then
4525: Wf_Core.Token('TYPE', itemtype);
4526: Wf_Core.Token('KEY', itemkey);
4527: Wf_Core.Token('NAME', process);
4528: Wf_Core.Token('VERSION', to_char(version));
4529: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4530: end if;
4523: procid := Wf_Process_Activity.FindActivity(rootid, process, actdate);
4524: if (procid is null) then
4525: Wf_Core.Token('TYPE', itemtype);
4526: Wf_Core.Token('KEY', itemkey);
4527: Wf_Core.Token('NAME', process);
4528: Wf_Core.Token('VERSION', to_char(version));
4529: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4530: end if;
4531:
4524: if (procid is null) then
4525: Wf_Core.Token('TYPE', itemtype);
4526: Wf_Core.Token('KEY', itemkey);
4527: Wf_Core.Token('NAME', process);
4528: Wf_Core.Token('VERSION', to_char(version));
4529: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4530: end if;
4531:
4532: -- Check that activity is a PROCESS-type.
4525: Wf_Core.Token('TYPE', itemtype);
4526: Wf_Core.Token('KEY', itemkey);
4527: Wf_Core.Token('NAME', process);
4528: Wf_Core.Token('VERSION', to_char(version));
4529: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4530: end if;
4531:
4532: -- Check that activity is a PROCESS-type.
4533: -- Only PROCESS activities may be aborted.
4532: -- Check that activity is a PROCESS-type.
4533: -- Only PROCESS activities may be aborted.
4534: if (Wf_Activity.Instance_Type(procid, actdate) <>
4535: wf_engine.eng_process) then
4536: Wf_Core.Token('NAME', proc);
4537: Wf_Core.Token('TYPE', itemtype);
4538: Wf_Core.Raise('WFENG_PROCESS_NAME');
4539: end if;
4540: end if;
4533: -- Only PROCESS activities may be aborted.
4534: if (Wf_Activity.Instance_Type(procid, actdate) <>
4535: wf_engine.eng_process) then
4536: Wf_Core.Token('NAME', proc);
4537: Wf_Core.Token('TYPE', itemtype);
4538: Wf_Core.Raise('WFENG_PROCESS_NAME');
4539: end if;
4540: end if;
4541:
4534: if (Wf_Activity.Instance_Type(procid, actdate) <>
4535: wf_engine.eng_process) then
4536: Wf_Core.Token('NAME', proc);
4537: Wf_Core.Token('TYPE', itemtype);
4538: Wf_Core.Raise('WFENG_PROCESS_NAME');
4539: end if;
4540: end if;
4541:
4542: -- Always clear the cache first
4546: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4547:
4548: if (status is null) then
4549: if (WF_ITEM.SetEndDate(itemtype, itemkey) = 1) then
4550: Wf_Core.Token('TYPE', itemtype);
4551: Wf_core.Token('KEY', itemkey);
4552: Wf_core.Token('NAME', proc);
4553: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4554: end if;
4547:
4548: if (status is null) then
4549: if (WF_ITEM.SetEndDate(itemtype, itemkey) = 1) then
4550: Wf_Core.Token('TYPE', itemtype);
4551: Wf_core.Token('KEY', itemkey);
4552: Wf_core.Token('NAME', proc);
4553: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4554: end if;
4555:
4548: if (status is null) then
4549: if (WF_ITEM.SetEndDate(itemtype, itemkey) = 1) then
4550: Wf_Core.Token('TYPE', itemtype);
4551: Wf_core.Token('KEY', itemkey);
4552: Wf_core.Token('NAME', proc);
4553: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4554: end if;
4555:
4556: elsif (status = wf_engine.eng_completed) then
4549: if (WF_ITEM.SetEndDate(itemtype, itemkey) = 1) then
4550: Wf_Core.Token('TYPE', itemtype);
4551: Wf_core.Token('KEY', itemkey);
4552: Wf_core.Token('NAME', proc);
4553: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4554: end if;
4555:
4556: elsif (status = wf_engine.eng_completed) then
4557: Wf_Core.Token('TYPE', itemtype);
4553: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4554: end if;
4555:
4556: elsif (status = wf_engine.eng_completed) then
4557: Wf_Core.Token('TYPE', itemtype);
4558: Wf_Core.Token('KEY', itemkey);
4559: Wf_Core.Token('NAME', proc);
4560: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4561: else
4554: end if;
4555:
4556: elsif (status = wf_engine.eng_completed) then
4557: Wf_Core.Token('TYPE', itemtype);
4558: Wf_Core.Token('KEY', itemkey);
4559: Wf_Core.Token('NAME', proc);
4560: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4561: else
4562: -- Mark process as 'COMPLETE', 'result' in WIAS table
4555:
4556: elsif (status = wf_engine.eng_completed) then
4557: Wf_Core.Token('TYPE', itemtype);
4558: Wf_Core.Token('KEY', itemkey);
4559: Wf_Core.Token('NAME', proc);
4560: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4561: else
4562: -- Mark process as 'COMPLETE', 'result' in WIAS table
4563: -- Doing this stops the engine from going through the rest of the flow
4556: elsif (status = wf_engine.eng_completed) then
4557: Wf_Core.Token('TYPE', itemtype);
4558: Wf_Core.Token('KEY', itemkey);
4559: Wf_Core.Token('NAME', proc);
4560: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4561: else
4562: -- Mark process as 'COMPLETE', 'result' in WIAS table
4563: -- Doing this stops the engine from going through the rest of the flow
4564: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4593: p_parameters => l_parameterlist);
4594:
4595: exception
4596: when resource_busy then
4597: wf_core.token('TYPE',itemtype);
4598: wf_core.token('KEY',itemkey);
4599: wf_core.raise('WFENG_RESOURCE_BUSY');
4600:
4601: when others then
4594:
4595: exception
4596: when resource_busy then
4597: wf_core.token('TYPE',itemtype);
4598: wf_core.token('KEY',itemkey);
4599: wf_core.raise('WFENG_RESOURCE_BUSY');
4600:
4601: when others then
4602: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey,
4595: exception
4596: when resource_busy then
4597: wf_core.token('TYPE',itemtype);
4598: wf_core.token('KEY',itemkey);
4599: wf_core.raise('WFENG_RESOURCE_BUSY');
4600:
4601: when others then
4602: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey,
4603: process, result);
4598: wf_core.token('KEY',itemkey);
4599: wf_core.raise('WFENG_RESOURCE_BUSY');
4600:
4601: when others then
4602: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey,
4603: process, result);
4604: raise;
4605: end AbortProcess;
4606:
4647: --Array to select the begin_date for the deferred activities
4648: type InstanceDateArray is table of date index by binary_integer;
4649: act_begin_date InstanceDateArray;
4650: begin
4651: WF_CORE.TAG_DB_SESSION(WF_CORE.CONN_TAG_WF, ResumeProcess.itemtype);
4652:
4653: -- Check Arguments
4654: if (itemtype is null) then
4655: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4651: WF_CORE.TAG_DB_SESSION(WF_CORE.CONN_TAG_WF, ResumeProcess.itemtype);
4652:
4653: -- Check Arguments
4654: if (itemtype is null) then
4655: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4656: Wf_Core.Raise('WFSQL_ARGS');
4657:
4658: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4659: wf_core.token('OPERATION', 'Wf_Engine.ResumeProcess');
4652:
4653: -- Check Arguments
4654: if (itemtype is null) then
4655: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4656: Wf_Core.Raise('WFSQL_ARGS');
4657:
4658: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4659: wf_core.token('OPERATION', 'Wf_Engine.ResumeProcess');
4660: wf_core.raise('WFENG_SYNCH_DISABLED');
4655: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4656: Wf_Core.Raise('WFSQL_ARGS');
4657:
4658: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4659: wf_core.token('OPERATION', 'Wf_Engine.ResumeProcess');
4660: wf_core.raise('WFENG_SYNCH_DISABLED');
4661:
4662: elsif (itemkey is NULL) then
4663: WF_ENGINE.ResumeAll(itemtype, process); --
4656: Wf_Core.Raise('WFSQL_ARGS');
4657:
4658: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4659: wf_core.token('OPERATION', 'Wf_Engine.ResumeProcess');
4660: wf_core.raise('WFENG_SYNCH_DISABLED');
4661:
4662: elsif (itemkey is NULL) then
4663: WF_ENGINE.ResumeAll(itemtype, process); --
4664: return;
4667:
4668: -- Get the root process for this key
4669: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4670: if (root is null) then
4671: Wf_Core.Token('TYPE', itemtype);
4672: Wf_Core.Token('KEY', itemkey);
4673: Wf_Core.Raise('WFENG_ITEM');
4674: end if;
4675:
4668: -- Get the root process for this key
4669: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4670: if (root is null) then
4671: Wf_Core.Token('TYPE', itemtype);
4672: Wf_Core.Token('KEY', itemkey);
4673: Wf_Core.Raise('WFENG_ITEM');
4674: end if;
4675:
4676: -- Get the process instance id.
4669: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4670: if (root is null) then
4671: Wf_Core.Token('TYPE', itemtype);
4672: Wf_Core.Token('KEY', itemkey);
4673: Wf_Core.Raise('WFENG_ITEM');
4674: end if;
4675:
4676: -- Get the process instance id.
4677: -- Search the process beginnning at the root process of the item for the
4678: -- activity matching process.
4679: actdate := Wf_Item.Active_Date(itemtype, itemkey);
4680: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4681: if (rootid is null) then
4682: Wf_Core.Token('TYPE', itemtype);
4683: Wf_Core.Token('KEY', itemkey);
4684: Wf_Core.Token('NAME', root);
4685: Wf_Core.Raise('WFENG_ITEM_ROOT');
4686: end if;
4679: actdate := Wf_Item.Active_Date(itemtype, itemkey);
4680: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4681: if (rootid is null) then
4682: Wf_Core.Token('TYPE', itemtype);
4683: Wf_Core.Token('KEY', itemkey);
4684: Wf_Core.Token('NAME', root);
4685: Wf_Core.Raise('WFENG_ITEM_ROOT');
4686: end if;
4687:
4680: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4681: if (rootid is null) then
4682: Wf_Core.Token('TYPE', itemtype);
4683: Wf_Core.Token('KEY', itemkey);
4684: Wf_Core.Token('NAME', root);
4685: Wf_Core.Raise('WFENG_ITEM_ROOT');
4686: end if;
4687:
4688: if (process is null) then
4681: if (rootid is null) then
4682: Wf_Core.Token('TYPE', itemtype);
4683: Wf_Core.Token('KEY', itemkey);
4684: Wf_Core.Token('NAME', root);
4685: Wf_Core.Raise('WFENG_ITEM_ROOT');
4686: end if;
4687:
4688: if (process is null) then
4689: -- Resume the root process
4693: -- Resume the given process
4694: proc := process;
4695: procid := Wf_Process_Activity.FindActivity(rootid, process, actdate);
4696: if (procid is null) then
4697: Wf_Core.Token('TYPE', itemtype);
4698: Wf_Core.Token('KEY', itemkey);
4699: Wf_Core.Token('NAME', process);
4700: Wf_Core.Token('VERSION', to_char(version));
4701: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4694: proc := process;
4695: procid := Wf_Process_Activity.FindActivity(rootid, process, actdate);
4696: if (procid is null) then
4697: Wf_Core.Token('TYPE', itemtype);
4698: Wf_Core.Token('KEY', itemkey);
4699: Wf_Core.Token('NAME', process);
4700: Wf_Core.Token('VERSION', to_char(version));
4701: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4702: end if;
4695: procid := Wf_Process_Activity.FindActivity(rootid, process, actdate);
4696: if (procid is null) then
4697: Wf_Core.Token('TYPE', itemtype);
4698: Wf_Core.Token('KEY', itemkey);
4699: Wf_Core.Token('NAME', process);
4700: Wf_Core.Token('VERSION', to_char(version));
4701: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4702: end if;
4703:
4696: if (procid is null) then
4697: Wf_Core.Token('TYPE', itemtype);
4698: Wf_Core.Token('KEY', itemkey);
4699: Wf_Core.Token('NAME', process);
4700: Wf_Core.Token('VERSION', to_char(version));
4701: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4702: end if;
4703:
4704: -- Check that activity is a PROCESS-type.
4697: Wf_Core.Token('TYPE', itemtype);
4698: Wf_Core.Token('KEY', itemkey);
4699: Wf_Core.Token('NAME', process);
4700: Wf_Core.Token('VERSION', to_char(version));
4701: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4702: end if;
4703:
4704: -- Check that activity is a PROCESS-type.
4705: -- Only PROCESS activities may be resumed.
4704: -- Check that activity is a PROCESS-type.
4705: -- Only PROCESS activities may be resumed.
4706: if (Wf_Activity.Instance_Type(procid, actdate) <>
4707: wf_engine.eng_process) then
4708: Wf_Core.Token('NAME', proc);
4709: Wf_Core.Token('TYPE', itemtype);
4710: Wf_Core.Raise('WFENG_PROCESS_NAME');
4711: end if;
4712: end if;
4705: -- Only PROCESS activities may be resumed.
4706: if (Wf_Activity.Instance_Type(procid, actdate) <>
4707: wf_engine.eng_process) then
4708: Wf_Core.Token('NAME', proc);
4709: Wf_Core.Token('TYPE', itemtype);
4710: Wf_Core.Raise('WFENG_PROCESS_NAME');
4711: end if;
4712: end if;
4713:
4706: if (Wf_Activity.Instance_Type(procid, actdate) <>
4707: wf_engine.eng_process) then
4708: Wf_Core.Token('NAME', proc);
4709: Wf_Core.Token('TYPE', itemtype);
4710: Wf_Core.Raise('WFENG_PROCESS_NAME');
4711: end if;
4712: end if;
4713:
4714: -- Always clear the cache first
4716:
4717: -- Check if the process is suspended
4718: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4719: if (status is null) then
4720: Wf_Core.Token('TYPE', itemtype);
4721: Wf_Core.Token('KEY', itemkey);
4722: Wf_Core.Token('NAME', proc);
4723: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4724: elsif (status <> wf_engine.eng_suspended) then
4717: -- Check if the process is suspended
4718: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4719: if (status is null) then
4720: Wf_Core.Token('TYPE', itemtype);
4721: Wf_Core.Token('KEY', itemkey);
4722: Wf_Core.Token('NAME', proc);
4723: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4724: elsif (status <> wf_engine.eng_suspended) then
4725: Wf_Core.Token('TYPE', itemtype);
4718: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4719: if (status is null) then
4720: Wf_Core.Token('TYPE', itemtype);
4721: Wf_Core.Token('KEY', itemkey);
4722: Wf_Core.Token('NAME', proc);
4723: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4724: elsif (status <> wf_engine.eng_suspended) then
4725: Wf_Core.Token('TYPE', itemtype);
4726: Wf_Core.Token('KEY', itemkey);
4719: if (status is null) then
4720: Wf_Core.Token('TYPE', itemtype);
4721: Wf_Core.Token('KEY', itemkey);
4722: Wf_Core.Token('NAME', proc);
4723: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4724: elsif (status <> wf_engine.eng_suspended) then
4725: Wf_Core.Token('TYPE', itemtype);
4726: Wf_Core.Token('KEY', itemkey);
4727: Wf_Core.Token('NAME', proc);
4721: Wf_Core.Token('KEY', itemkey);
4722: Wf_Core.Token('NAME', proc);
4723: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4724: elsif (status <> wf_engine.eng_suspended) then
4725: Wf_Core.Token('TYPE', itemtype);
4726: Wf_Core.Token('KEY', itemkey);
4727: Wf_Core.Token('NAME', proc);
4728: Wf_Core.Raise('WFENG_ITEM_PROCESS_SUSPENDED');
4729: else
4722: Wf_Core.Token('NAME', proc);
4723: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4724: elsif (status <> wf_engine.eng_suspended) then
4725: Wf_Core.Token('TYPE', itemtype);
4726: Wf_Core.Token('KEY', itemkey);
4727: Wf_Core.Token('NAME', proc);
4728: Wf_Core.Raise('WFENG_ITEM_PROCESS_SUSPENDED');
4729: else
4730: -- If we came here, that means the process is currently suspended.
4723: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4724: elsif (status <> wf_engine.eng_suspended) then
4725: Wf_Core.Token('TYPE', itemtype);
4726: Wf_Core.Token('KEY', itemkey);
4727: Wf_Core.Token('NAME', proc);
4728: Wf_Core.Raise('WFENG_ITEM_PROCESS_SUSPENDED');
4729: else
4730: -- If we came here, that means the process is currently suspended.
4731: -- Mark process as eng_active 'active', 'null' in WIAS table
4724: elsif (status <> wf_engine.eng_suspended) then
4725: Wf_Core.Token('TYPE', itemtype);
4726: Wf_Core.Token('KEY', itemkey);
4727: Wf_Core.Token('NAME', proc);
4728: Wf_Core.Raise('WFENG_ITEM_PROCESS_SUSPENDED');
4729: else
4730: -- If we came here, that means the process is currently suspended.
4731: -- Mark process as eng_active 'active', 'null' in WIAS table
4732: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4781: -- 2. set this activity to error status
4782: -- 3. execute the error process (if any)
4783: -- 4. clear the error to continue with next activity
4784: rollback to wf_savepoint;
4785: Wf_Core.Context('Wf_Engine', 'ResumeProcess', itemtype, itemkey,
4786: process);
4787: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actidarr(i),
4788: wf_engine.eng_exception, FALSE);
4789: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actidarr(i),
4788: wf_engine.eng_exception, FALSE);
4789: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actidarr(i),
4790: wf_engine.eng_exception);
4791:
4792: Wf_Core.Clear;
4793: end;
4794: --else case status is same as right now that is deferred.
4795: end if;
4796:
4799: end if;
4800:
4801: exception
4802: when others then
4803: Wf_Core.Context('Wf_Engine', 'ResumeProcess', itemtype, itemkey, process);
4804: raise;
4805: end ResumeProcess;
4806:
4807:
4834: WF_ENGINE.SuspendProcess(c.item_type, c.item_key, p_process);
4835:
4836: exception
4837: when others then
4838: if ( wf_core.error_name = 'WFENG_ITEM_PROCESS_ACTIVE' ) then
4839: wf_core.clear;
4840:
4841: else
4842: raise;
4835:
4836: exception
4837: when others then
4838: if ( wf_core.error_name = 'WFENG_ITEM_PROCESS_ACTIVE' ) then
4839: wf_core.clear;
4840:
4841: else
4842: raise;
4843:
4853: WF_ENGINE.SuspendProcess(p_itemType, c.item_key, p_process);
4854:
4855: exception
4856: when others then
4857: if ( wf_core.error_name = 'WFENG_ITEM_PROCESS_ACTIVE' ) then
4858: wf_core.clear;
4859:
4860: else
4861: raise;
4854:
4855: exception
4856: when others then
4857: if ( wf_core.error_name = 'WFENG_ITEM_PROCESS_ACTIVE' ) then
4858: wf_core.clear;
4859:
4860: else
4861: raise;
4862:
4868: end if;
4869:
4870: exception
4871: when others then
4872: Wf_Core.Context('Wf_Engine', 'SuspendAll', p_itemType, p_process);
4873: raise;
4874:
4875: end SuspendAll;
4876:
4955: -- Argument validation
4956: if (copy_itemtype is null)
4957: or (copy_itemkey is null)
4958: or (new_itemkey is null) then
4959: Wf_Core.Token('COPY_ITEMTYPE', copy_itemtype);
4960: Wf_Core.Token('COPY_ITEMKEY', copy_itemkey);
4961: Wf_Core.Token('NEW_ITEMKEY', new_itemkey);
4962: Wf_Core.Raise('WFSQL_ARGS');
4963: end if;
4956: if (copy_itemtype is null)
4957: or (copy_itemkey is null)
4958: or (new_itemkey is null) then
4959: Wf_Core.Token('COPY_ITEMTYPE', copy_itemtype);
4960: Wf_Core.Token('COPY_ITEMKEY', copy_itemkey);
4961: Wf_Core.Token('NEW_ITEMKEY', new_itemkey);
4962: Wf_Core.Raise('WFSQL_ARGS');
4963: end if;
4964:
4957: or (copy_itemkey is null)
4958: or (new_itemkey is null) then
4959: Wf_Core.Token('COPY_ITEMTYPE', copy_itemtype);
4960: Wf_Core.Token('COPY_ITEMKEY', copy_itemkey);
4961: Wf_Core.Token('NEW_ITEMKEY', new_itemkey);
4962: Wf_Core.Raise('WFSQL_ARGS');
4963: end if;
4964:
4965: -- Not allowed in synch mode
4958: or (new_itemkey is null) then
4959: Wf_Core.Token('COPY_ITEMTYPE', copy_itemtype);
4960: Wf_Core.Token('COPY_ITEMKEY', copy_itemkey);
4961: Wf_Core.Token('NEW_ITEMKEY', new_itemkey);
4962: Wf_Core.Raise('WFSQL_ARGS');
4963: end if;
4964:
4965: -- Not allowed in synch mode
4966: if (new_itemkey = wf_engine.eng_synch)
4964:
4965: -- Not allowed in synch mode
4966: if (new_itemkey = wf_engine.eng_synch)
4967: or (copy_itemkey = wf_engine.eng_synch) then
4968: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
4969: wf_core.raise('WFENG_SYNCH_DISABLED');
4970: end if;
4971:
4972: -- Check status
4965: -- Not allowed in synch mode
4966: if (new_itemkey = wf_engine.eng_synch)
4967: or (copy_itemkey = wf_engine.eng_synch) then
4968: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
4969: wf_core.raise('WFENG_SYNCH_DISABLED');
4970: end if;
4971:
4972: -- Check status
4973: Wf_engine.ItemStatus(copy_itemtype, copy_itemkey, status, result);
4971:
4972: -- Check status
4973: Wf_engine.ItemStatus(copy_itemtype, copy_itemkey, status, result);
4974: if (status = wf_engine.eng_error) then
4975: Wf_Core.Raise('WFENG_NOFORK_ONERROR');
4976: end if;
4977:
4978: -- Check for duplicate item
4979: if (Wf_Item.Item_Exist(copy_itemtype, new_itemkey)) then
4976: end if;
4977:
4978: -- Check for duplicate item
4979: if (Wf_Item.Item_Exist(copy_itemtype, new_itemkey)) then
4980: Wf_Core.Token('TYPE', copy_itemtype);
4981: Wf_Core.Token('KEY', new_itemkey);
4982: Wf_Core.Raise('WFENG_ITEM_UNIQUE');
4983: end if;
4984:
4977:
4978: -- Check for duplicate item
4979: if (Wf_Item.Item_Exist(copy_itemtype, new_itemkey)) then
4980: Wf_Core.Token('TYPE', copy_itemtype);
4981: Wf_Core.Token('KEY', new_itemkey);
4982: Wf_Core.Raise('WFENG_ITEM_UNIQUE');
4983: end if;
4984:
4985: --Place row-lock on this item and retrieve parent process info:
4978: -- Check for duplicate item
4979: if (Wf_Item.Item_Exist(copy_itemtype, new_itemkey)) then
4980: Wf_Core.Token('TYPE', copy_itemtype);
4981: Wf_Core.Token('KEY', new_itemkey);
4982: Wf_Core.Raise('WFENG_ITEM_UNIQUE');
4983: end if;
4984:
4985: --Place row-lock on this item and retrieve parent process info:
4986: select parent_item_type, parent_item_key, parent_context
5052:
5053:
5054: -- reset the access_keys to make them unique
5055: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5056: wf_engine.wfmon_mon_key, Wf_Core.Random);
5057: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5058: wf_engine.wfmon_acc_key, Wf_Core.Random);
5059:
5060:
5054: -- reset the access_keys to make them unique
5055: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5056: wf_engine.wfmon_mon_key, Wf_Core.Random);
5057: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5058: wf_engine.wfmon_acc_key, Wf_Core.Random);
5059:
5060:
5061: -- reset the schema, just in case, if the #SCHEMA attribute does not exist
5062: -- it will be added. The CreateProcess api now adds the #SCHEMA.
5068: wf_engine.eng_schema, Wf_Engine.Current_Schema);
5069:
5070: exception
5071: when others then
5072: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
5073: wf_core.clear;
5074: WF_ENGINE.AddItemAttr(copy_itemtype, new_itemkey,
5075: wf_engine.eng_schema,
5076: Wf_Engine.Current_Schema);
5069:
5070: exception
5071: when others then
5072: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
5073: wf_core.clear;
5074: WF_ENGINE.AddItemAttr(copy_itemtype, new_itemkey,
5075: wf_engine.eng_schema,
5076: Wf_Engine.Current_Schema);
5077:
5091: when others then
5092: --
5093: -- If item attribute already exists then ignore the error
5094: --
5095: if ( wf_core.error_name = 'WFENG_ITEM_ATTR_UNIQUE' ) then
5096: wf_core.clear;
5097: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5098: '#FORKED_FROM', copy_itemkey);
5099: else
5092: --
5093: -- If item attribute already exists then ignore the error
5094: --
5095: if ( wf_core.error_name = 'WFENG_ITEM_ATTR_UNIQUE' ) then
5096: wf_core.clear;
5097: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5098: '#FORKED_FROM', copy_itemkey);
5099: else
5100: raise;
5132: '#CNT_'||l_parent_context,
5133: 1);
5134: exception
5135: when ValTooLarge OR ValTooLargeNew then
5136: Wf_Core.Context('WF_ENGINE', 'CreateForkProcess', copy_itemtype,
5137: copy_itemkey, new_itemkey, l_parent_itemtype,
5138: l_parent_itemkey, l_parent_context, 'TRUE');
5139: WF_CORE.Token('LABEL', l_parent_context);
5140: WF_CORE.Token('LENGTH', 30);
5135: when ValTooLarge OR ValTooLargeNew then
5136: Wf_Core.Context('WF_ENGINE', 'CreateForkProcess', copy_itemtype,
5137: copy_itemkey, new_itemkey, l_parent_itemtype,
5138: l_parent_itemkey, l_parent_context, 'TRUE');
5139: WF_CORE.Token('LABEL', l_parent_context);
5140: WF_CORE.Token('LENGTH', 30);
5141: WF_CORE.Raise('WFENG_LABEL_TOO_LARGE');
5142: end;
5143: else
5136: Wf_Core.Context('WF_ENGINE', 'CreateForkProcess', copy_itemtype,
5137: copy_itemkey, new_itemkey, l_parent_itemtype,
5138: l_parent_itemkey, l_parent_context, 'TRUE');
5139: WF_CORE.Token('LABEL', l_parent_context);
5140: WF_CORE.Token('LENGTH', 30);
5141: WF_CORE.Raise('WFENG_LABEL_TOO_LARGE');
5142: end;
5143: else
5144: -- PARENT_CONTEXT is null
5137: copy_itemkey, new_itemkey, l_parent_itemtype,
5138: l_parent_itemkey, l_parent_context, 'TRUE');
5139: WF_CORE.Token('LABEL', l_parent_context);
5140: WF_CORE.Token('LENGTH', 30);
5141: WF_CORE.Raise('WFENG_LABEL_TOO_LARGE');
5142: end;
5143: else
5144: -- PARENT_CONTEXT is null
5145: -- increase all known #CNT counter by 1
5154: end if; --There is a parent item to this forked process.
5155: end if; --The caller signalled that this is a master/detail process.
5156: exception
5157: when others then
5158: Wf_Core.Context('Wf_Engine', 'CreateForkProcess');
5159: raise;
5160: end CreateForkProcess;
5161:
5162:
5232:
5233:
5234:
5235: begin
5236: WF_CORE.TAG_DB_SESSION(WF_CORE.CONN_TAG_WF, StartForkProcess.itemtype);
5237: -- Argument validation
5238: if (itemtype is null)
5239: or (itemkey is null) then
5240: Wf_Core.Token('COPY_ITEMTYPE', itemtype);
5236: WF_CORE.TAG_DB_SESSION(WF_CORE.CONN_TAG_WF, StartForkProcess.itemtype);
5237: -- Argument validation
5238: if (itemtype is null)
5239: or (itemkey is null) then
5240: Wf_Core.Token('COPY_ITEMTYPE', itemtype);
5241: Wf_Core.Token('COPY_ITEMKEY', copy_itemkey);
5242: Wf_Core.Token('NEW_ITEMKEY', itemkey);
5243: Wf_Core.Raise('WFSQL_ARGS');
5244: end if;
5237: -- Argument validation
5238: if (itemtype is null)
5239: or (itemkey is null) then
5240: Wf_Core.Token('COPY_ITEMTYPE', itemtype);
5241: Wf_Core.Token('COPY_ITEMKEY', copy_itemkey);
5242: Wf_Core.Token('NEW_ITEMKEY', itemkey);
5243: Wf_Core.Raise('WFSQL_ARGS');
5244: end if;
5245:
5238: if (itemtype is null)
5239: or (itemkey is null) then
5240: Wf_Core.Token('COPY_ITEMTYPE', itemtype);
5241: Wf_Core.Token('COPY_ITEMKEY', copy_itemkey);
5242: Wf_Core.Token('NEW_ITEMKEY', itemkey);
5243: Wf_Core.Raise('WFSQL_ARGS');
5244: end if;
5245:
5246:
5239: or (itemkey is null) then
5240: Wf_Core.Token('COPY_ITEMTYPE', itemtype);
5241: Wf_Core.Token('COPY_ITEMKEY', copy_itemkey);
5242: Wf_Core.Token('NEW_ITEMKEY', itemkey);
5243: Wf_Core.Raise('WFSQL_ARGS');
5244: end if;
5245:
5246:
5247: -- get the forked_from attribute: if it doesnt exist then this cannot be
5248: -- a forked item
5249: begin
5250: copy_itemkey := Wf_Engine.GetItemAttrText(itemtype, itemkey,'#FORKED_FROM');
5251: exception when others then
5252: Wf_Core.Raise('WF_NOFORK');
5253: end;
5254:
5255:
5256: -- Not allowed in synch mode
5255:
5256: -- Not allowed in synch mode
5257: if (itemkey = wf_engine.eng_synch)
5258: or (copy_itemkey = wf_engine.eng_synch) then
5259: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
5260: wf_core.raise('WFENG_SYNCH_DISABLED');
5261: end if;
5262:
5263:
5256: -- Not allowed in synch mode
5257: if (itemkey = wf_engine.eng_synch)
5258: or (copy_itemkey = wf_engine.eng_synch) then
5259: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
5260: wf_core.raise('WFENG_SYNCH_DISABLED');
5261: end if;
5262:
5263:
5264: -- Check item exists and store attributes while cached
5262:
5263:
5264: -- Check item exists and store attributes while cached
5265: if not (Wf_Item.Item_Exist(itemtype, copy_itemkey)) then
5266: Wf_Core.Token('TYPE', itemtype);
5267: Wf_Core.Token('KEY', copy_itemkey);
5268: Wf_Core.Raise('WFENG_ITEM');
5269: end if;
5270:
5263:
5264: -- Check item exists and store attributes while cached
5265: if not (Wf_Item.Item_Exist(itemtype, copy_itemkey)) then
5266: Wf_Core.Token('TYPE', itemtype);
5267: Wf_Core.Token('KEY', copy_itemkey);
5268: Wf_Core.Raise('WFENG_ITEM');
5269: end if;
5270:
5271: wf_item.Root_Process(itemtype => itemtype,
5264: -- Check item exists and store attributes while cached
5265: if not (Wf_Item.Item_Exist(itemtype, copy_itemkey)) then
5266: Wf_Core.Token('TYPE', itemtype);
5267: Wf_Core.Token('KEY', copy_itemkey);
5268: Wf_Core.Raise('WFENG_ITEM');
5269: end if;
5270:
5271: wf_item.Root_Process(itemtype => itemtype,
5272: itemkey => copy_itemkey,
5282:
5283:
5284: -- Check item exists
5285: if not (Wf_Item.Item_Exist(itemtype, itemkey)) then
5286: Wf_Core.Token('TYPE', itemtype);
5287: Wf_Core.Token('KEY', itemkey);
5288: Wf_Core.Raise('WFENG_ITEM');
5289: end if;
5290:
5283:
5284: -- Check item exists
5285: if not (Wf_Item.Item_Exist(itemtype, itemkey)) then
5286: Wf_Core.Token('TYPE', itemtype);
5287: Wf_Core.Token('KEY', itemkey);
5288: Wf_Core.Raise('WFENG_ITEM');
5289: end if;
5290:
5291: wf_item.Root_Process(itemtype => itemtype,
5284: -- Check item exists
5285: if not (Wf_Item.Item_Exist(itemtype, itemkey)) then
5286: Wf_Core.Token('TYPE', itemtype);
5287: Wf_Core.Token('KEY', itemkey);
5288: Wf_Core.Raise('WFENG_ITEM');
5289: end if;
5290:
5291: wf_item.Root_Process(itemtype => itemtype,
5292: itemkey => itemkey,
5307: or copy_active_date <> new_active_date then
5308: begin
5309: wf_engine.startprocess(itemtype,itemkey);
5310: exception when others then
5311: Wf_Core.raise('WF_CANNOT_FORK');
5312: end;
5313: return;
5314: end if;
5315:
5463:
5464:
5465: exception
5466: when others then
5467: Wf_Core.Context('Wf_Engine', 'StartForkProcess');
5468: raise;
5469: end StartForkProcess;
5470:
5471:
5491: actid pls_integer; -- activity instance id
5492: begin
5493: -- Not allowed in synch mode
5494: if (itemkey = wf_engine.eng_synch) then
5495: wf_core.token('OPERATION', 'Wf_Engine.BeginActivity');
5496: wf_core.raise('WFENG_SYNCH_DISABLED');
5497: end if;
5498:
5499: -- Argument validation
5492: begin
5493: -- Not allowed in synch mode
5494: if (itemkey = wf_engine.eng_synch) then
5495: wf_core.token('OPERATION', 'Wf_Engine.BeginActivity');
5496: wf_core.raise('WFENG_SYNCH_DISABLED');
5497: end if;
5498:
5499: -- Argument validation
5500: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5497: end if;
5498:
5499: -- Argument validation
5500: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5501: Wf_Core.Token('ITEMTYPE', itemtype);
5502: Wf_Core.Token('ITEMKEY', itemkey);
5503: Wf_Core.Token('ACTIVITY', activity);
5504: Wf_Core.Raise('WFSQL_ARGS');
5505: end if;
5498:
5499: -- Argument validation
5500: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5501: Wf_Core.Token('ITEMTYPE', itemtype);
5502: Wf_Core.Token('ITEMKEY', itemkey);
5503: Wf_Core.Token('ACTIVITY', activity);
5504: Wf_Core.Raise('WFSQL_ARGS');
5505: end if;
5506:
5499: -- Argument validation
5500: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5501: Wf_Core.Token('ITEMTYPE', itemtype);
5502: Wf_Core.Token('ITEMKEY', itemkey);
5503: Wf_Core.Token('ACTIVITY', activity);
5504: Wf_Core.Raise('WFSQL_ARGS');
5505: end if;
5506:
5507: -- Validate the activity and get the actid.
5500: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5501: Wf_Core.Token('ITEMTYPE', itemtype);
5502: Wf_Core.Token('ITEMKEY', itemkey);
5503: Wf_Core.Token('ACTIVITY', activity);
5504: Wf_Core.Raise('WFSQL_ARGS');
5505: end if;
5506:
5507: -- Validate the activity and get the actid.
5508: -- One of these conditions must hold:
5523: -- start activity as an argument to implicitly choose a root
5524: -- process when no selector function is defined.
5525: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey, activity);
5526: if (root is null) then
5527: Wf_Core.Token('TYPE', itemtype);
5528: Wf_Core.Token('KEY', itemkey);
5529: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
5530: end if;
5531:
5524: -- process when no selector function is defined.
5525: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey, activity);
5526: if (root is null) then
5527: Wf_Core.Token('TYPE', itemtype);
5528: Wf_Core.Token('KEY', itemkey);
5529: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
5530: end if;
5531:
5532: else
5525: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey, activity);
5526: if (root is null) then
5527: Wf_Core.Token('TYPE', itemtype);
5528: Wf_Core.Token('KEY', itemkey);
5529: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
5530: end if;
5531:
5532: else
5533: -- Item exists. Must be case (2).
5536: activity, wf_engine.eng_notified);
5537:
5538: -- Any other status, or no status at all, is an error.
5539: if (actid is null) then
5540: Wf_Core.Token('TYPE', itemtype);
5541: Wf_Core.Token('KEY', itemkey);
5542: Wf_Core.Token('NAME', activity);
5543: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5544: end if;
5537:
5538: -- Any other status, or no status at all, is an error.
5539: if (actid is null) then
5540: Wf_Core.Token('TYPE', itemtype);
5541: Wf_Core.Token('KEY', itemkey);
5542: Wf_Core.Token('NAME', activity);
5543: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5544: end if;
5545:
5538: -- Any other status, or no status at all, is an error.
5539: if (actid is null) then
5540: Wf_Core.Token('TYPE', itemtype);
5541: Wf_Core.Token('KEY', itemkey);
5542: Wf_Core.Token('NAME', activity);
5543: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5544: end if;
5545:
5546: end if;
5539: if (actid is null) then
5540: Wf_Core.Token('TYPE', itemtype);
5541: Wf_Core.Token('KEY', itemkey);
5542: Wf_Core.Token('NAME', activity);
5543: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5544: end if;
5545:
5546: end if;
5547: exception
5545:
5546: end if;
5547: exception
5548: when others then
5549: Wf_Core.Context('Wf_Engine', 'BeginActivity', itemtype, itemkey, activity);
5550: raise;
5551: end BeginActivity;
5552:
5553: --
5588:
5589: --Bug 2607770
5590: l_lock boolean;
5591: begin
5592: WF_CORE.TAG_DB_SESSION(WF_CORE.CONN_TAG_WF, CompleteActivity.itemtype);
5593: -- Argument validation
5594: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5595: Wf_Core.Token('ITEMTYPE', itemtype);
5596: Wf_Core.Token('ITEMKEY', itemkey);
5591: begin
5592: WF_CORE.TAG_DB_SESSION(WF_CORE.CONN_TAG_WF, CompleteActivity.itemtype);
5593: -- Argument validation
5594: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5595: Wf_Core.Token('ITEMTYPE', itemtype);
5596: Wf_Core.Token('ITEMKEY', itemkey);
5597: Wf_Core.Token('ACTIVITY', activity);
5598: Wf_Core.Raise('WFSQL_ARGS');
5599: end if;
5592: WF_CORE.TAG_DB_SESSION(WF_CORE.CONN_TAG_WF, CompleteActivity.itemtype);
5593: -- Argument validation
5594: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5595: Wf_Core.Token('ITEMTYPE', itemtype);
5596: Wf_Core.Token('ITEMKEY', itemkey);
5597: Wf_Core.Token('ACTIVITY', activity);
5598: Wf_Core.Raise('WFSQL_ARGS');
5599: end if;
5600:
5593: -- Argument validation
5594: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5595: Wf_Core.Token('ITEMTYPE', itemtype);
5596: Wf_Core.Token('ITEMKEY', itemkey);
5597: Wf_Core.Token('ACTIVITY', activity);
5598: Wf_Core.Raise('WFSQL_ARGS');
5599: end if;
5600:
5601: if (WF_CACHE.MetaRefreshed) then
5594: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5595: Wf_Core.Token('ITEMTYPE', itemtype);
5596: Wf_Core.Token('ITEMKEY', itemkey);
5597: Wf_Core.Token('ACTIVITY', activity);
5598: Wf_Core.Raise('WFSQL_ARGS');
5599: end if;
5600:
5601: if (WF_CACHE.MetaRefreshed) then
5602: null;
5622: -- start activity as an argument to implicitly choose a root
5623: -- process when no selector function is defined.
5624: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey, activity);
5625: if (root is null) then
5626: Wf_Core.Token('TYPE', itemtype);
5627: Wf_Core.Token('KEY', itemkey);
5628: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
5629: end if;
5630:
5623: -- process when no selector function is defined.
5624: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey, activity);
5625: if (root is null) then
5626: Wf_Core.Token('TYPE', itemtype);
5627: Wf_Core.Token('KEY', itemkey);
5628: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
5629: end if;
5630:
5631: -- Create new process
5624: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey, activity);
5625: if (root is null) then
5626: Wf_Core.Token('TYPE', itemtype);
5627: Wf_Core.Token('KEY', itemkey);
5628: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
5629: end if;
5630:
5631: -- Create new process
5632: Wf_Engine.CreateProcess(itemtype, itemkey, root);
5663: activity, wf_engine.eng_notified);
5664:
5665: -- Any other status, or no status at all, is an error.
5666: if (actid is null) then
5667: Wf_Core.Token('TYPE', itemtype);
5668: Wf_Core.Token('KEY', itemkey);
5669: Wf_Core.Token('NAME', activity);
5670: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5671: end if;
5664:
5665: -- Any other status, or no status at all, is an error.
5666: if (actid is null) then
5667: Wf_Core.Token('TYPE', itemtype);
5668: Wf_Core.Token('KEY', itemkey);
5669: Wf_Core.Token('NAME', activity);
5670: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5671: end if;
5672:
5665: -- Any other status, or no status at all, is an error.
5666: if (actid is null) then
5667: Wf_Core.Token('TYPE', itemtype);
5668: Wf_Core.Token('KEY', itemkey);
5669: Wf_Core.Token('NAME', activity);
5670: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5671: end if;
5672:
5673: --If acquire lock returns true we will continue
5666: if (actid is null) then
5667: Wf_Core.Token('TYPE', itemtype);
5668: Wf_Core.Token('KEY', itemkey);
5669: Wf_Core.Token('NAME', activity);
5670: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5671: end if;
5672:
5673: --If acquire lock returns true we will continue
5674: --If it returns false we raise exception to the user
5728: -- errors. If FALSE default behavior goes on
5729: if raise_engine_exception then
5730: raise;
5731: else
5732: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,
5733: activity, result);
5734: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
5735: wf_engine.eng_exception, FALSE);
5736: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
5734: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
5735: wf_engine.eng_exception, FALSE);
5736: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
5737: wf_engine.eng_exception);
5738: Wf_Core.Clear;
5739: end if;
5740: end;
5741: end if;
5742:
5741: end if;
5742:
5743: exception
5744: when resource_busy then
5745: wf_core.token('TYPE',itemtype);
5746: wf_core.token('KEY',itemkey);
5747: wf_core.raise('WFENG_RESOURCE_BUSY');
5748: when others then
5749: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,
5742:
5743: exception
5744: when resource_busy then
5745: wf_core.token('TYPE',itemtype);
5746: wf_core.token('KEY',itemkey);
5747: wf_core.raise('WFENG_RESOURCE_BUSY');
5748: when others then
5749: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,
5750: activity, result);
5743: exception
5744: when resource_busy then
5745: wf_core.token('TYPE',itemtype);
5746: wf_core.token('KEY',itemkey);
5747: wf_core.raise('WFENG_RESOURCE_BUSY');
5748: when others then
5749: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,
5750: activity, result);
5751: raise;
5745: wf_core.token('TYPE',itemtype);
5746: wf_core.token('KEY',itemkey);
5747: wf_core.raise('WFENG_RESOURCE_BUSY');
5748: when others then
5749: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,
5750: activity, result);
5751: raise;
5752: end CompleteActivity;
5753:
5781: process varchar2(30);
5782: actname varchar2(30);
5783: label varchar2(30);
5784: begin
5785: WF_CORE.TAG_DB_SESSION(WF_CORE.CONN_TAG_WF, CompleteActivityInternalName.itemtype);
5786: -- Not allowed in synch mode
5787: if (itemkey = wf_engine.eng_synch) then
5788: wf_core.token('OPERATION', 'Wf_Engine.CompleteActivityInternalName');
5789: wf_core.raise('WFENG_SYNCH_DISABLED');
5784: begin
5785: WF_CORE.TAG_DB_SESSION(WF_CORE.CONN_TAG_WF, CompleteActivityInternalName.itemtype);
5786: -- Not allowed in synch mode
5787: if (itemkey = wf_engine.eng_synch) then
5788: wf_core.token('OPERATION', 'Wf_Engine.CompleteActivityInternalName');
5789: wf_core.raise('WFENG_SYNCH_DISABLED');
5790: end if;
5791:
5792: -- Argument validation
5785: WF_CORE.TAG_DB_SESSION(WF_CORE.CONN_TAG_WF, CompleteActivityInternalName.itemtype);
5786: -- Not allowed in synch mode
5787: if (itemkey = wf_engine.eng_synch) then
5788: wf_core.token('OPERATION', 'Wf_Engine.CompleteActivityInternalName');
5789: wf_core.raise('WFENG_SYNCH_DISABLED');
5790: end if;
5791:
5792: -- Argument validation
5793: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5790: end if;
5791:
5792: -- Argument validation
5793: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5794: Wf_Core.Token('ITEMTYPE', itemtype);
5795: Wf_Core.Token('ITEMKEY', itemkey);
5796: Wf_Core.Token('ACTIVITY', activity);
5797: Wf_Core.Raise('WFSQL_ARGS');
5798: end if;
5791:
5792: -- Argument validation
5793: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5794: Wf_Core.Token('ITEMTYPE', itemtype);
5795: Wf_Core.Token('ITEMKEY', itemkey);
5796: Wf_Core.Token('ACTIVITY', activity);
5797: Wf_Core.Raise('WFSQL_ARGS');
5798: end if;
5799:
5792: -- Argument validation
5793: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5794: Wf_Core.Token('ITEMTYPE', itemtype);
5795: Wf_Core.Token('ITEMKEY', itemkey);
5796: Wf_Core.Token('ACTIVITY', activity);
5797: Wf_Core.Raise('WFSQL_ARGS');
5798: end if;
5799:
5800: -- Parse activity arg into
5793: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5794: Wf_Core.Token('ITEMTYPE', itemtype);
5795: Wf_Core.Token('ITEMKEY', itemkey);
5796: Wf_Core.Token('ACTIVITY', activity);
5797: Wf_Core.Raise('WFSQL_ARGS');
5798: end if;
5799:
5800: -- Parse activity arg into
5801: colon := instr(activity, ':');
5821: and WPA.ACTIVITY_NAME = actname
5822: and WPA.PROCESS_NAME = nvl(process, WPA.PROCESS_NAME);
5823: exception
5824: when no_data_found then
5825: Wf_Core.Token('TYPE', itemtype);
5826: Wf_Core.Token('KEY', itemkey);
5827: Wf_Core.Token('NAME', activity);
5828: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5829: end;
5822: and WPA.PROCESS_NAME = nvl(process, WPA.PROCESS_NAME);
5823: exception
5824: when no_data_found then
5825: Wf_Core.Token('TYPE', itemtype);
5826: Wf_Core.Token('KEY', itemkey);
5827: Wf_Core.Token('NAME', activity);
5828: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5829: end;
5830:
5823: exception
5824: when no_data_found then
5825: Wf_Core.Token('TYPE', itemtype);
5826: Wf_Core.Token('KEY', itemkey);
5827: Wf_Core.Token('NAME', activity);
5828: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5829: end;
5830:
5831: -- Complete activity with the correct arguments
5824: when no_data_found then
5825: Wf_Core.Token('TYPE', itemtype);
5826: Wf_Core.Token('KEY', itemkey);
5827: Wf_Core.Token('NAME', activity);
5828: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5829: end;
5830:
5831: -- Complete activity with the correct arguments
5832: Wf_Engine.CompleteActivity(itemtype, itemkey, process||':'||label,
5833: result, CompleteActivityInternalName.raise_engine_exception);
5834:
5835: exception
5836: when others then
5837: Wf_Core.Context('Wf_Engine', 'CompleteActivityInternalName',
5838: itemtype, itemkey, activity, result);
5839: raise;
5840: end CompleteActivityInternalName;
5841:
5874: expand_role varchar2(1);
5875: begin
5876: -- Not allowed in synch mode
5877: if (itemkey = wf_engine.eng_synch) then
5878: wf_core.token('OPERATION', 'Wf_Engine.AssignActivity');
5879: wf_core.raise('WFENG_SYNCH_DISABLED');
5880: end if;
5881:
5882: -- Argument validation
5875: begin
5876: -- Not allowed in synch mode
5877: if (itemkey = wf_engine.eng_synch) then
5878: wf_core.token('OPERATION', 'Wf_Engine.AssignActivity');
5879: wf_core.raise('WFENG_SYNCH_DISABLED');
5880: end if;
5881:
5882: -- Argument validation
5883: if ((itemtype is null) or (itemkey is null) or (activity is null) or
5881:
5882: -- Argument validation
5883: if ((itemtype is null) or (itemkey is null) or (activity is null) or
5884: (performer is null)) then
5885: Wf_Core.Token('ITEMTYPE', itemtype);
5886: Wf_Core.Token('ITEMKEY', itemkey);
5887: Wf_Core.Token('ACTIVITY', activity);
5888: Wf_Core.Token('PERFORMER', performer);
5889: Wf_Core.Raise('WFSQL_ARGS');
5882: -- Argument validation
5883: if ((itemtype is null) or (itemkey is null) or (activity is null) or
5884: (performer is null)) then
5885: Wf_Core.Token('ITEMTYPE', itemtype);
5886: Wf_Core.Token('ITEMKEY', itemkey);
5887: Wf_Core.Token('ACTIVITY', activity);
5888: Wf_Core.Token('PERFORMER', performer);
5889: Wf_Core.Raise('WFSQL_ARGS');
5890: end if;
5883: if ((itemtype is null) or (itemkey is null) or (activity is null) or
5884: (performer is null)) then
5885: Wf_Core.Token('ITEMTYPE', itemtype);
5886: Wf_Core.Token('ITEMKEY', itemkey);
5887: Wf_Core.Token('ACTIVITY', activity);
5888: Wf_Core.Token('PERFORMER', performer);
5889: Wf_Core.Raise('WFSQL_ARGS');
5890: end if;
5891:
5884: (performer is null)) then
5885: Wf_Core.Token('ITEMTYPE', itemtype);
5886: Wf_Core.Token('ITEMKEY', itemkey);
5887: Wf_Core.Token('ACTIVITY', activity);
5888: Wf_Core.Token('PERFORMER', performer);
5889: Wf_Core.Raise('WFSQL_ARGS');
5890: end if;
5891:
5892: -- Get the root process for this key, and check that the item
5885: Wf_Core.Token('ITEMTYPE', itemtype);
5886: Wf_Core.Token('ITEMKEY', itemkey);
5887: Wf_Core.Token('ACTIVITY', activity);
5888: Wf_Core.Token('PERFORMER', performer);
5889: Wf_Core.Raise('WFSQL_ARGS');
5890: end if;
5891:
5892: -- Get the root process for this key, and check that the item
5893: -- has been created.
5892: -- Get the root process for this key, and check that the item
5893: -- has been created.
5894: Wf_Item.Root_Process(itemtype, itemkey, root, version);
5895: if (root is null) then
5896: Wf_Core.Token('TYPE', itemtype);
5897: Wf_Core.Token('KEY', itemkey);
5898: Wf_Core.Raise('WFENG_ITEM');
5899: end if;
5900:
5893: -- has been created.
5894: Wf_Item.Root_Process(itemtype, itemkey, root, version);
5895: if (root is null) then
5896: Wf_Core.Token('TYPE', itemtype);
5897: Wf_Core.Token('KEY', itemkey);
5898: Wf_Core.Raise('WFENG_ITEM');
5899: end if;
5900:
5901: -- Get the root process actid.
5894: Wf_Item.Root_Process(itemtype, itemkey, root, version);
5895: if (root is null) then
5896: Wf_Core.Token('TYPE', itemtype);
5897: Wf_Core.Token('KEY', itemkey);
5898: Wf_Core.Raise('WFENG_ITEM');
5899: end if;
5900:
5901: -- Get the root process actid.
5902: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
5900:
5901: -- Get the root process actid.
5902: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
5903: if (rootid is null) then
5904: Wf_Core.Token('TYPE', itemtype);
5905: Wf_Core.Token('KEY', itemkey);
5906: Wf_Core.Token('NAME', root);
5907: Wf_Core.Raise('WFENG_ITEM_ROOT');
5908: end if;
5901: -- Get the root process actid.
5902: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
5903: if (rootid is null) then
5904: Wf_Core.Token('TYPE', itemtype);
5905: Wf_Core.Token('KEY', itemkey);
5906: Wf_Core.Token('NAME', root);
5907: Wf_Core.Raise('WFENG_ITEM_ROOT');
5908: end if;
5909:
5902: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
5903: if (rootid is null) then
5904: Wf_Core.Token('TYPE', itemtype);
5905: Wf_Core.Token('KEY', itemkey);
5906: Wf_Core.Token('NAME', root);
5907: Wf_Core.Raise('WFENG_ITEM_ROOT');
5908: end if;
5909:
5910: -- Get the actid and check that this is a valid activity in the
5903: if (rootid is null) then
5904: Wf_Core.Token('TYPE', itemtype);
5905: Wf_Core.Token('KEY', itemkey);
5906: Wf_Core.Token('NAME', root);
5907: Wf_Core.Raise('WFENG_ITEM_ROOT');
5908: end if;
5909:
5910: -- Get the actid and check that this is a valid activity in the
5911: -- root process
5911: -- root process
5912: actdate := Wf_Item.Active_Date(itemtype, itemkey);
5913: actid := Wf_Process_Activity.FindActivity(rootid, activity, actdate);
5914: if (actid is null) then
5915: Wf_Core.Token('TYPE', itemtype);
5916: Wf_Core.Token('KEY', itemkey);
5917: Wf_Core.Token('NAME', activity);
5918: Wf_Core.Raise('WFENG_ITEM_ACTIVITY');
5919: end if;
5912: actdate := Wf_Item.Active_Date(itemtype, itemkey);
5913: actid := Wf_Process_Activity.FindActivity(rootid, activity, actdate);
5914: if (actid is null) then
5915: Wf_Core.Token('TYPE', itemtype);
5916: Wf_Core.Token('KEY', itemkey);
5917: Wf_Core.Token('NAME', activity);
5918: Wf_Core.Raise('WFENG_ITEM_ACTIVITY');
5919: end if;
5920:
5913: actid := Wf_Process_Activity.FindActivity(rootid, activity, actdate);
5914: if (actid is null) then
5915: Wf_Core.Token('TYPE', itemtype);
5916: Wf_Core.Token('KEY', itemkey);
5917: Wf_Core.Token('NAME', activity);
5918: Wf_Core.Raise('WFENG_ITEM_ACTIVITY');
5919: end if;
5920:
5921: -- Check if this activity is a notification type of activity
5914: if (actid is null) then
5915: Wf_Core.Token('TYPE', itemtype);
5916: Wf_Core.Token('KEY', itemkey);
5917: Wf_Core.Token('NAME', activity);
5918: Wf_Core.Raise('WFENG_ITEM_ACTIVITY');
5919: end if;
5920:
5921: -- Check if this activity is a notification type of activity
5922: acttype := Wf_Activity.Type(itemtype, activity, actdate);
5920:
5921: -- Check if this activity is a notification type of activity
5922: acttype := Wf_Activity.Type(itemtype, activity, actdate);
5923: if (acttype <> wf_engine.eng_notification) then
5924: Wf_Core.Token('NAME', activity);
5925: Wf_Core.Raise('WFENG_NOTIFICATION_NAME');
5926: end if;
5927:
5928: -- Check if the activity is active
5921: -- Check if this activity is a notification type of activity
5922: acttype := Wf_Activity.Type(itemtype, activity, actdate);
5923: if (acttype <> wf_engine.eng_notification) then
5924: Wf_Core.Token('NAME', activity);
5925: Wf_Core.Raise('WFENG_NOTIFICATION_NAME');
5926: end if;
5927:
5928: -- Check if the activity is active
5929: Wf_Item_Activity_Status.Status(itemtype, itemkey, actid, status);
5942: -- Voting activities cannot be re-assigned.
5943: Wf_Activity.Notification_Info(itemtype, itemkey, actid, msg, msgtype,
5944: expand_role);
5945: if (expand_role = 'Y') then
5946: Wf_Core.Token('NAME', activity);
5947: Wf_Core.Raise('WFENG_VOTE_REASSIGN');
5948: end if;
5949:
5950: -- Get notification id
5943: Wf_Activity.Notification_Info(itemtype, itemkey, actid, msg, msgtype,
5944: expand_role);
5945: if (expand_role = 'Y') then
5946: Wf_Core.Token('NAME', activity);
5947: Wf_Core.Raise('WFENG_VOTE_REASSIGN');
5948: end if;
5949:
5950: -- Get notification id
5951: Wf_Item_Activity_Status.Notification_Status(itemtype, itemkey, actid,
5967: end if;
5968: else
5969: -- Activity must be complete (all other statuses are not valid
5970: -- for a notification).
5971: Wf_Core.Token('ACTIVITY', activity);
5972: Wf_Core.Token('TYPE', itemtype);
5973: Wf_Core.Token('KEY', itemkey);
5974: Wf_Core.Raise('WFENG_ITEM_ACTIVITY_COMPLETE');
5975: end if;
5968: else
5969: -- Activity must be complete (all other statuses are not valid
5970: -- for a notification).
5971: Wf_Core.Token('ACTIVITY', activity);
5972: Wf_Core.Token('TYPE', itemtype);
5973: Wf_Core.Token('KEY', itemkey);
5974: Wf_Core.Raise('WFENG_ITEM_ACTIVITY_COMPLETE');
5975: end if;
5976:
5969: -- Activity must be complete (all other statuses are not valid
5970: -- for a notification).
5971: Wf_Core.Token('ACTIVITY', activity);
5972: Wf_Core.Token('TYPE', itemtype);
5973: Wf_Core.Token('KEY', itemkey);
5974: Wf_Core.Raise('WFENG_ITEM_ACTIVITY_COMPLETE');
5975: end if;
5976:
5977: EXCEPTION
5970: -- for a notification).
5971: Wf_Core.Token('ACTIVITY', activity);
5972: Wf_Core.Token('TYPE', itemtype);
5973: Wf_Core.Token('KEY', itemkey);
5974: Wf_Core.Raise('WFENG_ITEM_ACTIVITY_COMPLETE');
5975: end if;
5976:
5977: EXCEPTION
5978: when OTHERS then
5975: end if;
5976:
5977: EXCEPTION
5978: when OTHERS then
5979: Wf_Core.Context('Wf_Engine', 'AssignActivity', itemtype, itemkey,
5980: activity, performer);
5981: raise;
5982: end AssignActivity;
5983:
6020: --Bug 1166527
6021: event_name VARCHAR2(240);
6022: l_parameterlist wf_parameter_list_t := wf_parameter_list_t();
6023: begin
6024: WF_CORE.TAG_DB_SESSION(WF_CORE.CONN_TAG_WF, HandleErrorInternal.itemtype);
6025: -- Not allowed in synch mode
6026: -- Validate this before calling this function
6027:
6028: -- No Argument validation
6037: -- to active, AND resets or creates status rows for any parent process
6038: -- to active if necessary.
6039: if (not Wf_Engine_Util.Reset_Tree(itemtype, itemkey, rootid,
6040: actid, actdate)) then
6041: Wf_Core.Token('TYPE', itemtype);
6042: Wf_Core.Token('KEY', itemkey);
6043: Wf_Core.Token('NAME', activity);
6044: Wf_Core.Raise('WFENG_ITEM_ACTIVITY');
6045: end if;
6038: -- to active if necessary.
6039: if (not Wf_Engine_Util.Reset_Tree(itemtype, itemkey, rootid,
6040: actid, actdate)) then
6041: Wf_Core.Token('TYPE', itemtype);
6042: Wf_Core.Token('KEY', itemkey);
6043: Wf_Core.Token('NAME', activity);
6044: Wf_Core.Raise('WFENG_ITEM_ACTIVITY');
6045: end if;
6046:
6039: if (not Wf_Engine_Util.Reset_Tree(itemtype, itemkey, rootid,
6040: actid, actdate)) then
6041: Wf_Core.Token('TYPE', itemtype);
6042: Wf_Core.Token('KEY', itemkey);
6043: Wf_Core.Token('NAME', activity);
6044: Wf_Core.Raise('WFENG_ITEM_ACTIVITY');
6045: end if;
6046:
6047: if (command = wf_engine.eng_skip) then
6040: actid, actdate)) then
6041: Wf_Core.Token('TYPE', itemtype);
6042: Wf_Core.Token('KEY', itemkey);
6043: Wf_Core.Token('NAME', activity);
6044: Wf_Core.Raise('WFENG_ITEM_ACTIVITY');
6045: end if;
6046:
6047: if (command = wf_engine.eng_skip) then
6048: -- *** SKIP ***
6059: resultout);
6060:
6061: -- Check if skip is allowed on this activity
6062: if (resultout = wf_engine.eng_noskip) then
6063: Wf_Core.Token('LABEL', Wf_Engine.GetActivityLabel(actid));
6064: Wf_Core.Raise('WFENG_NOSKIP');
6065: end if;
6066: end if;--
6067:
6060:
6061: -- Check if skip is allowed on this activity
6062: if (resultout = wf_engine.eng_noskip) then
6063: Wf_Core.Token('LABEL', Wf_Engine.GetActivityLabel(actid));
6064: Wf_Core.Raise('WFENG_NOSKIP');
6065: end if;
6066: end if;--
6067:
6068: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result, FALSE);
6073: -- no fancy error processing for you! Try running directly.
6074: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid,
6075: result, FALSE);
6076: when others then
6077: if (Wf_Core.Error_Name = 'WFENG_NOSKIP') then
6078: -- No processing. Raise to the caller that the activity cannot be skipped.
6079: raise;
6080: else
6081: -- If anything in this process raises an exception:
6083: -- 2. set this activity to error status
6084: -- 3. execute the error process (if any)
6085: -- 4. clear the error to continue with next activity
6086: rollback to wf_savepoint;
6087: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal', itemtype, itemkey,
6088: activity, command, result);
6089: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6090: wf_engine.eng_exception, FALSE);
6091: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6089: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6090: wf_engine.eng_exception, FALSE);
6091: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6092: wf_engine.eng_exception);
6093: Wf_Core.Clear;
6094: end if;
6095: end;
6096: --We will raise the skip event here .
6097: event_name := 'oracle.apps.wf.engine.skip';
6120: -- 2. set this activity to error status
6121: -- 3. execute the error process (if any)
6122: -- 4. clear the error to continue with next activity
6123: rollback to wf_savepoint;
6124: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal',itemtype,itemkey,
6125: activity, command, result);
6126: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6127: wf_engine.eng_exception, FALSE);
6128: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6126: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6127: wf_engine.eng_exception, FALSE);
6128: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6129: wf_engine.eng_exception);
6130: Wf_Core.Clear;
6131: end;
6132: end if;
6133: event_name := 'oracle.apps.wf.engine.retry';
6134: end if;
6151: p_parameters => l_parameterlist);
6152:
6153: exception
6154: when others then
6155: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal', itemtype, itemkey,
6156: activity, command, result);
6157: raise;
6158: end HandleErrorInternal;
6159:
6187: pragma exception_init(trig_savepoint, -04092);
6188: dist_savepoint exception;
6189: pragma exception_init(dist_savepoint, -02074);
6190: begin
6191: WF_CORE.TAG_DB_SESSION(WF_CORE.CONN_TAG_WF, HandleError.itemtype);
6192: -- Not allowed in synch mode
6193: if (itemkey = wf_engine.eng_synch) then
6194: wf_core.token('OPERATION', 'Wf_Engine.HandleError');
6195: wf_core.raise('WFENG_SYNCH_DISABLED');
6190: begin
6191: WF_CORE.TAG_DB_SESSION(WF_CORE.CONN_TAG_WF, HandleError.itemtype);
6192: -- Not allowed in synch mode
6193: if (itemkey = wf_engine.eng_synch) then
6194: wf_core.token('OPERATION', 'Wf_Engine.HandleError');
6195: wf_core.raise('WFENG_SYNCH_DISABLED');
6196: end if;
6197:
6198: -- Argument validation
6191: WF_CORE.TAG_DB_SESSION(WF_CORE.CONN_TAG_WF, HandleError.itemtype);
6192: -- Not allowed in synch mode
6193: if (itemkey = wf_engine.eng_synch) then
6194: wf_core.token('OPERATION', 'Wf_Engine.HandleError');
6195: wf_core.raise('WFENG_SYNCH_DISABLED');
6196: end if;
6197:
6198: -- Argument validation
6199: if ((itemtype is null) or (itemkey is null) or (activity is null) or
6197:
6198: -- Argument validation
6199: if ((itemtype is null) or (itemkey is null) or (activity is null) or
6200: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry))) then
6201: Wf_Core.Token('ITEMTYPE', itemtype);
6202: Wf_Core.Token('ITEMKEY', itemkey);
6203: Wf_Core.Token('ACTIVITY', activity);
6204: Wf_Core.Token('COMMAND', command);
6205: Wf_Core.Raise('WFSQL_ARGS');
6198: -- Argument validation
6199: if ((itemtype is null) or (itemkey is null) or (activity is null) or
6200: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry))) then
6201: Wf_Core.Token('ITEMTYPE', itemtype);
6202: Wf_Core.Token('ITEMKEY', itemkey);
6203: Wf_Core.Token('ACTIVITY', activity);
6204: Wf_Core.Token('COMMAND', command);
6205: Wf_Core.Raise('WFSQL_ARGS');
6206: end if;
6199: if ((itemtype is null) or (itemkey is null) or (activity is null) or
6200: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry))) then
6201: Wf_Core.Token('ITEMTYPE', itemtype);
6202: Wf_Core.Token('ITEMKEY', itemkey);
6203: Wf_Core.Token('ACTIVITY', activity);
6204: Wf_Core.Token('COMMAND', command);
6205: Wf_Core.Raise('WFSQL_ARGS');
6206: end if;
6207:
6200: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry))) then
6201: Wf_Core.Token('ITEMTYPE', itemtype);
6202: Wf_Core.Token('ITEMKEY', itemkey);
6203: Wf_Core.Token('ACTIVITY', activity);
6204: Wf_Core.Token('COMMAND', command);
6205: Wf_Core.Raise('WFSQL_ARGS');
6206: end if;
6207:
6208:
6201: Wf_Core.Token('ITEMTYPE', itemtype);
6202: Wf_Core.Token('ITEMKEY', itemkey);
6203: Wf_Core.Token('ACTIVITY', activity);
6204: Wf_Core.Token('COMMAND', command);
6205: Wf_Core.Raise('WFSQL_ARGS');
6206: end if;
6207:
6208:
6209: -- If we are in a different Fwk session, need to clear Workflow PLSQL state
6213:
6214: -- Make sure item is valid
6215: Wf_Item.Root_Process(itemtype, itemkey, root, version);
6216: if (root is null) then
6217: Wf_Core.Token('TYPE', itemtype);
6218: Wf_Core.Token('KEY', itemkey);
6219: Wf_Core.Raise('WFENG_ITEM');
6220: end if;
6221: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
6214: -- Make sure item is valid
6215: Wf_Item.Root_Process(itemtype, itemkey, root, version);
6216: if (root is null) then
6217: Wf_Core.Token('TYPE', itemtype);
6218: Wf_Core.Token('KEY', itemkey);
6219: Wf_Core.Raise('WFENG_ITEM');
6220: end if;
6221: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
6222: if (rootid is null) then
6215: Wf_Item.Root_Process(itemtype, itemkey, root, version);
6216: if (root is null) then
6217: Wf_Core.Token('TYPE', itemtype);
6218: Wf_Core.Token('KEY', itemkey);
6219: Wf_Core.Raise('WFENG_ITEM');
6220: end if;
6221: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
6222: if (rootid is null) then
6223: Wf_Core.Token('TYPE', itemtype);
6219: Wf_Core.Raise('WFENG_ITEM');
6220: end if;
6221: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
6222: if (rootid is null) then
6223: Wf_Core.Token('TYPE', itemtype);
6224: Wf_Core.Token('KEY', itemkey);
6225: Wf_Core.Token('NAME', root);
6226: Wf_Core.Raise('WFENG_ITEM_ROOT');
6227: end if;
6220: end if;
6221: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
6222: if (rootid is null) then
6223: Wf_Core.Token('TYPE', itemtype);
6224: Wf_Core.Token('KEY', itemkey);
6225: Wf_Core.Token('NAME', root);
6226: Wf_Core.Raise('WFENG_ITEM_ROOT');
6227: end if;
6228:
6221: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
6222: if (rootid is null) then
6223: Wf_Core.Token('TYPE', itemtype);
6224: Wf_Core.Token('KEY', itemkey);
6225: Wf_Core.Token('NAME', root);
6226: Wf_Core.Raise('WFENG_ITEM_ROOT');
6227: end if;
6228:
6229: -- Look for the activity instance for this item
6222: if (rootid is null) then
6223: Wf_Core.Token('TYPE', itemtype);
6224: Wf_Core.Token('KEY', itemkey);
6225: Wf_Core.Token('NAME', root);
6226: Wf_Core.Raise('WFENG_ITEM_ROOT');
6227: end if;
6228:
6229: -- Look for the activity instance for this item
6230: actdate := Wf_Item.Active_Date(itemtype, itemkey);
6230: actdate := Wf_Item.Active_Date(itemtype, itemkey);
6231: actid := Wf_Process_Activity.FindActivity(rootid, activity, actdate);
6232:
6233: if (actid is null) then
6234: Wf_Core.Token('TYPE', itemtype);
6235: Wf_Core.Token('PROCESS', root);
6236: Wf_Core.Token('NAME', activity);
6237: Wf_Core.Raise('WFENG_ACTIVITY_EXIST');
6238: end if;
6231: actid := Wf_Process_Activity.FindActivity(rootid, activity, actdate);
6232:
6233: if (actid is null) then
6234: Wf_Core.Token('TYPE', itemtype);
6235: Wf_Core.Token('PROCESS', root);
6236: Wf_Core.Token('NAME', activity);
6237: Wf_Core.Raise('WFENG_ACTIVITY_EXIST');
6238: end if;
6239:
6232:
6233: if (actid is null) then
6234: Wf_Core.Token('TYPE', itemtype);
6235: Wf_Core.Token('PROCESS', root);
6236: Wf_Core.Token('NAME', activity);
6237: Wf_Core.Raise('WFENG_ACTIVITY_EXIST');
6238: end if;
6239:
6240: if (WF_CACHE.MetaRefreshed) then
6233: if (actid is null) then
6234: Wf_Core.Token('TYPE', itemtype);
6235: Wf_Core.Token('PROCESS', root);
6236: Wf_Core.Token('NAME', activity);
6237: Wf_Core.Raise('WFENG_ACTIVITY_EXIST');
6238: end if;
6239:
6240: if (WF_CACHE.MetaRefreshed) then
6241: null;
6247: actdate, upper(command), result);
6248:
6249: exception
6250: when others then
6251: Wf_Core.Context('Wf_Engine', 'HandleError', itemtype, itemkey, activity,
6252: command, result);
6253: raise;
6254: end HandleError;
6255:
6297:
6298: begin
6299: --Check arguments.
6300: if (itemtype is null) then
6301: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
6302: Wf_Core.Raise('WFSQL_ARGS');
6303: end if;
6304:
6305: if (WF_CACHE.MetaRefreshed) then
6298: begin
6299: --Check arguments.
6300: if (itemtype is null) then
6301: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
6302: Wf_Core.Raise('WFSQL_ARGS');
6303: end if;
6304:
6305: if (WF_CACHE.MetaRefreshed) then
6306: null;
6323: end if;
6324:
6325: -- Not allowed in synch mode
6326: if (c_item_key = wf_engine.eng_synch) then
6327: wf_core.token('OPERATION', 'Wf_Engine.HandleErrorAll');
6328: wf_core.raise('WFENG_SYNCH_DISABLED');
6329: end if;
6330:
6331: -- Argument validation
6324:
6325: -- Not allowed in synch mode
6326: if (c_item_key = wf_engine.eng_synch) then
6327: wf_core.token('OPERATION', 'Wf_Engine.HandleErrorAll');
6328: wf_core.raise('WFENG_SYNCH_DISABLED');
6329: end if;
6330:
6331: -- Argument validation
6332: if ((itemtype is null) or (c_item_key is null) or (c_activity is null) or
6331: -- Argument validation
6332: if ((itemtype is null) or (c_item_key is null) or (c_activity is null) or
6333: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry)))
6334: then
6335: Wf_Core.Token('ITEMTYPE', itemtype);
6336: Wf_Core.Token('ITEMKEY', c_item_key);
6337: Wf_Core.Token('ACTIVITY', c_activity);
6338: Wf_Core.Token('COMMAND', command);
6339: Wf_Core.Raise('WFSQL_ARGS');
6332: if ((itemtype is null) or (c_item_key is null) or (c_activity is null) or
6333: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry)))
6334: then
6335: Wf_Core.Token('ITEMTYPE', itemtype);
6336: Wf_Core.Token('ITEMKEY', c_item_key);
6337: Wf_Core.Token('ACTIVITY', c_activity);
6338: Wf_Core.Token('COMMAND', command);
6339: Wf_Core.Raise('WFSQL_ARGS');
6340: end if;
6333: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry)))
6334: then
6335: Wf_Core.Token('ITEMTYPE', itemtype);
6336: Wf_Core.Token('ITEMKEY', c_item_key);
6337: Wf_Core.Token('ACTIVITY', c_activity);
6338: Wf_Core.Token('COMMAND', command);
6339: Wf_Core.Raise('WFSQL_ARGS');
6340: end if;
6341:
6334: then
6335: Wf_Core.Token('ITEMTYPE', itemtype);
6336: Wf_Core.Token('ITEMKEY', c_item_key);
6337: Wf_Core.Token('ACTIVITY', c_activity);
6338: Wf_Core.Token('COMMAND', command);
6339: Wf_Core.Raise('WFSQL_ARGS');
6340: end if;
6341:
6342: -- Make sure item is valid
6335: Wf_Core.Token('ITEMTYPE', itemtype);
6336: Wf_Core.Token('ITEMKEY', c_item_key);
6337: Wf_Core.Token('ACTIVITY', c_activity);
6338: Wf_Core.Token('COMMAND', command);
6339: Wf_Core.Raise('WFSQL_ARGS');
6340: end if;
6341:
6342: -- Make sure item is valid
6343: Wf_Item.Root_Process(itemtype, c_item_key, root, version);
6341:
6342: -- Make sure item is valid
6343: Wf_Item.Root_Process(itemtype, c_item_key, root, version);
6344: if (root is null) then
6345: Wf_Core.Token('TYPE', itemtype);
6346: Wf_Core.Token('KEY', c_item_key);
6347: Wf_Core.Raise('WFENG_ITEM');
6348: end if;
6349: rootid := Wf_Process_Activity.RootInstanceId(itemtype, c_item_key, root);
6342: -- Make sure item is valid
6343: Wf_Item.Root_Process(itemtype, c_item_key, root, version);
6344: if (root is null) then
6345: Wf_Core.Token('TYPE', itemtype);
6346: Wf_Core.Token('KEY', c_item_key);
6347: Wf_Core.Raise('WFENG_ITEM');
6348: end if;
6349: rootid := Wf_Process_Activity.RootInstanceId(itemtype, c_item_key, root);
6350: if (rootid is null) then
6343: Wf_Item.Root_Process(itemtype, c_item_key, root, version);
6344: if (root is null) then
6345: Wf_Core.Token('TYPE', itemtype);
6346: Wf_Core.Token('KEY', c_item_key);
6347: Wf_Core.Raise('WFENG_ITEM');
6348: end if;
6349: rootid := Wf_Process_Activity.RootInstanceId(itemtype, c_item_key, root);
6350: if (rootid is null) then
6351: Wf_Core.Token('TYPE', itemtype);
6347: Wf_Core.Raise('WFENG_ITEM');
6348: end if;
6349: rootid := Wf_Process_Activity.RootInstanceId(itemtype, c_item_key, root);
6350: if (rootid is null) then
6351: Wf_Core.Token('TYPE', itemtype);
6352: Wf_Core.Token('KEY', c_item_key);
6353: Wf_Core.Token('NAME', root);
6354: Wf_Core.Raise('WFENG_ITEM_ROOT');
6355: end if;
6348: end if;
6349: rootid := Wf_Process_Activity.RootInstanceId(itemtype, c_item_key, root);
6350: if (rootid is null) then
6351: Wf_Core.Token('TYPE', itemtype);
6352: Wf_Core.Token('KEY', c_item_key);
6353: Wf_Core.Token('NAME', root);
6354: Wf_Core.Raise('WFENG_ITEM_ROOT');
6355: end if;
6356:
6349: rootid := Wf_Process_Activity.RootInstanceId(itemtype, c_item_key, root);
6350: if (rootid is null) then
6351: Wf_Core.Token('TYPE', itemtype);
6352: Wf_Core.Token('KEY', c_item_key);
6353: Wf_Core.Token('NAME', root);
6354: Wf_Core.Raise('WFENG_ITEM_ROOT');
6355: end if;
6356:
6357: -- Look for the activity instance for this item
6350: if (rootid is null) then
6351: Wf_Core.Token('TYPE', itemtype);
6352: Wf_Core.Token('KEY', c_item_key);
6353: Wf_Core.Token('NAME', root);
6354: Wf_Core.Raise('WFENG_ITEM_ROOT');
6355: end if;
6356:
6357: -- Look for the activity instance for this item
6358: actdate := Wf_Item.Active_Date(itemtype, c_item_key);
6386: end if;
6387:
6388: exception
6389: when others then
6390: Wf_Core.Context('Wf_Engine', 'HandleErrorAll', itemtype, itemkey);
6391: raise;
6392: end HandleErrorAll;
6393:
6394: --
6410: begin
6411: --Check arguments.
6412: if ((itemtype is null) or
6413: (itemkey is null)) then
6414: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
6415: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
6416: Wf_Core.Raise('WFSQL_ARGS');
6417: end if;
6418:
6411: --Check arguments.
6412: if ((itemtype is null) or
6413: (itemkey is null)) then
6414: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
6415: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
6416: Wf_Core.Raise('WFSQL_ARGS');
6417: end if;
6418:
6419: wf_item_activity_status.root_status(itemtype,itemkey,status,result);
6412: if ((itemtype is null) or
6413: (itemkey is null)) then
6414: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
6415: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
6416: Wf_Core.Raise('WFSQL_ARGS');
6417: end if;
6418:
6419: wf_item_activity_status.root_status(itemtype,itemkey,status,result);
6420: exception
6418:
6419: wf_item_activity_status.root_status(itemtype,itemkey,status,result);
6420: exception
6421: when others then
6422: Wf_Core.Context('Wf_Engine', 'ItemStatus', itemtype, itemkey);
6423: raise;
6424: end ItemStatus;
6425:
6426: -- API to reterive more granular information from the
6537: result := l_result ;
6538: end if;
6539: exception
6540: when others then
6541: Wf_Core.Context('Wf_Engine', 'ItemInfo', itemtype, itemkey);
6542: raise;
6543: end ItemInfo;
6544:
6545:
6591: active_date=>active_date));
6592:
6593: exception
6594: when others then
6595: Wf_Core.Context('Wf_Engine', 'Activity_Exist_In_Process',
6596: p_item_type, p_item_key,
6597: nvl(p_activity_item_type, p_item_type),
6598: p_activity_name);
6599: raise;
6692: end if;
6693:
6694: exception
6695: when OTHERS then
6696: Wf_Core.Context('Wf_Engine', 'Activity_Exist',
6697: p_process_item_type, p_process_name,
6698: nvl(p_activity_item_type, p_process_item_type),
6699: p_activity_name);
6700: raise;
6762:
6763: l_lock boolean;
6764:
6765: begin
6766: WF_CORE.TAG_DB_SESSION(WF_CORE.CONN_TAG_WF, Event.itemtype);
6767: -- Check args
6768: if ((itemtype is null) or
6769: (itemkey is null) or
6770: (event_message is null)) then
6767: -- Check args
6768: if ((itemtype is null) or
6769: (itemkey is null) or
6770: (event_message is null)) then
6771: Wf_Core.Token('ITEMTYPE', itemtype);
6772: Wf_Core.Token('ITEMKEY', itemkey);
6773: Wf_Core.Token('EVENT_MESSAGE', '');
6774: Wf_Core.Raise('WFSQL_ARGS');
6775: end if;
6768: if ((itemtype is null) or
6769: (itemkey is null) or
6770: (event_message is null)) then
6771: Wf_Core.Token('ITEMTYPE', itemtype);
6772: Wf_Core.Token('ITEMKEY', itemkey);
6773: Wf_Core.Token('EVENT_MESSAGE', '');
6774: Wf_Core.Raise('WFSQL_ARGS');
6775: end if;
6776:
6769: (itemkey is null) or
6770: (event_message is null)) then
6771: Wf_Core.Token('ITEMTYPE', itemtype);
6772: Wf_Core.Token('ITEMKEY', itemkey);
6773: Wf_Core.Token('EVENT_MESSAGE', '');
6774: Wf_Core.Raise('WFSQL_ARGS');
6775: end if;
6776:
6777: -- Not allowed in synch mode
6770: (event_message is null)) then
6771: Wf_Core.Token('ITEMTYPE', itemtype);
6772: Wf_Core.Token('ITEMKEY', itemkey);
6773: Wf_Core.Token('EVENT_MESSAGE', '');
6774: Wf_Core.Raise('WFSQL_ARGS');
6775: end if;
6776:
6777: -- Not allowed in synch mode
6778: if (itemkey = wf_engine.eng_synch) then
6775: end if;
6776:
6777: -- Not allowed in synch mode
6778: if (itemkey = wf_engine.eng_synch) then
6779: Wf_Core.Token('OPERATION', 'Wf_Engine.Set_Item_Parent');
6780: Wf_Core.Raise('WFENG_SYNCH_DISABLED');
6781: end if;
6782:
6783: -- Retrieve event name from message
6776:
6777: -- Not allowed in synch mode
6778: if (itemkey = wf_engine.eng_synch) then
6779: Wf_Core.Token('OPERATION', 'Wf_Engine.Set_Item_Parent');
6780: Wf_Core.Raise('WFENG_SYNCH_DISABLED');
6781: end if;
6782:
6783: -- Retrieve event name from message
6784: event_name := event_message.GetEventName;
6782:
6783: -- Retrieve event name from message
6784: event_name := event_message.GetEventName;
6785: if (event_name is null) then
6786: Wf_Core.Token('EVENT_MESSAGE.EVENT_NAME', '');
6787: Wf_Core.Raise('WFSQL_ARGS');
6788: end if;
6789:
6790: if (WF_CACHE.MetaRefreshed) then
6783: -- Retrieve event name from message
6784: event_name := event_message.GetEventName;
6785: if (event_name is null) then
6786: Wf_Core.Token('EVENT_MESSAGE.EVENT_NAME', '');
6787: Wf_Core.Raise('WFSQL_ARGS');
6788: end if;
6789:
6790: if (WF_CACHE.MetaRefreshed) then
6791: null;
6834: end if;
6835:
6836: -- Check at least one matching event activity found
6837: if (i = 0) then
6838: Wf_Core.Token('TYPE', itemtype);
6839: Wf_Core.Token('KEY', itemkey);
6840: Wf_Core.Token('EVENT', event_name);
6841: Wf_Core.Raise('WFENG_EVENT_NOTFOUND');
6842: end if;
6835:
6836: -- Check at least one matching event activity found
6837: if (i = 0) then
6838: Wf_Core.Token('TYPE', itemtype);
6839: Wf_Core.Token('KEY', itemkey);
6840: Wf_Core.Token('EVENT', event_name);
6841: Wf_Core.Raise('WFENG_EVENT_NOTFOUND');
6842: end if;
6843:
6836: -- Check at least one matching event activity found
6837: if (i = 0) then
6838: Wf_Core.Token('TYPE', itemtype);
6839: Wf_Core.Token('KEY', itemkey);
6840: Wf_Core.Token('EVENT', event_name);
6841: Wf_Core.Raise('WFENG_EVENT_NOTFOUND');
6842: end if;
6843:
6844: -- Set item attributes for all parameters contained in the event
6837: if (i = 0) then
6838: Wf_Core.Token('TYPE', itemtype);
6839: Wf_Core.Token('KEY', itemkey);
6840: Wf_Core.Token('EVENT', event_name);
6841: Wf_Core.Raise('WFENG_EVENT_NOTFOUND');
6842: end if;
6843:
6844: -- Set item attributes for all parameters contained in the event
6845: -- message body.
6882: Wf_Engine.SetEventItemAttr(itemtype, itemkey, aname, avalue);
6883: end if;
6884: exception
6885: when others then
6886: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
6887: -- If attr doesn't exist create runtime itemattr
6888: Wf_Core.Clear;
6889: Wf_Engine.AddItemAttr(itemtype, itemkey, aname, avalue);
6890: else
6884: exception
6885: when others then
6886: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
6887: -- If attr doesn't exist create runtime itemattr
6888: Wf_Core.Clear;
6889: Wf_Engine.AddItemAttr(itemtype, itemkey, aname, avalue);
6890: else
6891: raise; -- All other errors are raised up.
6892: end if;
6930: -- 2. set this activity to error status
6931: -- 3. execute the error process (if any)
6932: -- 4. clear the error to continue with next activity
6933: rollback to wf_savepoint;
6934: Wf_Core.Context('Wf_Engine', 'Event', itemtype, itemkey,
6935: process_name, event_name);
6936: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actarr(i),
6937: wf_engine.eng_exception, FALSE);
6938: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actarr(i),
6936: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actarr(i),
6937: wf_engine.eng_exception, FALSE);
6938: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actarr(i),
6939: wf_engine.eng_exception);
6940: Wf_Core.Clear;
6941: end;
6942: i := i + 1;
6943: end loop;
6944:
6943: end loop;
6944:
6945: exception
6946: when others then
6947: Wf_Core.Context('Wf_Engine', 'Event', itemtype, itemkey,
6948: process_name, event_name);
6949: raise;
6950: end Event;
6951:
7023: begin
7024:
7025: -- Check args
7026: if ((event_message is null)) then
7027: Wf_Core.Token('EVENT_MESSAGE', '');
7028: Wf_Core.Raise('WFSQL_ARGS');
7029: end if;
7030:
7031: -- Retrieve event name from message
7024:
7025: -- Check args
7026: if ((event_message is null)) then
7027: Wf_Core.Token('EVENT_MESSAGE', '');
7028: Wf_Core.Raise('WFSQL_ARGS');
7029: end if;
7030:
7031: -- Retrieve event name from message
7032: event_name := event_message.GetEventName;
7032: event_name := event_message.GetEventName;
7033: businesskey := event_message.GetEventKey;
7034:
7035: if (event_name is null) then
7036: Wf_Core.Token('EVENT_MESSAGE.EVENT_NAME', '');
7037: Wf_Core.Raise('WFSQL_ARGS');
7038: end if;
7039:
7040: --Here before opening the cursor we will set the savepoint
7033: businesskey := event_message.GetEventKey;
7034:
7035: if (event_name is null) then
7036: Wf_Core.Token('EVENT_MESSAGE.EVENT_NAME', '');
7037: Wf_Core.Raise('WFSQL_ARGS');
7038: end if;
7039:
7040: --Here before opening the cursor we will set the savepoint
7041: --This is so that we do not have to depend on the cursor behaviour itself
7070: evtacts_rec.item_key, aname, avalue);
7071: end if;
7072: exception
7073: when others then
7074: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
7075: -- If attr doesn't exist create runtime itemattr
7076: Wf_Core.Clear;
7077:
7078: Wf_Engine.AddItemAttr(evtacts_rec.item_type,
7072: exception
7073: when others then
7074: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
7075: -- If attr doesn't exist create runtime itemattr
7076: Wf_Core.Clear;
7077:
7078: Wf_Engine.AddItemAttr(evtacts_rec.item_type,
7079: evtacts_rec.item_key,
7080: aname, avalue);
7132: -- 2. set this activity to error status
7133: -- 3. execute the error process (if any)
7134: -- 4. clear the error to continue with next activity
7135: rollback to wf_savepoint;
7136: Wf_Core.Context('Wf_Engine', 'Event2', evtacts_rec.item_type,
7137: evtacts_rec.item_key, event_name);
7138: Wf_Item_Activity_Status.Set_Error(evtacts_rec.item_type,
7139: evtacts_rec.item_key,
7140: evtacts_rec.actid,
7142: Wf_Engine_Util.Execute_Error_Process(evtacts_rec.item_type,
7143: evtacts_rec.item_key,
7144: evtacts_rec.actid,
7145: wf_engine.eng_exception);
7146: Wf_Core.Clear;
7147: end;
7148:
7149: i := i + 1;
7150: end loop;
7150: end loop;
7151:
7152: -- Check at least one matching event activity found
7153: if (i = 0) then
7154: Wf_Core.Token('EVENT2', event_name);
7155: Wf_Core.Raise('WFENG_EVENT_NOTFOUND');
7156: end if;
7157:
7158: exception
7151:
7152: -- Check at least one matching event activity found
7153: if (i = 0) then
7154: Wf_Core.Token('EVENT2', event_name);
7155: Wf_Core.Raise('WFENG_EVENT_NOTFOUND');
7156: end if;
7157:
7158: exception
7159: when resource_busy then
7160: --Rollback to ensure that we aren't locking anything here
7161: rollback to wf_savepoint_event2;
7162: raise;
7163: when others then
7164: Wf_Core.Context('Wf_Engine', 'Event2', businesskey, event_name);
7165: raise;
7166: end Event2;
7167:
7168: --
7193: -- Check Arguments
7194: if ((p_itemtype is null) or
7195: (p_itemkey is null) or
7196: (p_aname is null)) then
7197: Wf_Core.Token('P_ITEMTYPE', nvl(p_itemtype, 'NULL'));
7198: Wf_Core.Token('P_ITEMKEY', nvl(p_itemkey, 'NULL'));
7199: Wf_Core.Token('P_ANAME', nvl(p_aname, 'NULL'));
7200: Wf_Core.Raise('WFSQL_ARGS');
7201: end if;
7194: if ((p_itemtype is null) or
7195: (p_itemkey is null) or
7196: (p_aname is null)) then
7197: Wf_Core.Token('P_ITEMTYPE', nvl(p_itemtype, 'NULL'));
7198: Wf_Core.Token('P_ITEMKEY', nvl(p_itemkey, 'NULL'));
7199: Wf_Core.Token('P_ANAME', nvl(p_aname, 'NULL'));
7200: Wf_Core.Raise('WFSQL_ARGS');
7201: end if;
7202:
7195: (p_itemkey is null) or
7196: (p_aname is null)) then
7197: Wf_Core.Token('P_ITEMTYPE', nvl(p_itemtype, 'NULL'));
7198: Wf_Core.Token('P_ITEMKEY', nvl(p_itemkey, 'NULL'));
7199: Wf_Core.Token('P_ANAME', nvl(p_aname, 'NULL'));
7200: Wf_Core.Raise('WFSQL_ARGS');
7201: end if;
7202:
7203: if (p_itemkey = wf_engine.eng_synch) then
7196: (p_aname is null)) then
7197: Wf_Core.Token('P_ITEMTYPE', nvl(p_itemtype, 'NULL'));
7198: Wf_Core.Token('P_ITEMKEY', nvl(p_itemkey, 'NULL'));
7199: Wf_Core.Token('P_ANAME', nvl(p_aname, 'NULL'));
7200: Wf_Core.Raise('WFSQL_ARGS');
7201: end if;
7202:
7203: if (p_itemkey = wf_engine.eng_synch) then
7204: WF_CACHE.GetItemAttrValue(p_itemtype, p_itemKey, p_aname, iStatus,
7247: when no_data_found then
7248: return NULL;
7249:
7250: when others then
7251: Wf_Core.Context('Wf_Engine', 'AddToItemAttrNumber', p_itemtype, p_itemkey,
7252: p_aname, to_char(p_addend));
7253: raise;
7254: end AddToItemAttrNumber;
7255:
7327: l_start_date := to_date(null);
7328: l_end_date := to_date(null);
7329:
7330: -- Date value from CP is in fnd_flex_val_util.g_date_format_19 - 'RRRR/MM/DD HH24:MI:SS'
7331: -- This is same as wf_core.canonical_date_mask.
7332: if (p_start_date is not null) then
7333: l_start_date := to_date(p_start_date, wf_core.canonical_date_mask);
7334: end if;
7335:
7329:
7330: -- Date value from CP is in fnd_flex_val_util.g_date_format_19 - 'RRRR/MM/DD HH24:MI:SS'
7331: -- This is same as wf_core.canonical_date_mask.
7332: if (p_start_date is not null) then
7333: l_start_date := to_date(p_start_date, wf_core.canonical_date_mask);
7334: end if;
7335:
7336: if (p_end_date is not null) then
7337: l_end_date := to_date(p_end_date, wf_core.canonical_date_mask);
7333: l_start_date := to_date(p_start_date, wf_core.canonical_date_mask);
7334: end if;
7335:
7336: if (p_end_date is not null) then
7337: l_end_date := to_date(p_end_date, wf_core.canonical_date_mask);
7338: end if;
7339:
7340: if (nvl(p_docommit, 'Y') = 'Y') then
7341: l_docommit := TRUE;
7357: Fnd_File.Put_Line(Fnd_File.Log, 'p_docommit - '||p_docommit);
7358:
7359: -- Check Arguments
7360: if (p_itemtype is null) then
7361: Wf_Core.Token('ITEMTYPE', nvl(p_itemtype, 'NULL'));
7362: Wf_Core.Raise('WFSQL_ARGS');
7363: end if;
7364:
7365: if (WF_CACHE.MetaRefreshed) then
7358:
7359: -- Check Arguments
7360: if (p_itemtype is null) then
7361: Wf_Core.Token('ITEMTYPE', nvl(p_itemtype, 'NULL'));
7362: Wf_Core.Raise('WFSQL_ARGS');
7363: end if;
7364:
7365: if (WF_CACHE.MetaRefreshed) then
7366: null;
7401: p_retcode := 0;
7402:
7403: exception
7404: when others then
7405: Wf_Core.Get_error(l_errname, l_errmsg, l_stack);
7406:
7407: -- Completed with Error
7408: p_errbuf := nvl(l_errmsg, sqlerrm);
7409: p_retcode := '2';