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: -- For eligible row: Commit work to insure this activity
3623: end loop;
3624:
3625: exception
3626: when others then
3627: Wf_Core.Context('Wf_Engine', 'ProcessTimeout', l_itemkey, l_itemtype,
3628: to_char(l_actid));
3629: raise;
3630: end ProcessTimeOut;
3631:
3811: end;
3812: exception
3813: when NO_SAVEPOINT then
3814: -- Catch any savepoint error in case of a commit happened.
3815: Wf_Core.Token('ACTIVITY', Wf_Engine.GetActivityLabel(l_actid));
3816: Wf_Core.Raise('WFENG_COMMIT_IN_ERRPROC');
3817: end;
3818: exception
3819: when OTHERS then
3812: exception
3813: when NO_SAVEPOINT then
3814: -- Catch any savepoint error in case of a commit happened.
3815: Wf_Core.Token('ACTIVITY', Wf_Engine.GetActivityLabel(l_actid));
3816: Wf_Core.Raise('WFENG_COMMIT_IN_ERRPROC');
3817: end;
3818: exception
3819: when OTHERS then
3820: -- Remaining steps for completing activity raises an exception:
3820: -- Remaining steps for completing activity raises an exception:
3821: -- 2. set this activity to error status
3822: -- 3. execute the error process (if any)
3823: -- 4. clear the error to continue with next activity
3824: Wf_Core.Context('Wf_Engine', 'ProcessStuckProcess', l_itemkey,
3825: l_itemtype, to_char(l_actid));
3826: Wf_Item_Activity_Status.Set_Error(l_itemtype, l_itemkey, l_actid,
3827: wf_engine.eng_exception, FALSE);
3828: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey,
3826: Wf_Item_Activity_Status.Set_Error(l_itemtype, l_itemkey, l_actid,
3827: wf_engine.eng_exception, FALSE);
3828: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey,
3829: l_actid, wf_engine.eng_exception);
3830: Wf_Core.Clear;
3831: end;
3832:
3833: -- Commit work to insure this activity thread doesn't interfere
3834: -- with others.
3840: end loop;
3841:
3842: exception
3843: when others then
3844: Wf_Core.Context('Wf_Engine', 'ProcessStuckProcess', l_itemkey, l_itemtype,
3845: to_char(l_actid));
3846: raise;
3847: end ProcessStuckProcess;
3848:
3872:
3873: end if;
3874:
3875: --Bug 3945469: Add check on db major version and cache value for aq_tm_processes
3876: if wf_core.g_oracle_major_version is null then
3877: wf_core.InitCache;
3878: end if;
3879:
3880: --Check the value of aq_tm_processes if oracle version is not 10g
3873: end if;
3874:
3875: --Bug 3945469: Add check on db major version and cache value for aq_tm_processes
3876: if wf_core.g_oracle_major_version is null then
3877: wf_core.InitCache;
3878: end if;
3879:
3880: --Check the value of aq_tm_processes if oracle version is not 10g
3881: if (wf_core.g_oracle_major_version < 10 ) then
3877: wf_core.InitCache;
3878: end if;
3879:
3880: --Check the value of aq_tm_processes if oracle version is not 10g
3881: if (wf_core.g_oracle_major_version < 10 ) then
3882: if (wf_core.g_aq_tm_processes ='0') then
3883: --If the value aq_tm_processes is 0 then raise error
3884: wf_core.raise('WFENG_AQ_TM_PROCESSES_ERROR');
3885: end if;
3878: end if;
3879:
3880: --Check the value of aq_tm_processes if oracle version is not 10g
3881: if (wf_core.g_oracle_major_version < 10 ) then
3882: if (wf_core.g_aq_tm_processes ='0') then
3883: --If the value aq_tm_processes is 0 then raise error
3884: wf_core.raise('WFENG_AQ_TM_PROCESSES_ERROR');
3885: end if;
3886: end if;
3880: --Check the value of aq_tm_processes if oracle version is not 10g
3881: if (wf_core.g_oracle_major_version < 10 ) then
3882: if (wf_core.g_aq_tm_processes ='0') then
3883: --If the value aq_tm_processes is 0 then raise error
3884: wf_core.raise('WFENG_AQ_TM_PROCESSES_ERROR');
3885: end if;
3886: end if;
3887:
3888: --Bug 2307428
3910: end if;
3911:
3912: exception
3913: when others then
3914: Wf_Core.Context('Wf_Engine', 'Background', itemtype,
3915: to_char(minthreshold), to_char(maxthreshold));
3916: raise;
3917: end Background;
3918:
3989:
3990: exception
3991: when others then
3992: -- Retrieve error message into errbuf
3993: wf_core.get_error(errname, errmsg, errstack);
3994: if (errmsg is not null) then
3995: errbuf := errmsg;
3996: else
3997: errbuf := sqlerrm;
4034:
4035: begin
4036: -- Argument validation
4037: if ((itemtype is null) or (itemkey is null)) then
4038: Wf_Core.Token('ITEMTYPE', itemtype);
4039: Wf_Core.Token('ITEMKEY', itemkey);
4040: Wf_Core.Token('PROCESS', process);
4041: Wf_Core.Raise('WFSQL_ARGS');
4042: end if;
4035: begin
4036: -- Argument validation
4037: if ((itemtype is null) or (itemkey is null)) then
4038: Wf_Core.Token('ITEMTYPE', itemtype);
4039: Wf_Core.Token('ITEMKEY', itemkey);
4040: Wf_Core.Token('PROCESS', process);
4041: Wf_Core.Raise('WFSQL_ARGS');
4042: end if;
4043:
4036: -- Argument validation
4037: if ((itemtype is null) or (itemkey is null)) then
4038: Wf_Core.Token('ITEMTYPE', itemtype);
4039: Wf_Core.Token('ITEMKEY', itemkey);
4040: Wf_Core.Token('PROCESS', process);
4041: Wf_Core.Raise('WFSQL_ARGS');
4042: end if;
4043:
4044: --
4037: if ((itemtype is null) or (itemkey is null)) then
4038: Wf_Core.Token('ITEMTYPE', itemtype);
4039: Wf_Core.Token('ITEMKEY', itemkey);
4040: Wf_Core.Token('PROCESS', process);
4041: Wf_Core.Raise('WFSQL_ARGS');
4042: end if;
4043:
4044: --
4045: if (WF_CACHE.MetaRefreshed) then
4062: when others then
4063: status := 'x'; -- Treat errors like incomplete process
4064: end;
4065: if (nvl(status, 'x') <> wf_engine.eng_completed) then
4066: Wf_Core.Token('ITEMTYPE', itemtype);
4067: Wf_Core.Token('ITEMKEY', itemkey);
4068: Wf_Core.Raise('WFENG_SYNCH_ITEM');
4069: end if;
4070: end if;
4063: status := 'x'; -- Treat errors like incomplete process
4064: end;
4065: if (nvl(status, 'x') <> wf_engine.eng_completed) then
4066: Wf_Core.Token('ITEMTYPE', itemtype);
4067: Wf_Core.Token('ITEMKEY', itemkey);
4068: Wf_Core.Raise('WFENG_SYNCH_ITEM');
4069: end if;
4070: end if;
4071: else
4064: end;
4065: if (nvl(status, 'x') <> wf_engine.eng_completed) then
4066: Wf_Core.Token('ITEMTYPE', itemtype);
4067: Wf_Core.Token('ITEMKEY', itemkey);
4068: Wf_Core.Raise('WFENG_SYNCH_ITEM');
4069: end if;
4070: end if;
4071: else
4072: -- Not synchmode. Clear plsql cache first, just in case previous
4072: -- Not synchmode. Clear plsql cache first, just in case previous
4073: -- item was purged/rolled back, then check for duplicate.
4074: Wf_Item.ClearCache;
4075: if (Wf_Item.Item_Exist(itemtype, itemkey)) then
4076: Wf_Core.Token('TYPE', itemtype);
4077: Wf_Core.Token('KEY', itemkey);
4078: Wf_Core.Raise('WFENG_ITEM_UNIQUE');
4079: end if;
4080: end if;
4073: -- item was purged/rolled back, then check for duplicate.
4074: Wf_Item.ClearCache;
4075: if (Wf_Item.Item_Exist(itemtype, itemkey)) then
4076: Wf_Core.Token('TYPE', itemtype);
4077: Wf_Core.Token('KEY', itemkey);
4078: Wf_Core.Raise('WFENG_ITEM_UNIQUE');
4079: end if;
4080: end if;
4081:
4074: Wf_Item.ClearCache;
4075: if (Wf_Item.Item_Exist(itemtype, itemkey)) then
4076: Wf_Core.Token('TYPE', itemtype);
4077: Wf_Core.Token('KEY', itemkey);
4078: Wf_Core.Raise('WFENG_ITEM_UNIQUE');
4079: end if;
4080: end if;
4081:
4082: if (process is null) then
4082: if (process is null) then
4083: -- Call the selector function to get the process
4084: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey);
4085: if (root is null) then
4086: Wf_Core.Token('TYPE', itemtype);
4087: Wf_Core.Token('KEY', itemkey);
4088: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
4089: end if;
4090: else
4083: -- Call the selector function to get the process
4084: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey);
4085: if (root is null) then
4086: Wf_Core.Token('TYPE', itemtype);
4087: Wf_Core.Token('KEY', itemkey);
4088: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
4089: end if;
4090: else
4091: root := process;
4084: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey);
4085: if (root is null) then
4086: Wf_Core.Token('TYPE', itemtype);
4087: Wf_Core.Token('KEY', itemkey);
4088: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
4089: end if;
4090: else
4091: root := process;
4092: end if;
4098: -- create_item so the date has been established.
4099: actdate := sysdate;
4100: typ := Wf_Activity.Type(itemtype, root, actdate);
4101: if ((typ is null) or (typ <> wf_engine.eng_process)) then
4102: Wf_Core.Token('TYPE', itemtype);
4103: Wf_Core.Token('NAME', root);
4104: Wf_Core.Raise('WFENG_PROCESS_NAME');
4105: end if;
4106:
4099: actdate := sysdate;
4100: typ := Wf_Activity.Type(itemtype, root, actdate);
4101: if ((typ is null) or (typ <> wf_engine.eng_process)) then
4102: Wf_Core.Token('TYPE', itemtype);
4103: Wf_Core.Token('NAME', root);
4104: Wf_Core.Raise('WFENG_PROCESS_NAME');
4105: end if;
4106:
4107: -- Insert row in items table
4100: typ := Wf_Activity.Type(itemtype, root, actdate);
4101: if ((typ is null) or (typ <> wf_engine.eng_process)) then
4102: Wf_Core.Token('TYPE', itemtype);
4103: Wf_Core.Token('NAME', root);
4104: Wf_Core.Raise('WFENG_PROCESS_NAME');
4105: end if;
4106:
4107: -- Insert row in items table
4108: Wf_Item.Create_Item(itemtype, itemkey, root, actdate, createprocess.user_key,
4111: -- Validate the root argument is runnable
4112: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey,
4113: root);
4114: if (rootid is null) then
4115: Wf_Core.Token('TYPE', itemtype);
4116: Wf_Core.Token('NAME', root);
4117: Wf_Core.Raise('WFENG_PROCESS_RUNNABLE');
4118: end if;
4119:
4112: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey,
4113: root);
4114: if (rootid is null) then
4115: Wf_Core.Token('TYPE', itemtype);
4116: Wf_Core.Token('NAME', root);
4117: Wf_Core.Raise('WFENG_PROCESS_RUNNABLE');
4118: end if;
4119:
4120: if (itemkey <> WF_ENGINE.eng_synch) then
4113: root);
4114: if (rootid is null) then
4115: Wf_Core.Token('TYPE', itemtype);
4116: Wf_Core.Token('NAME', root);
4117: Wf_Core.Raise('WFENG_PROCESS_RUNNABLE');
4118: end if;
4119:
4120: if (itemkey <> WF_ENGINE.eng_synch) then
4121: -- Create monitor access key attributes
4119:
4120: if (itemkey <> WF_ENGINE.eng_synch) then
4121: -- Create monitor access key attributes
4122: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.wfmon_mon_key,
4123: Wf_Core.Random);
4124: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.wfmon_acc_key,
4125: Wf_Core.Random);
4126: end if;
4127:
4121: -- Create monitor access key attributes
4122: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.wfmon_mon_key,
4123: Wf_Core.Random);
4124: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.wfmon_acc_key,
4125: Wf_Core.Random);
4126: end if;
4127:
4128: -- Create a schema attribute
4129: Wf_Engine.AddItemAttr(itemtype, itemkey, wf_engine.eng_schema,
4144: when others then
4145: -- Bug 4117740
4146: -- Call clearcache() when #SYNCH flow is in error
4147: if ((itemkey = WF_ENGINE.eng_synch) and
4148: (wf_core.error_name is null or wf_core.error_name <> 'WFENG_SYNCH_ITEM') and
4149: (not WF_ENGINE.debug)) then
4150: Wf_Item.ClearCache;
4151: end if;
4152:
4149: (not WF_ENGINE.debug)) then
4150: Wf_Item.ClearCache;
4151: end if;
4152:
4153: Wf_Core.Context('Wf_Engine', 'CreateProcess', itemtype, itemkey, process);
4154: raise;
4155: end CreateProcess;
4156:
4157: --
4176: itemkey => itemkey,
4177: runmode => 'START');
4178: exception
4179: when others then
4180: Wf_Core.Context('Wf_Engine', 'StartProcess', itemtype, itemkey);
4181: raise;
4182: end StartProcess;
4183:
4184: --
4202: begin
4203: -- Check Arguments
4204: if ((itemtype is null) or
4205: (itemkey is null)) then
4206: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4207: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
4208: Wf_Core.Raise('WFSQL_ARGS');
4209:
4210: end if;
4203: -- Check Arguments
4204: if ((itemtype is null) or
4205: (itemkey is null)) then
4206: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4207: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
4208: Wf_Core.Raise('WFSQL_ARGS');
4209:
4210: end if;
4211:
4204: if ((itemtype is null) or
4205: (itemkey is null)) then
4206: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4207: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
4208: Wf_Core.Raise('WFSQL_ARGS');
4209:
4210: end if;
4211:
4212: wf_engine.CreateProcess (itemtype,itemkey,process);
4221:
4222: wf_engine.StartProcess (itemtype,itemkey);
4223: exception
4224: when others then
4225: Wf_Core.Context('Wf_Engine', 'LaunchProcess', itemtype, itemkey,
4226: process, userkey, owner);
4227: raise;
4228: end LaunchProcess;
4229:
4263:
4264: begin
4265: -- Check Arguments
4266: if (itemtype is null) then
4267: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4268: Wf_Core.Raise('WFSQL_ARGS');
4269:
4270: -- Not allowed in synch mode
4271: elsif (itemkey = wf_engine.eng_synch) then
4264: begin
4265: -- Check Arguments
4266: if (itemtype is null) then
4267: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4268: Wf_Core.Raise('WFSQL_ARGS');
4269:
4270: -- Not allowed in synch mode
4271: elsif (itemkey = wf_engine.eng_synch) then
4272: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
4268: Wf_Core.Raise('WFSQL_ARGS');
4269:
4270: -- Not allowed in synch mode
4271: elsif (itemkey = wf_engine.eng_synch) then
4272: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
4273: wf_core.raise('WFENG_SYNCH_DISABLED');
4274:
4275: elsif (itemkey is null) then
4276: WF_ENGINE.SuspendAll(itemtype, process); --
4269:
4270: -- Not allowed in synch mode
4271: elsif (itemkey = wf_engine.eng_synch) then
4272: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
4273: wf_core.raise('WFENG_SYNCH_DISABLED');
4274:
4275: elsif (itemkey is null) then
4276: WF_ENGINE.SuspendAll(itemtype, process); --
4277: return;
4280:
4281: -- Get the root process for this key and also validate the item
4282: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4283: if (root is null) then
4284: Wf_Core.Token('TYPE', itemtype);
4285: Wf_Core.Token('KEY', itemkey);
4286: Wf_Core.Raise('WFENG_ITEM');
4287: end if;
4288:
4281: -- Get the root process for this key and also validate the item
4282: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4283: if (root is null) then
4284: Wf_Core.Token('TYPE', itemtype);
4285: Wf_Core.Token('KEY', itemkey);
4286: Wf_Core.Raise('WFENG_ITEM');
4287: end if;
4288:
4289: -- Get the process instance id.
4282: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4283: if (root is null) then
4284: Wf_Core.Token('TYPE', itemtype);
4285: Wf_Core.Token('KEY', itemkey);
4286: Wf_Core.Raise('WFENG_ITEM');
4287: end if;
4288:
4289: -- Get the process instance id.
4290: -- Search the process beginnning at the root process of the item for the
4291: -- activity matching process.
4292: actdate := Wf_Item.Active_Date(itemtype, itemkey);
4293: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4294: if (rootid is null) then
4295: Wf_Core.Token('TYPE', itemtype);
4296: Wf_Core.Token('KEY', itemkey);
4297: Wf_Core.Token('NAME', root);
4298: Wf_Core.Raise('WFENG_ITEM_ROOT');
4299: end if;
4292: actdate := Wf_Item.Active_Date(itemtype, itemkey);
4293: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4294: if (rootid is null) then
4295: Wf_Core.Token('TYPE', itemtype);
4296: Wf_Core.Token('KEY', itemkey);
4297: Wf_Core.Token('NAME', root);
4298: Wf_Core.Raise('WFENG_ITEM_ROOT');
4299: end if;
4300:
4293: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4294: if (rootid is null) then
4295: Wf_Core.Token('TYPE', itemtype);
4296: Wf_Core.Token('KEY', itemkey);
4297: Wf_Core.Token('NAME', root);
4298: Wf_Core.Raise('WFENG_ITEM_ROOT');
4299: end if;
4300:
4301: if (process is null) then
4294: if (rootid is null) then
4295: Wf_Core.Token('TYPE', itemtype);
4296: Wf_Core.Token('KEY', itemkey);
4297: Wf_Core.Token('NAME', root);
4298: Wf_Core.Raise('WFENG_ITEM_ROOT');
4299: end if;
4300:
4301: if (process is null) then
4302: -- Suspend the root process
4306: -- Suspend the given process
4307: proc := process;
4308: procid := Wf_Process_Activity.FindActivity(rootid, proc, actdate);
4309: if (procid is null) then
4310: Wf_Core.Token('TYPE', itemtype);
4311: Wf_Core.Token('KEY', itemkey);
4312: Wf_Core.Token('NAME', proc);
4313: Wf_Core.Token('VERSION', to_char(version));
4314: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4307: proc := process;
4308: procid := Wf_Process_Activity.FindActivity(rootid, proc, actdate);
4309: if (procid is null) then
4310: Wf_Core.Token('TYPE', itemtype);
4311: Wf_Core.Token('KEY', itemkey);
4312: Wf_Core.Token('NAME', proc);
4313: Wf_Core.Token('VERSION', to_char(version));
4314: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4315: end if;
4308: procid := Wf_Process_Activity.FindActivity(rootid, proc, actdate);
4309: if (procid is null) then
4310: Wf_Core.Token('TYPE', itemtype);
4311: Wf_Core.Token('KEY', itemkey);
4312: Wf_Core.Token('NAME', proc);
4313: Wf_Core.Token('VERSION', to_char(version));
4314: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4315: end if;
4316:
4309: if (procid is null) then
4310: Wf_Core.Token('TYPE', itemtype);
4311: Wf_Core.Token('KEY', itemkey);
4312: Wf_Core.Token('NAME', proc);
4313: Wf_Core.Token('VERSION', to_char(version));
4314: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4315: end if;
4316:
4317: -- Check that activity is a PROCESS-type.
4310: Wf_Core.Token('TYPE', itemtype);
4311: Wf_Core.Token('KEY', itemkey);
4312: Wf_Core.Token('NAME', proc);
4313: Wf_Core.Token('VERSION', to_char(version));
4314: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4315: end if;
4316:
4317: -- Check that activity is a PROCESS-type.
4318: -- Only PROCESS activities may be suspended.
4317: -- Check that activity is a PROCESS-type.
4318: -- Only PROCESS activities may be suspended.
4319: if (Wf_Activity.Instance_Type(procid, actdate) <>
4320: wf_engine.eng_process) then
4321: Wf_Core.Token('NAME', proc);
4322: Wf_Core.Token('TYPE', itemtype);
4323: Wf_Core.Raise('WFENG_PROCESS_NAME');
4324: end if;
4325: end if;
4318: -- Only PROCESS activities may be suspended.
4319: if (Wf_Activity.Instance_Type(procid, actdate) <>
4320: wf_engine.eng_process) then
4321: Wf_Core.Token('NAME', proc);
4322: Wf_Core.Token('TYPE', itemtype);
4323: Wf_Core.Raise('WFENG_PROCESS_NAME');
4324: end if;
4325: end if;
4326:
4319: if (Wf_Activity.Instance_Type(procid, actdate) <>
4320: wf_engine.eng_process) then
4321: Wf_Core.Token('NAME', proc);
4322: Wf_Core.Token('TYPE', itemtype);
4323: Wf_Core.Raise('WFENG_PROCESS_NAME');
4324: end if;
4325: end if;
4326:
4327: -- Always clear the cache first
4354:
4355: -- Suspend all the children processes
4356: Wf_Engine_Util.Suspend_Child_Processes(itemtype, itemkey, procid);
4357: else
4358: Wf_Core.Token('TYPE', itemtype);
4359: Wf_Core.Token('KEY', itemkey);
4360: Wf_Core.Token('NAME', proc);
4361: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4362: end if;
4355: -- Suspend all the children processes
4356: Wf_Engine_Util.Suspend_Child_Processes(itemtype, itemkey, procid);
4357: else
4358: Wf_Core.Token('TYPE', itemtype);
4359: Wf_Core.Token('KEY', itemkey);
4360: Wf_Core.Token('NAME', proc);
4361: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4362: end if;
4363:
4356: Wf_Engine_Util.Suspend_Child_Processes(itemtype, itemkey, procid);
4357: else
4358: Wf_Core.Token('TYPE', itemtype);
4359: Wf_Core.Token('KEY', itemkey);
4360: Wf_Core.Token('NAME', proc);
4361: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4362: end if;
4363:
4364: exception
4357: else
4358: Wf_Core.Token('TYPE', itemtype);
4359: Wf_Core.Token('KEY', itemkey);
4360: Wf_Core.Token('NAME', proc);
4361: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4362: end if;
4363:
4364: exception
4365: when others then
4362: end if;
4363:
4364: exception
4365: when others then
4366: Wf_Core.Context('Wf_Engine', 'SuspendProcess', itemtype, itemkey, process);
4367: raise;
4368: end SuspendProcess;
4369:
4370: --
4425:
4426: begin
4427: -- Check Arguments
4428: if (itemtype is null) then
4429: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4430: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
4431: Wf_Core.Raise('WFSQL_ARGS');
4432:
4433: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4426: begin
4427: -- Check Arguments
4428: if (itemtype is null) then
4429: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4430: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
4431: Wf_Core.Raise('WFSQL_ARGS');
4432:
4433: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4434: wf_core.token('OPERATION', 'Wf_Engine.AbortProcess');
4427: -- Check Arguments
4428: if (itemtype is null) then
4429: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4430: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
4431: Wf_Core.Raise('WFSQL_ARGS');
4432:
4433: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4434: wf_core.token('OPERATION', 'Wf_Engine.AbortProcess');
4435: wf_core.raise('WFENG_SYNCH_DISABLED');
4430: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
4431: Wf_Core.Raise('WFSQL_ARGS');
4432:
4433: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4434: wf_core.token('OPERATION', 'Wf_Engine.AbortProcess');
4435: wf_core.raise('WFENG_SYNCH_DISABLED');
4436: end if;
4437:
4438: --Do the check for lock ONLY if there is an explicit
4431: Wf_Core.Raise('WFSQL_ARGS');
4432:
4433: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4434: wf_core.token('OPERATION', 'Wf_Engine.AbortProcess');
4435: wf_core.raise('WFENG_SYNCH_DISABLED');
4436: end if;
4437:
4438: --Do the check for lock ONLY if there is an explicit
4439: --request for the same.
4445:
4446: -- Get the root process for this key and also validate the item
4447: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4448: if (root is null) then
4449: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey, process);
4450: Wf_Core.Token('TYPE', itemtype);
4451: Wf_Core.Token('KEY', itemkey);
4452: Wf_Core.Raise('WFENG_ITEM');
4453: end if;
4446: -- Get the root process for this key and also validate the item
4447: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4448: if (root is null) then
4449: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey, process);
4450: Wf_Core.Token('TYPE', itemtype);
4451: Wf_Core.Token('KEY', itemkey);
4452: Wf_Core.Raise('WFENG_ITEM');
4453: end if;
4454:
4447: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4448: if (root is null) then
4449: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey, process);
4450: Wf_Core.Token('TYPE', itemtype);
4451: Wf_Core.Token('KEY', itemkey);
4452: Wf_Core.Raise('WFENG_ITEM');
4453: end if;
4454:
4455: -- Get the process instance id.
4448: if (root is null) then
4449: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey, process);
4450: Wf_Core.Token('TYPE', itemtype);
4451: Wf_Core.Token('KEY', itemkey);
4452: Wf_Core.Raise('WFENG_ITEM');
4453: end if;
4454:
4455: -- Get the process instance id.
4456: -- Search the process beginnning at the root process of the item for the
4457: -- activity matching process.
4458: actdate := Wf_Item.Active_Date(itemtype, itemkey);
4459: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4460: if (rootid is null) then
4461: Wf_Core.Token('TYPE', itemtype);
4462: Wf_Core.Token('KEY', itemkey);
4463: Wf_Core.Token('NAME', root);
4464: Wf_Core.Raise('WFENG_ITEM_ROOT');
4465: end if;
4458: actdate := Wf_Item.Active_Date(itemtype, itemkey);
4459: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4460: if (rootid is null) then
4461: Wf_Core.Token('TYPE', itemtype);
4462: Wf_Core.Token('KEY', itemkey);
4463: Wf_Core.Token('NAME', root);
4464: Wf_Core.Raise('WFENG_ITEM_ROOT');
4465: end if;
4466:
4459: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4460: if (rootid is null) then
4461: Wf_Core.Token('TYPE', itemtype);
4462: Wf_Core.Token('KEY', itemkey);
4463: Wf_Core.Token('NAME', root);
4464: Wf_Core.Raise('WFENG_ITEM_ROOT');
4465: end if;
4466:
4467: if (process is null) then
4460: if (rootid is null) then
4461: Wf_Core.Token('TYPE', itemtype);
4462: Wf_Core.Token('KEY', itemkey);
4463: Wf_Core.Token('NAME', root);
4464: Wf_Core.Raise('WFENG_ITEM_ROOT');
4465: end if;
4466:
4467: if (process is null) then
4468: -- Abort the root process
4472: -- Abort the given process
4473: proc := process;
4474: procid := Wf_Process_Activity.FindActivity(rootid, process, actdate);
4475: if (procid is null) then
4476: Wf_Core.Token('TYPE', itemtype);
4477: Wf_Core.Token('KEY', itemkey);
4478: Wf_Core.Token('NAME', process);
4479: Wf_Core.Token('VERSION', to_char(version));
4480: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4473: proc := process;
4474: procid := Wf_Process_Activity.FindActivity(rootid, process, actdate);
4475: if (procid is null) then
4476: Wf_Core.Token('TYPE', itemtype);
4477: Wf_Core.Token('KEY', itemkey);
4478: Wf_Core.Token('NAME', process);
4479: Wf_Core.Token('VERSION', to_char(version));
4480: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4481: end if;
4474: procid := Wf_Process_Activity.FindActivity(rootid, process, actdate);
4475: if (procid is null) then
4476: Wf_Core.Token('TYPE', itemtype);
4477: Wf_Core.Token('KEY', itemkey);
4478: Wf_Core.Token('NAME', process);
4479: Wf_Core.Token('VERSION', to_char(version));
4480: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4481: end if;
4482:
4475: if (procid is null) then
4476: Wf_Core.Token('TYPE', itemtype);
4477: Wf_Core.Token('KEY', itemkey);
4478: Wf_Core.Token('NAME', process);
4479: Wf_Core.Token('VERSION', to_char(version));
4480: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4481: end if;
4482:
4483: -- Check that activity is a PROCESS-type.
4476: Wf_Core.Token('TYPE', itemtype);
4477: Wf_Core.Token('KEY', itemkey);
4478: Wf_Core.Token('NAME', process);
4479: Wf_Core.Token('VERSION', to_char(version));
4480: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4481: end if;
4482:
4483: -- Check that activity is a PROCESS-type.
4484: -- Only PROCESS activities may be aborted.
4483: -- Check that activity is a PROCESS-type.
4484: -- Only PROCESS activities may be aborted.
4485: if (Wf_Activity.Instance_Type(procid, actdate) <>
4486: wf_engine.eng_process) then
4487: Wf_Core.Token('NAME', proc);
4488: Wf_Core.Token('TYPE', itemtype);
4489: Wf_Core.Raise('WFENG_PROCESS_NAME');
4490: end if;
4491: end if;
4484: -- Only PROCESS activities may be aborted.
4485: if (Wf_Activity.Instance_Type(procid, actdate) <>
4486: wf_engine.eng_process) then
4487: Wf_Core.Token('NAME', proc);
4488: Wf_Core.Token('TYPE', itemtype);
4489: Wf_Core.Raise('WFENG_PROCESS_NAME');
4490: end if;
4491: end if;
4492:
4485: if (Wf_Activity.Instance_Type(procid, actdate) <>
4486: wf_engine.eng_process) then
4487: Wf_Core.Token('NAME', proc);
4488: Wf_Core.Token('TYPE', itemtype);
4489: Wf_Core.Raise('WFENG_PROCESS_NAME');
4490: end if;
4491: end if;
4492:
4493: -- Always clear the cache first
4497: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4498:
4499: if (status is null) then
4500: if (WF_ITEM.SetEndDate(itemtype, itemkey) = 1) then
4501: Wf_Core.Token('TYPE', itemtype);
4502: Wf_core.Token('KEY', itemkey);
4503: Wf_core.Token('NAME', proc);
4504: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4505: end if;
4498:
4499: if (status is null) then
4500: if (WF_ITEM.SetEndDate(itemtype, itemkey) = 1) then
4501: Wf_Core.Token('TYPE', itemtype);
4502: Wf_core.Token('KEY', itemkey);
4503: Wf_core.Token('NAME', proc);
4504: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4505: end if;
4506:
4499: if (status is null) then
4500: if (WF_ITEM.SetEndDate(itemtype, itemkey) = 1) then
4501: Wf_Core.Token('TYPE', itemtype);
4502: Wf_core.Token('KEY', itemkey);
4503: Wf_core.Token('NAME', proc);
4504: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4505: end if;
4506:
4507: elsif (status = wf_engine.eng_completed) then
4500: if (WF_ITEM.SetEndDate(itemtype, itemkey) = 1) then
4501: Wf_Core.Token('TYPE', itemtype);
4502: Wf_core.Token('KEY', itemkey);
4503: Wf_core.Token('NAME', proc);
4504: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4505: end if;
4506:
4507: elsif (status = wf_engine.eng_completed) then
4508: Wf_Core.Token('TYPE', itemtype);
4504: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4505: end if;
4506:
4507: elsif (status = wf_engine.eng_completed) then
4508: Wf_Core.Token('TYPE', itemtype);
4509: Wf_Core.Token('KEY', itemkey);
4510: Wf_Core.Token('NAME', proc);
4511: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4512: else
4505: end if;
4506:
4507: elsif (status = wf_engine.eng_completed) then
4508: Wf_Core.Token('TYPE', itemtype);
4509: Wf_Core.Token('KEY', itemkey);
4510: Wf_Core.Token('NAME', proc);
4511: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4512: else
4513: -- Mark process as 'COMPLETE', 'result' in WIAS table
4506:
4507: elsif (status = wf_engine.eng_completed) then
4508: Wf_Core.Token('TYPE', itemtype);
4509: Wf_Core.Token('KEY', itemkey);
4510: Wf_Core.Token('NAME', proc);
4511: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4512: else
4513: -- Mark process as 'COMPLETE', 'result' in WIAS table
4514: -- Doing this stops the engine from going through the rest of the flow
4507: elsif (status = wf_engine.eng_completed) then
4508: Wf_Core.Token('TYPE', itemtype);
4509: Wf_Core.Token('KEY', itemkey);
4510: Wf_Core.Token('NAME', proc);
4511: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4512: else
4513: -- Mark process as 'COMPLETE', 'result' in WIAS table
4514: -- Doing this stops the engine from going through the rest of the flow
4515: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4544: p_parameters => l_parameterlist);
4545:
4546: exception
4547: when resource_busy then
4548: wf_core.token('TYPE',itemtype);
4549: wf_core.token('KEY',itemkey);
4550: wf_core.raise('WFENG_RESOURCE_BUSY');
4551:
4552: when others then
4545:
4546: exception
4547: when resource_busy then
4548: wf_core.token('TYPE',itemtype);
4549: wf_core.token('KEY',itemkey);
4550: wf_core.raise('WFENG_RESOURCE_BUSY');
4551:
4552: when others then
4553: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey,
4546: exception
4547: when resource_busy then
4548: wf_core.token('TYPE',itemtype);
4549: wf_core.token('KEY',itemkey);
4550: wf_core.raise('WFENG_RESOURCE_BUSY');
4551:
4552: when others then
4553: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey,
4554: process, result);
4549: wf_core.token('KEY',itemkey);
4550: wf_core.raise('WFENG_RESOURCE_BUSY');
4551:
4552: when others then
4553: Wf_Core.Context('Wf_Engine', 'AbortProcess', itemtype, itemkey,
4554: process, result);
4555: raise;
4556: end AbortProcess;
4557:
4600: act_begin_date InstanceDateArray;
4601: begin
4602: -- Check Arguments
4603: if (itemtype is null) then
4604: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4605: Wf_Core.Raise('WFSQL_ARGS');
4606:
4607: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4608: wf_core.token('OPERATION', 'Wf_Engine.ResumeProcess');
4601: begin
4602: -- Check Arguments
4603: if (itemtype is null) then
4604: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4605: Wf_Core.Raise('WFSQL_ARGS');
4606:
4607: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4608: wf_core.token('OPERATION', 'Wf_Engine.ResumeProcess');
4609: wf_core.raise('WFENG_SYNCH_DISABLED');
4604: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
4605: Wf_Core.Raise('WFSQL_ARGS');
4606:
4607: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4608: wf_core.token('OPERATION', 'Wf_Engine.ResumeProcess');
4609: wf_core.raise('WFENG_SYNCH_DISABLED');
4610:
4611: elsif (itemkey is NULL) then
4612: WF_ENGINE.ResumeAll(itemtype, process); --
4605: Wf_Core.Raise('WFSQL_ARGS');
4606:
4607: elsif (itemkey = wf_engine.eng_synch) then -- Not allowed in synch mode
4608: wf_core.token('OPERATION', 'Wf_Engine.ResumeProcess');
4609: wf_core.raise('WFENG_SYNCH_DISABLED');
4610:
4611: elsif (itemkey is NULL) then
4612: WF_ENGINE.ResumeAll(itemtype, process); --
4613: return;
4616:
4617: -- Get the root process for this key
4618: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4619: if (root is null) then
4620: Wf_Core.Token('TYPE', itemtype);
4621: Wf_Core.Token('KEY', itemkey);
4622: Wf_Core.Raise('WFENG_ITEM');
4623: end if;
4624:
4617: -- Get the root process for this key
4618: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4619: if (root is null) then
4620: Wf_Core.Token('TYPE', itemtype);
4621: Wf_Core.Token('KEY', itemkey);
4622: Wf_Core.Raise('WFENG_ITEM');
4623: end if;
4624:
4625: -- Get the process instance id.
4618: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4619: if (root is null) then
4620: Wf_Core.Token('TYPE', itemtype);
4621: Wf_Core.Token('KEY', itemkey);
4622: Wf_Core.Raise('WFENG_ITEM');
4623: end if;
4624:
4625: -- Get the process instance id.
4626: -- Search the process beginnning at the root process of the item for the
4627: -- activity matching process.
4628: actdate := Wf_Item.Active_Date(itemtype, itemkey);
4629: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4630: if (rootid is null) then
4631: Wf_Core.Token('TYPE', itemtype);
4632: Wf_Core.Token('KEY', itemkey);
4633: Wf_Core.Token('NAME', root);
4634: Wf_Core.Raise('WFENG_ITEM_ROOT');
4635: end if;
4628: actdate := Wf_Item.Active_Date(itemtype, itemkey);
4629: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4630: if (rootid is null) then
4631: Wf_Core.Token('TYPE', itemtype);
4632: Wf_Core.Token('KEY', itemkey);
4633: Wf_Core.Token('NAME', root);
4634: Wf_Core.Raise('WFENG_ITEM_ROOT');
4635: end if;
4636:
4629: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
4630: if (rootid is null) then
4631: Wf_Core.Token('TYPE', itemtype);
4632: Wf_Core.Token('KEY', itemkey);
4633: Wf_Core.Token('NAME', root);
4634: Wf_Core.Raise('WFENG_ITEM_ROOT');
4635: end if;
4636:
4637: if (process is null) then
4630: if (rootid is null) then
4631: Wf_Core.Token('TYPE', itemtype);
4632: Wf_Core.Token('KEY', itemkey);
4633: Wf_Core.Token('NAME', root);
4634: Wf_Core.Raise('WFENG_ITEM_ROOT');
4635: end if;
4636:
4637: if (process is null) then
4638: -- Resume the root process
4642: -- Resume the given process
4643: proc := process;
4644: procid := Wf_Process_Activity.FindActivity(rootid, process, actdate);
4645: if (procid is null) then
4646: Wf_Core.Token('TYPE', itemtype);
4647: Wf_Core.Token('KEY', itemkey);
4648: Wf_Core.Token('NAME', process);
4649: Wf_Core.Token('VERSION', to_char(version));
4650: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4643: proc := process;
4644: procid := Wf_Process_Activity.FindActivity(rootid, process, actdate);
4645: if (procid is null) then
4646: Wf_Core.Token('TYPE', itemtype);
4647: Wf_Core.Token('KEY', itemkey);
4648: Wf_Core.Token('NAME', process);
4649: Wf_Core.Token('VERSION', to_char(version));
4650: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4651: end if;
4644: procid := Wf_Process_Activity.FindActivity(rootid, process, actdate);
4645: if (procid is null) then
4646: Wf_Core.Token('TYPE', itemtype);
4647: Wf_Core.Token('KEY', itemkey);
4648: Wf_Core.Token('NAME', process);
4649: Wf_Core.Token('VERSION', to_char(version));
4650: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4651: end if;
4652:
4645: if (procid is null) then
4646: Wf_Core.Token('TYPE', itemtype);
4647: Wf_Core.Token('KEY', itemkey);
4648: Wf_Core.Token('NAME', process);
4649: Wf_Core.Token('VERSION', to_char(version));
4650: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4651: end if;
4652:
4653: -- Check that activity is a PROCESS-type.
4646: Wf_Core.Token('TYPE', itemtype);
4647: Wf_Core.Token('KEY', itemkey);
4648: Wf_Core.Token('NAME', process);
4649: Wf_Core.Token('VERSION', to_char(version));
4650: Wf_Core.Raise('WFENG_ITEM_PROCESS');
4651: end if;
4652:
4653: -- Check that activity is a PROCESS-type.
4654: -- Only PROCESS activities may be resumed.
4653: -- Check that activity is a PROCESS-type.
4654: -- Only PROCESS activities may be resumed.
4655: if (Wf_Activity.Instance_Type(procid, actdate) <>
4656: wf_engine.eng_process) then
4657: Wf_Core.Token('NAME', proc);
4658: Wf_Core.Token('TYPE', itemtype);
4659: Wf_Core.Raise('WFENG_PROCESS_NAME');
4660: end if;
4661: end if;
4654: -- Only PROCESS activities may be resumed.
4655: if (Wf_Activity.Instance_Type(procid, actdate) <>
4656: wf_engine.eng_process) then
4657: Wf_Core.Token('NAME', proc);
4658: Wf_Core.Token('TYPE', itemtype);
4659: Wf_Core.Raise('WFENG_PROCESS_NAME');
4660: end if;
4661: end if;
4662:
4655: if (Wf_Activity.Instance_Type(procid, actdate) <>
4656: wf_engine.eng_process) then
4657: Wf_Core.Token('NAME', proc);
4658: Wf_Core.Token('TYPE', itemtype);
4659: Wf_Core.Raise('WFENG_PROCESS_NAME');
4660: end if;
4661: end if;
4662:
4663: -- Always clear the cache first
4665:
4666: -- Check if the process is suspended
4667: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4668: if (status is null) then
4669: Wf_Core.Token('TYPE', itemtype);
4670: Wf_Core.Token('KEY', itemkey);
4671: Wf_Core.Token('NAME', proc);
4672: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4673: elsif (status <> wf_engine.eng_suspended) then
4666: -- Check if the process is suspended
4667: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4668: if (status is null) then
4669: Wf_Core.Token('TYPE', itemtype);
4670: Wf_Core.Token('KEY', itemkey);
4671: Wf_Core.Token('NAME', proc);
4672: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4673: elsif (status <> wf_engine.eng_suspended) then
4674: Wf_Core.Token('TYPE', itemtype);
4667: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4668: if (status is null) then
4669: Wf_Core.Token('TYPE', itemtype);
4670: Wf_Core.Token('KEY', itemkey);
4671: Wf_Core.Token('NAME', proc);
4672: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4673: elsif (status <> wf_engine.eng_suspended) then
4674: Wf_Core.Token('TYPE', itemtype);
4675: Wf_Core.Token('KEY', itemkey);
4668: if (status is null) then
4669: Wf_Core.Token('TYPE', itemtype);
4670: Wf_Core.Token('KEY', itemkey);
4671: Wf_Core.Token('NAME', proc);
4672: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4673: elsif (status <> wf_engine.eng_suspended) then
4674: Wf_Core.Token('TYPE', itemtype);
4675: Wf_Core.Token('KEY', itemkey);
4676: Wf_Core.Token('NAME', proc);
4670: Wf_Core.Token('KEY', itemkey);
4671: Wf_Core.Token('NAME', proc);
4672: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4673: elsif (status <> wf_engine.eng_suspended) then
4674: Wf_Core.Token('TYPE', itemtype);
4675: Wf_Core.Token('KEY', itemkey);
4676: Wf_Core.Token('NAME', proc);
4677: Wf_Core.Raise('WFENG_ITEM_PROCESS_SUSPENDED');
4678: else
4671: Wf_Core.Token('NAME', proc);
4672: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4673: elsif (status <> wf_engine.eng_suspended) then
4674: Wf_Core.Token('TYPE', itemtype);
4675: Wf_Core.Token('KEY', itemkey);
4676: Wf_Core.Token('NAME', proc);
4677: Wf_Core.Raise('WFENG_ITEM_PROCESS_SUSPENDED');
4678: else
4679: -- If we came here, that means the process is currently suspended.
4672: Wf_Core.Raise('WFENG_ITEM_PROCESS_RUNNING');
4673: elsif (status <> wf_engine.eng_suspended) then
4674: Wf_Core.Token('TYPE', itemtype);
4675: Wf_Core.Token('KEY', itemkey);
4676: Wf_Core.Token('NAME', proc);
4677: Wf_Core.Raise('WFENG_ITEM_PROCESS_SUSPENDED');
4678: else
4679: -- If we came here, that means the process is currently suspended.
4680: -- Mark process as eng_active 'active', 'null' in WIAS table
4673: elsif (status <> wf_engine.eng_suspended) then
4674: Wf_Core.Token('TYPE', itemtype);
4675: Wf_Core.Token('KEY', itemkey);
4676: Wf_Core.Token('NAME', proc);
4677: Wf_Core.Raise('WFENG_ITEM_PROCESS_SUSPENDED');
4678: else
4679: -- If we came here, that means the process is currently suspended.
4680: -- Mark process as eng_active 'active', 'null' in WIAS table
4681: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4730: -- 2. set this activity to error status
4731: -- 3. execute the error process (if any)
4732: -- 4. clear the error to continue with next activity
4733: rollback to wf_savepoint;
4734: Wf_Core.Context('Wf_Engine', 'ResumeProcess', itemtype, itemkey,
4735: process);
4736: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actidarr(i),
4737: wf_engine.eng_exception, FALSE);
4738: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actidarr(i),
4737: wf_engine.eng_exception, FALSE);
4738: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actidarr(i),
4739: wf_engine.eng_exception);
4740:
4741: Wf_Core.Clear;
4742: end;
4743: --else case status is same as right now that is deferred.
4744: end if;
4745:
4748: end if;
4749:
4750: exception
4751: when others then
4752: Wf_Core.Context('Wf_Engine', 'ResumeProcess', itemtype, itemkey, process);
4753: raise;
4754: end ResumeProcess;
4755:
4756:
4783: WF_ENGINE.SuspendProcess(c.item_type, c.item_key, p_process);
4784:
4785: exception
4786: when others then
4787: if ( wf_core.error_name = 'WFENG_ITEM_PROCESS_ACTIVE' ) then
4788: wf_core.clear;
4789:
4790: else
4791: raise;
4784:
4785: exception
4786: when others then
4787: if ( wf_core.error_name = 'WFENG_ITEM_PROCESS_ACTIVE' ) then
4788: wf_core.clear;
4789:
4790: else
4791: raise;
4792:
4802: WF_ENGINE.SuspendProcess(p_itemType, c.item_key, p_process);
4803:
4804: exception
4805: when others then
4806: if ( wf_core.error_name = 'WFENG_ITEM_PROCESS_ACTIVE' ) then
4807: wf_core.clear;
4808:
4809: else
4810: raise;
4803:
4804: exception
4805: when others then
4806: if ( wf_core.error_name = 'WFENG_ITEM_PROCESS_ACTIVE' ) then
4807: wf_core.clear;
4808:
4809: else
4810: raise;
4811:
4817: end if;
4818:
4819: exception
4820: when others then
4821: Wf_Core.Context('Wf_Engine', 'SuspendAll', p_itemType, p_process);
4822: raise;
4823:
4824: end SuspendAll;
4825:
4901: -- Argument validation
4902: if (copy_itemtype is null)
4903: or (copy_itemkey is null)
4904: or (new_itemkey is null) then
4905: Wf_Core.Token('COPY_ITEMTYPE', copy_itemtype);
4906: Wf_Core.Token('COPY_ITEMKEY', copy_itemkey);
4907: Wf_Core.Token('NEW_ITEMKEY', new_itemkey);
4908: Wf_Core.Raise('WFSQL_ARGS');
4909: end if;
4902: if (copy_itemtype is null)
4903: or (copy_itemkey is null)
4904: or (new_itemkey is null) then
4905: Wf_Core.Token('COPY_ITEMTYPE', copy_itemtype);
4906: Wf_Core.Token('COPY_ITEMKEY', copy_itemkey);
4907: Wf_Core.Token('NEW_ITEMKEY', new_itemkey);
4908: Wf_Core.Raise('WFSQL_ARGS');
4909: end if;
4910:
4903: or (copy_itemkey is null)
4904: or (new_itemkey is null) then
4905: Wf_Core.Token('COPY_ITEMTYPE', copy_itemtype);
4906: Wf_Core.Token('COPY_ITEMKEY', copy_itemkey);
4907: Wf_Core.Token('NEW_ITEMKEY', new_itemkey);
4908: Wf_Core.Raise('WFSQL_ARGS');
4909: end if;
4910:
4911: -- Not allowed in synch mode
4904: or (new_itemkey is null) then
4905: Wf_Core.Token('COPY_ITEMTYPE', copy_itemtype);
4906: Wf_Core.Token('COPY_ITEMKEY', copy_itemkey);
4907: Wf_Core.Token('NEW_ITEMKEY', new_itemkey);
4908: Wf_Core.Raise('WFSQL_ARGS');
4909: end if;
4910:
4911: -- Not allowed in synch mode
4912: if (new_itemkey = wf_engine.eng_synch)
4910:
4911: -- Not allowed in synch mode
4912: if (new_itemkey = wf_engine.eng_synch)
4913: or (copy_itemkey = wf_engine.eng_synch) then
4914: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
4915: wf_core.raise('WFENG_SYNCH_DISABLED');
4916: end if;
4917:
4918: -- Check status
4911: -- Not allowed in synch mode
4912: if (new_itemkey = wf_engine.eng_synch)
4913: or (copy_itemkey = wf_engine.eng_synch) then
4914: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
4915: wf_core.raise('WFENG_SYNCH_DISABLED');
4916: end if;
4917:
4918: -- Check status
4919: Wf_engine.ItemStatus(copy_itemtype, copy_itemkey, status, result);
4917:
4918: -- Check status
4919: Wf_engine.ItemStatus(copy_itemtype, copy_itemkey, status, result);
4920: if (status = wf_engine.eng_error) then
4921: Wf_Core.Raise('WFENG_NOFORK_ONERROR');
4922: end if;
4923:
4924: -- Check for duplicate item
4925: if (Wf_Item.Item_Exist(copy_itemtype, new_itemkey)) then
4922: end if;
4923:
4924: -- Check for duplicate item
4925: if (Wf_Item.Item_Exist(copy_itemtype, new_itemkey)) then
4926: Wf_Core.Token('TYPE', copy_itemtype);
4927: Wf_Core.Token('KEY', new_itemkey);
4928: Wf_Core.Raise('WFENG_ITEM_UNIQUE');
4929: end if;
4930:
4923:
4924: -- Check for duplicate item
4925: if (Wf_Item.Item_Exist(copy_itemtype, new_itemkey)) then
4926: Wf_Core.Token('TYPE', copy_itemtype);
4927: Wf_Core.Token('KEY', new_itemkey);
4928: Wf_Core.Raise('WFENG_ITEM_UNIQUE');
4929: end if;
4930:
4931: --Place row-lock on this item and retrieve parent process info:
4924: -- Check for duplicate item
4925: if (Wf_Item.Item_Exist(copy_itemtype, new_itemkey)) then
4926: Wf_Core.Token('TYPE', copy_itemtype);
4927: Wf_Core.Token('KEY', new_itemkey);
4928: Wf_Core.Raise('WFENG_ITEM_UNIQUE');
4929: end if;
4930:
4931: --Place row-lock on this item and retrieve parent process info:
4932: select parent_item_type, parent_item_key, parent_context
4998:
4999:
5000: -- reset the access_keys to make them unique
5001: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5002: wf_engine.wfmon_mon_key, Wf_Core.Random);
5003: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5004: wf_engine.wfmon_acc_key, Wf_Core.Random);
5005:
5006:
5000: -- reset the access_keys to make them unique
5001: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5002: wf_engine.wfmon_mon_key, Wf_Core.Random);
5003: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5004: wf_engine.wfmon_acc_key, Wf_Core.Random);
5005:
5006:
5007: -- reset the schema, just in case, if the #SCHEMA attribute does not exist
5008: -- it will be added. The CreateProcess api now adds the #SCHEMA.
5014: wf_engine.eng_schema, Wf_Engine.Current_Schema);
5015:
5016: exception
5017: when others then
5018: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
5019: wf_core.clear;
5020: WF_ENGINE.AddItemAttr(copy_itemtype, new_itemkey,
5021: wf_engine.eng_schema,
5022: Wf_Engine.Current_Schema);
5015:
5016: exception
5017: when others then
5018: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
5019: wf_core.clear;
5020: WF_ENGINE.AddItemAttr(copy_itemtype, new_itemkey,
5021: wf_engine.eng_schema,
5022: Wf_Engine.Current_Schema);
5023:
5037: when others then
5038: --
5039: -- If item attribute already exists then ignore the error
5040: --
5041: if ( wf_core.error_name = 'WFENG_ITEM_ATTR_UNIQUE' ) then
5042: wf_core.clear;
5043: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5044: '#FORKED_FROM', copy_itemkey);
5045: else
5038: --
5039: -- If item attribute already exists then ignore the error
5040: --
5041: if ( wf_core.error_name = 'WFENG_ITEM_ATTR_UNIQUE' ) then
5042: wf_core.clear;
5043: Wf_Engine.SetItemAttrText(copy_itemtype, new_itemkey,
5044: '#FORKED_FROM', copy_itemkey);
5045: else
5046: raise;
5078: '#CNT_'||l_parent_context,
5079: 1);
5080: exception
5081: when ValTooLarge then
5082: Wf_Core.Context('WF_ENGINE', 'CreateForkProcess', copy_itemtype,
5083: copy_itemkey, new_itemkey, l_parent_itemtype,
5084: l_parent_itemkey, l_parent_context, 'TRUE');
5085: WF_CORE.Token('LABEL', l_parent_context);
5086: WF_CORE.Token('LENGTH', 25);
5081: when ValTooLarge then
5082: Wf_Core.Context('WF_ENGINE', 'CreateForkProcess', copy_itemtype,
5083: copy_itemkey, new_itemkey, l_parent_itemtype,
5084: l_parent_itemkey, l_parent_context, 'TRUE');
5085: WF_CORE.Token('LABEL', l_parent_context);
5086: WF_CORE.Token('LENGTH', 25);
5087: WF_CORE.Raise('WFENG_LABEL_TOO_LARGE');
5088: end;
5089: else
5082: Wf_Core.Context('WF_ENGINE', 'CreateForkProcess', copy_itemtype,
5083: copy_itemkey, new_itemkey, l_parent_itemtype,
5084: l_parent_itemkey, l_parent_context, 'TRUE');
5085: WF_CORE.Token('LABEL', l_parent_context);
5086: WF_CORE.Token('LENGTH', 25);
5087: WF_CORE.Raise('WFENG_LABEL_TOO_LARGE');
5088: end;
5089: else
5090: -- PARENT_CONTEXT is null
5083: copy_itemkey, new_itemkey, l_parent_itemtype,
5084: l_parent_itemkey, l_parent_context, 'TRUE');
5085: WF_CORE.Token('LABEL', l_parent_context);
5086: WF_CORE.Token('LENGTH', 25);
5087: WF_CORE.Raise('WFENG_LABEL_TOO_LARGE');
5088: end;
5089: else
5090: -- PARENT_CONTEXT is null
5091: -- increase all known #CNT counter by 1
5100: end if; --There is a parent item to this forked process.
5101: end if; --The caller signalled that this is a master/detail process.
5102: exception
5103: when others then
5104: Wf_Core.Context('Wf_Engine', 'CreateForkProcess');
5105: raise;
5106: end CreateForkProcess;
5107:
5108:
5182:
5183: -- Argument validation
5184: if (itemtype is null)
5185: or (itemkey is null) then
5186: Wf_Core.Token('COPY_ITEMTYPE', itemtype);
5187: Wf_Core.Token('COPY_ITEMKEY', copy_itemkey);
5188: Wf_Core.Token('NEW_ITEMKEY', itemkey);
5189: Wf_Core.Raise('WFSQL_ARGS');
5190: end if;
5183: -- Argument validation
5184: if (itemtype is null)
5185: or (itemkey is null) then
5186: Wf_Core.Token('COPY_ITEMTYPE', itemtype);
5187: Wf_Core.Token('COPY_ITEMKEY', copy_itemkey);
5188: Wf_Core.Token('NEW_ITEMKEY', itemkey);
5189: Wf_Core.Raise('WFSQL_ARGS');
5190: end if;
5191:
5184: if (itemtype is null)
5185: or (itemkey is null) then
5186: Wf_Core.Token('COPY_ITEMTYPE', itemtype);
5187: Wf_Core.Token('COPY_ITEMKEY', copy_itemkey);
5188: Wf_Core.Token('NEW_ITEMKEY', itemkey);
5189: Wf_Core.Raise('WFSQL_ARGS');
5190: end if;
5191:
5192:
5185: or (itemkey is null) then
5186: Wf_Core.Token('COPY_ITEMTYPE', itemtype);
5187: Wf_Core.Token('COPY_ITEMKEY', copy_itemkey);
5188: Wf_Core.Token('NEW_ITEMKEY', itemkey);
5189: Wf_Core.Raise('WFSQL_ARGS');
5190: end if;
5191:
5192:
5193: -- get the forked_from attribute: if it doesnt exist then this cannot be
5194: -- a forked item
5195: begin
5196: copy_itemkey := Wf_Engine.GetItemAttrText(itemtype, itemkey,'#FORKED_FROM');
5197: exception when others then
5198: Wf_Core.Raise('WF_NOFORK');
5199: end;
5200:
5201:
5202: -- Not allowed in synch mode
5201:
5202: -- Not allowed in synch mode
5203: if (itemkey = wf_engine.eng_synch)
5204: or (copy_itemkey = wf_engine.eng_synch) then
5205: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
5206: wf_core.raise('WFENG_SYNCH_DISABLED');
5207: end if;
5208:
5209:
5202: -- Not allowed in synch mode
5203: if (itemkey = wf_engine.eng_synch)
5204: or (copy_itemkey = wf_engine.eng_synch) then
5205: wf_core.token('OPERATION', 'Wf_Engine.SuspendProcess');
5206: wf_core.raise('WFENG_SYNCH_DISABLED');
5207: end if;
5208:
5209:
5210: -- Check item exists and store attributes while cached
5208:
5209:
5210: -- Check item exists and store attributes while cached
5211: if not (Wf_Item.Item_Exist(itemtype, copy_itemkey)) then
5212: Wf_Core.Token('TYPE', itemtype);
5213: Wf_Core.Token('KEY', copy_itemkey);
5214: Wf_Core.Raise('WFENG_ITEM');
5215: end if;
5216:
5209:
5210: -- Check item exists and store attributes while cached
5211: if not (Wf_Item.Item_Exist(itemtype, copy_itemkey)) then
5212: Wf_Core.Token('TYPE', itemtype);
5213: Wf_Core.Token('KEY', copy_itemkey);
5214: Wf_Core.Raise('WFENG_ITEM');
5215: end if;
5216:
5217: wf_item.Root_Process(itemtype => itemtype,
5210: -- Check item exists and store attributes while cached
5211: if not (Wf_Item.Item_Exist(itemtype, copy_itemkey)) then
5212: Wf_Core.Token('TYPE', itemtype);
5213: Wf_Core.Token('KEY', copy_itemkey);
5214: Wf_Core.Raise('WFENG_ITEM');
5215: end if;
5216:
5217: wf_item.Root_Process(itemtype => itemtype,
5218: itemkey => copy_itemkey,
5228:
5229:
5230: -- Check item exists
5231: if not (Wf_Item.Item_Exist(itemtype, itemkey)) then
5232: Wf_Core.Token('TYPE', itemtype);
5233: Wf_Core.Token('KEY', itemkey);
5234: Wf_Core.Raise('WFENG_ITEM');
5235: end if;
5236:
5229:
5230: -- Check item exists
5231: if not (Wf_Item.Item_Exist(itemtype, itemkey)) then
5232: Wf_Core.Token('TYPE', itemtype);
5233: Wf_Core.Token('KEY', itemkey);
5234: Wf_Core.Raise('WFENG_ITEM');
5235: end if;
5236:
5237: wf_item.Root_Process(itemtype => itemtype,
5230: -- Check item exists
5231: if not (Wf_Item.Item_Exist(itemtype, itemkey)) then
5232: Wf_Core.Token('TYPE', itemtype);
5233: Wf_Core.Token('KEY', itemkey);
5234: Wf_Core.Raise('WFENG_ITEM');
5235: end if;
5236:
5237: wf_item.Root_Process(itemtype => itemtype,
5238: itemkey => itemkey,
5253: or copy_active_date <> new_active_date then
5254: begin
5255: wf_engine.startprocess(itemtype,itemkey);
5256: exception when others then
5257: Wf_Core.raise('WF_CANNOT_FORK');
5258: end;
5259: return;
5260: end if;
5261:
5409:
5410:
5411: exception
5412: when others then
5413: Wf_Core.Context('Wf_Engine', 'StartForkProcess');
5414: raise;
5415: end StartForkProcess;
5416:
5417:
5437: actid pls_integer; -- activity instance id
5438: begin
5439: -- Not allowed in synch mode
5440: if (itemkey = wf_engine.eng_synch) then
5441: wf_core.token('OPERATION', 'Wf_Engine.BeginActivity');
5442: wf_core.raise('WFENG_SYNCH_DISABLED');
5443: end if;
5444:
5445: -- Argument validation
5438: begin
5439: -- Not allowed in synch mode
5440: if (itemkey = wf_engine.eng_synch) then
5441: wf_core.token('OPERATION', 'Wf_Engine.BeginActivity');
5442: wf_core.raise('WFENG_SYNCH_DISABLED');
5443: end if;
5444:
5445: -- Argument validation
5446: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5443: end if;
5444:
5445: -- Argument validation
5446: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5447: Wf_Core.Token('ITEMTYPE', itemtype);
5448: Wf_Core.Token('ITEMKEY', itemkey);
5449: Wf_Core.Token('ACTIVITY', activity);
5450: Wf_Core.Raise('WFSQL_ARGS');
5451: end if;
5444:
5445: -- Argument validation
5446: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5447: Wf_Core.Token('ITEMTYPE', itemtype);
5448: Wf_Core.Token('ITEMKEY', itemkey);
5449: Wf_Core.Token('ACTIVITY', activity);
5450: Wf_Core.Raise('WFSQL_ARGS');
5451: end if;
5452:
5445: -- Argument validation
5446: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5447: Wf_Core.Token('ITEMTYPE', itemtype);
5448: Wf_Core.Token('ITEMKEY', itemkey);
5449: Wf_Core.Token('ACTIVITY', activity);
5450: Wf_Core.Raise('WFSQL_ARGS');
5451: end if;
5452:
5453: -- Validate the activity and get the actid.
5446: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5447: Wf_Core.Token('ITEMTYPE', itemtype);
5448: Wf_Core.Token('ITEMKEY', itemkey);
5449: Wf_Core.Token('ACTIVITY', activity);
5450: Wf_Core.Raise('WFSQL_ARGS');
5451: end if;
5452:
5453: -- Validate the activity and get the actid.
5454: -- One of these conditions must hold:
5469: -- start activity as an argument to implicitly choose a root
5470: -- process when no selector function is defined.
5471: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey, activity);
5472: if (root is null) then
5473: Wf_Core.Token('TYPE', itemtype);
5474: Wf_Core.Token('KEY', itemkey);
5475: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
5476: end if;
5477:
5470: -- process when no selector function is defined.
5471: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey, activity);
5472: if (root is null) then
5473: Wf_Core.Token('TYPE', itemtype);
5474: Wf_Core.Token('KEY', itemkey);
5475: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
5476: end if;
5477:
5478: else
5471: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey, activity);
5472: if (root is null) then
5473: Wf_Core.Token('TYPE', itemtype);
5474: Wf_Core.Token('KEY', itemkey);
5475: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
5476: end if;
5477:
5478: else
5479: -- Item exists. Must be case (2).
5482: activity, wf_engine.eng_notified);
5483:
5484: -- Any other status, or no status at all, is an error.
5485: if (actid is null) then
5486: Wf_Core.Token('TYPE', itemtype);
5487: Wf_Core.Token('KEY', itemkey);
5488: Wf_Core.Token('NAME', activity);
5489: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5490: end if;
5483:
5484: -- Any other status, or no status at all, is an error.
5485: if (actid is null) then
5486: Wf_Core.Token('TYPE', itemtype);
5487: Wf_Core.Token('KEY', itemkey);
5488: Wf_Core.Token('NAME', activity);
5489: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5490: end if;
5491:
5484: -- Any other status, or no status at all, is an error.
5485: if (actid is null) then
5486: Wf_Core.Token('TYPE', itemtype);
5487: Wf_Core.Token('KEY', itemkey);
5488: Wf_Core.Token('NAME', activity);
5489: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5490: end if;
5491:
5492: end if;
5485: if (actid is null) then
5486: Wf_Core.Token('TYPE', itemtype);
5487: Wf_Core.Token('KEY', itemkey);
5488: Wf_Core.Token('NAME', activity);
5489: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5490: end if;
5491:
5492: end if;
5493: exception
5491:
5492: end if;
5493: exception
5494: when others then
5495: Wf_Core.Context('Wf_Engine', 'BeginActivity', itemtype, itemkey, activity);
5496: raise;
5497: end BeginActivity;
5498:
5499: --
5535: l_lock boolean;
5536: begin
5537: -- Argument validation
5538: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5539: Wf_Core.Token('ITEMTYPE', itemtype);
5540: Wf_Core.Token('ITEMKEY', itemkey);
5541: Wf_Core.Token('ACTIVITY', activity);
5542: Wf_Core.Raise('WFSQL_ARGS');
5543: end if;
5536: begin
5537: -- Argument validation
5538: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5539: Wf_Core.Token('ITEMTYPE', itemtype);
5540: Wf_Core.Token('ITEMKEY', itemkey);
5541: Wf_Core.Token('ACTIVITY', activity);
5542: Wf_Core.Raise('WFSQL_ARGS');
5543: end if;
5544:
5537: -- Argument validation
5538: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5539: Wf_Core.Token('ITEMTYPE', itemtype);
5540: Wf_Core.Token('ITEMKEY', itemkey);
5541: Wf_Core.Token('ACTIVITY', activity);
5542: Wf_Core.Raise('WFSQL_ARGS');
5543: end if;
5544:
5545: if (WF_CACHE.MetaRefreshed) then
5538: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5539: Wf_Core.Token('ITEMTYPE', itemtype);
5540: Wf_Core.Token('ITEMKEY', itemkey);
5541: Wf_Core.Token('ACTIVITY', activity);
5542: Wf_Core.Raise('WFSQL_ARGS');
5543: end if;
5544:
5545: if (WF_CACHE.MetaRefreshed) then
5546: null;
5566: -- start activity as an argument to implicitly choose a root
5567: -- process when no selector function is defined.
5568: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey, activity);
5569: if (root is null) then
5570: Wf_Core.Token('TYPE', itemtype);
5571: Wf_Core.Token('KEY', itemkey);
5572: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
5573: end if;
5574:
5567: -- process when no selector function is defined.
5568: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey, activity);
5569: if (root is null) then
5570: Wf_Core.Token('TYPE', itemtype);
5571: Wf_Core.Token('KEY', itemkey);
5572: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
5573: end if;
5574:
5575: -- Create new process
5568: root := Wf_Engine_Util.Get_Root_Process(itemtype, itemkey, activity);
5569: if (root is null) then
5570: Wf_Core.Token('TYPE', itemtype);
5571: Wf_Core.Token('KEY', itemkey);
5572: Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
5573: end if;
5574:
5575: -- Create new process
5576: Wf_Engine.CreateProcess(itemtype, itemkey, root);
5607: activity, wf_engine.eng_notified);
5608:
5609: -- Any other status, or no status at all, is an error.
5610: if (actid is null) then
5611: Wf_Core.Token('TYPE', itemtype);
5612: Wf_Core.Token('KEY', itemkey);
5613: Wf_Core.Token('NAME', activity);
5614: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5615: end if;
5608:
5609: -- Any other status, or no status at all, is an error.
5610: if (actid is null) then
5611: Wf_Core.Token('TYPE', itemtype);
5612: Wf_Core.Token('KEY', itemkey);
5613: Wf_Core.Token('NAME', activity);
5614: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5615: end if;
5616:
5609: -- Any other status, or no status at all, is an error.
5610: if (actid is null) then
5611: Wf_Core.Token('TYPE', itemtype);
5612: Wf_Core.Token('KEY', itemkey);
5613: Wf_Core.Token('NAME', activity);
5614: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5615: end if;
5616:
5617: --If acquire lock returns true we will continue
5610: if (actid is null) then
5611: Wf_Core.Token('TYPE', itemtype);
5612: Wf_Core.Token('KEY', itemkey);
5613: Wf_Core.Token('NAME', activity);
5614: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5615: end if;
5616:
5617: --If acquire lock returns true we will continue
5618: --If it returns false we raise exception to the user
5666: -- 2. set this activity to error status
5667: -- 3. execute the error process (if any)
5668: -- 4. clear the error to continue with next activity
5669: rollback to wf_savepoint;
5670: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,
5671: activity, result);
5672: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
5673: wf_engine.eng_exception, FALSE);
5674: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
5672: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
5673: wf_engine.eng_exception, FALSE);
5674: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
5675: wf_engine.eng_exception);
5676: Wf_Core.Clear;
5677: end;
5678: end if;
5679:
5680: exception
5678: end if;
5679:
5680: exception
5681: when resource_busy then
5682: wf_core.token('TYPE',itemtype);
5683: wf_core.token('KEY',itemkey);
5684: wf_core.raise('WFENG_RESOURCE_BUSY');
5685: when others then
5686: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,
5679:
5680: exception
5681: when resource_busy then
5682: wf_core.token('TYPE',itemtype);
5683: wf_core.token('KEY',itemkey);
5684: wf_core.raise('WFENG_RESOURCE_BUSY');
5685: when others then
5686: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,
5687: activity, result);
5680: exception
5681: when resource_busy then
5682: wf_core.token('TYPE',itemtype);
5683: wf_core.token('KEY',itemkey);
5684: wf_core.raise('WFENG_RESOURCE_BUSY');
5685: when others then
5686: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,
5687: activity, result);
5688: raise;
5682: wf_core.token('TYPE',itemtype);
5683: wf_core.token('KEY',itemkey);
5684: wf_core.raise('WFENG_RESOURCE_BUSY');
5685: when others then
5686: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,
5687: activity, result);
5688: raise;
5689: end CompleteActivity;
5690:
5719: label varchar2(30);
5720: begin
5721: -- Not allowed in synch mode
5722: if (itemkey = wf_engine.eng_synch) then
5723: wf_core.token('OPERATION', 'Wf_Engine.CompleteActivityInternalName');
5724: wf_core.raise('WFENG_SYNCH_DISABLED');
5725: end if;
5726:
5727: -- Argument validation
5720: begin
5721: -- Not allowed in synch mode
5722: if (itemkey = wf_engine.eng_synch) then
5723: wf_core.token('OPERATION', 'Wf_Engine.CompleteActivityInternalName');
5724: wf_core.raise('WFENG_SYNCH_DISABLED');
5725: end if;
5726:
5727: -- Argument validation
5728: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5725: end if;
5726:
5727: -- Argument validation
5728: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5729: Wf_Core.Token('ITEMTYPE', itemtype);
5730: Wf_Core.Token('ITEMKEY', itemkey);
5731: Wf_Core.Token('ACTIVITY', activity);
5732: Wf_Core.Raise('WFSQL_ARGS');
5733: end if;
5726:
5727: -- Argument validation
5728: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5729: Wf_Core.Token('ITEMTYPE', itemtype);
5730: Wf_Core.Token('ITEMKEY', itemkey);
5731: Wf_Core.Token('ACTIVITY', activity);
5732: Wf_Core.Raise('WFSQL_ARGS');
5733: end if;
5734:
5727: -- Argument validation
5728: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5729: Wf_Core.Token('ITEMTYPE', itemtype);
5730: Wf_Core.Token('ITEMKEY', itemkey);
5731: Wf_Core.Token('ACTIVITY', activity);
5732: Wf_Core.Raise('WFSQL_ARGS');
5733: end if;
5734:
5735: -- Parse activity arg into
5728: if ((itemtype is null) or (itemkey is null) or (activity is null)) then
5729: Wf_Core.Token('ITEMTYPE', itemtype);
5730: Wf_Core.Token('ITEMKEY', itemkey);
5731: Wf_Core.Token('ACTIVITY', activity);
5732: Wf_Core.Raise('WFSQL_ARGS');
5733: end if;
5734:
5735: -- Parse activity arg into
5736: colon := instr(activity, ':');
5756: and WPA.ACTIVITY_NAME = actname
5757: and WPA.PROCESS_NAME = nvl(process, WPA.PROCESS_NAME);
5758: exception
5759: when no_data_found then
5760: Wf_Core.Token('TYPE', itemtype);
5761: Wf_Core.Token('KEY', itemkey);
5762: Wf_Core.Token('NAME', activity);
5763: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5764: end;
5757: and WPA.PROCESS_NAME = nvl(process, WPA.PROCESS_NAME);
5758: exception
5759: when no_data_found then
5760: Wf_Core.Token('TYPE', itemtype);
5761: Wf_Core.Token('KEY', itemkey);
5762: Wf_Core.Token('NAME', activity);
5763: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5764: end;
5765:
5758: exception
5759: when no_data_found then
5760: Wf_Core.Token('TYPE', itemtype);
5761: Wf_Core.Token('KEY', itemkey);
5762: Wf_Core.Token('NAME', activity);
5763: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5764: end;
5765:
5766: -- Complete activity with the correct arguments
5759: when no_data_found then
5760: Wf_Core.Token('TYPE', itemtype);
5761: Wf_Core.Token('KEY', itemkey);
5762: Wf_Core.Token('NAME', activity);
5763: Wf_Core.Raise('WFENG_NOT_NOTIFIED');
5764: end;
5765:
5766: -- Complete activity with the correct arguments
5767: Wf_Engine.CompleteActivity(itemtype, itemkey, process||':'||label,
5768: result);
5769:
5770: exception
5771: when others then
5772: Wf_Core.Context('Wf_Engine', 'CompleteActivityInternalName',
5773: itemtype, itemkey, activity, result);
5774: raise;
5775: end CompleteActivityInternalName;
5776:
5809: expand_role varchar2(1);
5810: begin
5811: -- Not allowed in synch mode
5812: if (itemkey = wf_engine.eng_synch) then
5813: wf_core.token('OPERATION', 'Wf_Engine.AssignActivity');
5814: wf_core.raise('WFENG_SYNCH_DISABLED');
5815: end if;
5816:
5817: -- Argument validation
5810: begin
5811: -- Not allowed in synch mode
5812: if (itemkey = wf_engine.eng_synch) then
5813: wf_core.token('OPERATION', 'Wf_Engine.AssignActivity');
5814: wf_core.raise('WFENG_SYNCH_DISABLED');
5815: end if;
5816:
5817: -- Argument validation
5818: if ((itemtype is null) or (itemkey is null) or (activity is null) or
5816:
5817: -- Argument validation
5818: if ((itemtype is null) or (itemkey is null) or (activity is null) or
5819: (performer is null)) then
5820: Wf_Core.Token('ITEMTYPE', itemtype);
5821: Wf_Core.Token('ITEMKEY', itemkey);
5822: Wf_Core.Token('ACTIVITY', activity);
5823: Wf_Core.Token('PERFORMER', performer);
5824: Wf_Core.Raise('WFSQL_ARGS');
5817: -- Argument validation
5818: if ((itemtype is null) or (itemkey is null) or (activity is null) or
5819: (performer is null)) then
5820: Wf_Core.Token('ITEMTYPE', itemtype);
5821: Wf_Core.Token('ITEMKEY', itemkey);
5822: Wf_Core.Token('ACTIVITY', activity);
5823: Wf_Core.Token('PERFORMER', performer);
5824: Wf_Core.Raise('WFSQL_ARGS');
5825: end if;
5818: if ((itemtype is null) or (itemkey is null) or (activity is null) or
5819: (performer is null)) then
5820: Wf_Core.Token('ITEMTYPE', itemtype);
5821: Wf_Core.Token('ITEMKEY', itemkey);
5822: Wf_Core.Token('ACTIVITY', activity);
5823: Wf_Core.Token('PERFORMER', performer);
5824: Wf_Core.Raise('WFSQL_ARGS');
5825: end if;
5826:
5819: (performer is null)) then
5820: Wf_Core.Token('ITEMTYPE', itemtype);
5821: Wf_Core.Token('ITEMKEY', itemkey);
5822: Wf_Core.Token('ACTIVITY', activity);
5823: Wf_Core.Token('PERFORMER', performer);
5824: Wf_Core.Raise('WFSQL_ARGS');
5825: end if;
5826:
5827: -- Get the root process for this key, and check that the item
5820: Wf_Core.Token('ITEMTYPE', itemtype);
5821: Wf_Core.Token('ITEMKEY', itemkey);
5822: Wf_Core.Token('ACTIVITY', activity);
5823: Wf_Core.Token('PERFORMER', performer);
5824: Wf_Core.Raise('WFSQL_ARGS');
5825: end if;
5826:
5827: -- Get the root process for this key, and check that the item
5828: -- has been created.
5827: -- Get the root process for this key, and check that the item
5828: -- has been created.
5829: Wf_Item.Root_Process(itemtype, itemkey, root, version);
5830: if (root is null) then
5831: Wf_Core.Token('TYPE', itemtype);
5832: Wf_Core.Token('KEY', itemkey);
5833: Wf_Core.Raise('WFENG_ITEM');
5834: end if;
5835:
5828: -- has been created.
5829: Wf_Item.Root_Process(itemtype, itemkey, root, version);
5830: if (root is null) then
5831: Wf_Core.Token('TYPE', itemtype);
5832: Wf_Core.Token('KEY', itemkey);
5833: Wf_Core.Raise('WFENG_ITEM');
5834: end if;
5835:
5836: -- Get the root process actid.
5829: Wf_Item.Root_Process(itemtype, itemkey, root, version);
5830: if (root is null) then
5831: Wf_Core.Token('TYPE', itemtype);
5832: Wf_Core.Token('KEY', itemkey);
5833: Wf_Core.Raise('WFENG_ITEM');
5834: end if;
5835:
5836: -- Get the root process actid.
5837: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
5835:
5836: -- Get the root process actid.
5837: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
5838: if (rootid is null) then
5839: Wf_Core.Token('TYPE', itemtype);
5840: Wf_Core.Token('KEY', itemkey);
5841: Wf_Core.Token('NAME', root);
5842: Wf_Core.Raise('WFENG_ITEM_ROOT');
5843: end if;
5836: -- Get the root process actid.
5837: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
5838: if (rootid is null) then
5839: Wf_Core.Token('TYPE', itemtype);
5840: Wf_Core.Token('KEY', itemkey);
5841: Wf_Core.Token('NAME', root);
5842: Wf_Core.Raise('WFENG_ITEM_ROOT');
5843: end if;
5844:
5837: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
5838: if (rootid is null) then
5839: Wf_Core.Token('TYPE', itemtype);
5840: Wf_Core.Token('KEY', itemkey);
5841: Wf_Core.Token('NAME', root);
5842: Wf_Core.Raise('WFENG_ITEM_ROOT');
5843: end if;
5844:
5845: -- Get the actid and check that this is a valid activity in the
5838: if (rootid is null) then
5839: Wf_Core.Token('TYPE', itemtype);
5840: Wf_Core.Token('KEY', itemkey);
5841: Wf_Core.Token('NAME', root);
5842: Wf_Core.Raise('WFENG_ITEM_ROOT');
5843: end if;
5844:
5845: -- Get the actid and check that this is a valid activity in the
5846: -- root process
5846: -- root process
5847: actdate := Wf_Item.Active_Date(itemtype, itemkey);
5848: actid := Wf_Process_Activity.FindActivity(rootid, activity, actdate);
5849: if (actid is null) then
5850: Wf_Core.Token('TYPE', itemtype);
5851: Wf_Core.Token('KEY', itemkey);
5852: Wf_Core.Token('NAME', activity);
5853: Wf_Core.Raise('WFENG_ITEM_ACTIVITY');
5854: end if;
5847: actdate := Wf_Item.Active_Date(itemtype, itemkey);
5848: actid := Wf_Process_Activity.FindActivity(rootid, activity, actdate);
5849: if (actid is null) then
5850: Wf_Core.Token('TYPE', itemtype);
5851: Wf_Core.Token('KEY', itemkey);
5852: Wf_Core.Token('NAME', activity);
5853: Wf_Core.Raise('WFENG_ITEM_ACTIVITY');
5854: end if;
5855:
5848: actid := Wf_Process_Activity.FindActivity(rootid, activity, actdate);
5849: if (actid is null) then
5850: Wf_Core.Token('TYPE', itemtype);
5851: Wf_Core.Token('KEY', itemkey);
5852: Wf_Core.Token('NAME', activity);
5853: Wf_Core.Raise('WFENG_ITEM_ACTIVITY');
5854: end if;
5855:
5856: -- Check if this activity is a notification type of activity
5849: if (actid is null) then
5850: Wf_Core.Token('TYPE', itemtype);
5851: Wf_Core.Token('KEY', itemkey);
5852: Wf_Core.Token('NAME', activity);
5853: Wf_Core.Raise('WFENG_ITEM_ACTIVITY');
5854: end if;
5855:
5856: -- Check if this activity is a notification type of activity
5857: acttype := Wf_Activity.Type(itemtype, activity, actdate);
5855:
5856: -- Check if this activity is a notification type of activity
5857: acttype := Wf_Activity.Type(itemtype, activity, actdate);
5858: if (acttype <> wf_engine.eng_notification) then
5859: Wf_Core.Token('NAME', activity);
5860: Wf_Core.Raise('WFENG_NOTIFICATION_NAME');
5861: end if;
5862:
5863: -- Check if the activity is active
5856: -- Check if this activity is a notification type of activity
5857: acttype := Wf_Activity.Type(itemtype, activity, actdate);
5858: if (acttype <> wf_engine.eng_notification) then
5859: Wf_Core.Token('NAME', activity);
5860: Wf_Core.Raise('WFENG_NOTIFICATION_NAME');
5861: end if;
5862:
5863: -- Check if the activity is active
5864: Wf_Item_Activity_Status.Status(itemtype, itemkey, actid, status);
5877: -- Voting activities cannot be re-assigned.
5878: Wf_Activity.Notification_Info(itemtype, itemkey, actid, msg, msgtype,
5879: expand_role);
5880: if (expand_role = 'Y') then
5881: Wf_Core.Token('NAME', activity);
5882: Wf_Core.Raise('WFENG_VOTE_REASSIGN');
5883: end if;
5884:
5885: -- Get notification id
5878: Wf_Activity.Notification_Info(itemtype, itemkey, actid, msg, msgtype,
5879: expand_role);
5880: if (expand_role = 'Y') then
5881: Wf_Core.Token('NAME', activity);
5882: Wf_Core.Raise('WFENG_VOTE_REASSIGN');
5883: end if;
5884:
5885: -- Get notification id
5886: Wf_Item_Activity_Status.Notification_Status(itemtype, itemkey, actid,
5902: end if;
5903: else
5904: -- Activity must be complete (all other statuses are not valid
5905: -- for a notification).
5906: Wf_Core.Token('ACTIVITY', activity);
5907: Wf_Core.Token('TYPE', itemtype);
5908: Wf_Core.Token('KEY', itemkey);
5909: Wf_Core.Raise('WFENG_ITEM_ACTIVITY_COMPLETE');
5910: end if;
5903: else
5904: -- Activity must be complete (all other statuses are not valid
5905: -- for a notification).
5906: Wf_Core.Token('ACTIVITY', activity);
5907: Wf_Core.Token('TYPE', itemtype);
5908: Wf_Core.Token('KEY', itemkey);
5909: Wf_Core.Raise('WFENG_ITEM_ACTIVITY_COMPLETE');
5910: end if;
5911:
5904: -- Activity must be complete (all other statuses are not valid
5905: -- for a notification).
5906: Wf_Core.Token('ACTIVITY', activity);
5907: Wf_Core.Token('TYPE', itemtype);
5908: Wf_Core.Token('KEY', itemkey);
5909: Wf_Core.Raise('WFENG_ITEM_ACTIVITY_COMPLETE');
5910: end if;
5911:
5912: EXCEPTION
5905: -- for a notification).
5906: Wf_Core.Token('ACTIVITY', activity);
5907: Wf_Core.Token('TYPE', itemtype);
5908: Wf_Core.Token('KEY', itemkey);
5909: Wf_Core.Raise('WFENG_ITEM_ACTIVITY_COMPLETE');
5910: end if;
5911:
5912: EXCEPTION
5913: when OTHERS then
5910: end if;
5911:
5912: EXCEPTION
5913: when OTHERS then
5914: Wf_Core.Context('Wf_Engine', 'AssignActivity', itemtype, itemkey,
5915: activity, performer);
5916: raise;
5917: end AssignActivity;
5918:
5971: -- to active, AND resets or creates status rows for any parent process
5972: -- to active if necessary.
5973: if (not Wf_Engine_Util.Reset_Tree(itemtype, itemkey, rootid,
5974: actid, actdate)) then
5975: Wf_Core.Token('TYPE', itemtype);
5976: Wf_Core.Token('KEY', itemkey);
5977: Wf_Core.Token('NAME', activity);
5978: Wf_Core.Raise('WFENG_ITEM_ACTIVITY');
5979: end if;
5972: -- to active if necessary.
5973: if (not Wf_Engine_Util.Reset_Tree(itemtype, itemkey, rootid,
5974: actid, actdate)) then
5975: Wf_Core.Token('TYPE', itemtype);
5976: Wf_Core.Token('KEY', itemkey);
5977: Wf_Core.Token('NAME', activity);
5978: Wf_Core.Raise('WFENG_ITEM_ACTIVITY');
5979: end if;
5980:
5973: if (not Wf_Engine_Util.Reset_Tree(itemtype, itemkey, rootid,
5974: actid, actdate)) then
5975: Wf_Core.Token('TYPE', itemtype);
5976: Wf_Core.Token('KEY', itemkey);
5977: Wf_Core.Token('NAME', activity);
5978: Wf_Core.Raise('WFENG_ITEM_ACTIVITY');
5979: end if;
5980:
5981: if (command = wf_engine.eng_skip) then
5974: actid, actdate)) then
5975: Wf_Core.Token('TYPE', itemtype);
5976: Wf_Core.Token('KEY', itemkey);
5977: Wf_Core.Token('NAME', activity);
5978: Wf_Core.Raise('WFENG_ITEM_ACTIVITY');
5979: end if;
5980:
5981: if (command = wf_engine.eng_skip) then
5982: -- *** SKIP ***
5993: resultout);
5994:
5995: -- Check if skip is allowed on this activity
5996: if (resultout = wf_engine.eng_noskip) then
5997: Wf_Core.Token('LABEL', Wf_Engine.GetActivityLabel(actid));
5998: Wf_Core.Raise('WFENG_NOSKIP');
5999: end if;
6000: end if;-- 6636968>
6001:
5994:
5995: -- Check if skip is allowed on this activity
5996: if (resultout = wf_engine.eng_noskip) then
5997: Wf_Core.Token('LABEL', Wf_Engine.GetActivityLabel(actid));
5998: Wf_Core.Raise('WFENG_NOSKIP');
5999: end if;
6000: end if;-- 6636968>
6001:
6002: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result, FALSE);
6007: -- no fancy error processing for you! Try running directly.
6008: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid,
6009: result, FALSE);
6010: when others then
6011: if (Wf_Core.Error_Name = 'WFENG_NOSKIP') then
6012: -- No processing. Raise to the caller that the activity cannot be skipped.
6013: raise;
6014: else
6015: -- If anything in this process raises an exception:
6017: -- 2. set this activity to error status
6018: -- 3. execute the error process (if any)
6019: -- 4. clear the error to continue with next activity
6020: rollback to wf_savepoint;
6021: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal', itemtype, itemkey,
6022: activity, command, result);
6023: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6024: wf_engine.eng_exception, FALSE);
6025: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6023: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6024: wf_engine.eng_exception, FALSE);
6025: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6026: wf_engine.eng_exception);
6027: Wf_Core.Clear;
6028: end if;
6029: end;
6030: --We will raise the skip event here .
6031: event_name := 'oracle.apps.wf.engine.skip';
6054: -- 2. set this activity to error status
6055: -- 3. execute the error process (if any)
6056: -- 4. clear the error to continue with next activity
6057: rollback to wf_savepoint;
6058: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal',itemtype,itemkey,
6059: activity, command, result);
6060: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6061: wf_engine.eng_exception, FALSE);
6062: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6060: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6061: wf_engine.eng_exception, FALSE);
6062: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6063: wf_engine.eng_exception);
6064: Wf_Core.Clear;
6065: end;
6066: end if;
6067: event_name := 'oracle.apps.wf.engine.retry';
6068: end if;
6085: p_parameters => l_parameterlist);
6086:
6087: exception
6088: when others then
6089: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal', itemtype, itemkey,
6090: activity, command, result);
6091: raise;
6092: end HandleErrorInternal;
6093:
6123: pragma exception_init(dist_savepoint, -02074);
6124: begin
6125: -- Not allowed in synch mode
6126: if (itemkey = wf_engine.eng_synch) then
6127: wf_core.token('OPERATION', 'Wf_Engine.HandleError');
6128: wf_core.raise('WFENG_SYNCH_DISABLED');
6129: end if;
6130:
6131: -- Argument validation
6124: begin
6125: -- Not allowed in synch mode
6126: if (itemkey = wf_engine.eng_synch) then
6127: wf_core.token('OPERATION', 'Wf_Engine.HandleError');
6128: wf_core.raise('WFENG_SYNCH_DISABLED');
6129: end if;
6130:
6131: -- Argument validation
6132: if ((itemtype is null) or (itemkey is null) or (activity is null) or
6130:
6131: -- Argument validation
6132: if ((itemtype is null) or (itemkey is null) or (activity is null) or
6133: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry))) then
6134: Wf_Core.Token('ITEMTYPE', itemtype);
6135: Wf_Core.Token('ITEMKEY', itemkey);
6136: Wf_Core.Token('ACTIVITY', activity);
6137: Wf_Core.Token('COMMAND', command);
6138: Wf_Core.Raise('WFSQL_ARGS');
6131: -- Argument validation
6132: if ((itemtype is null) or (itemkey is null) or (activity is null) or
6133: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry))) then
6134: Wf_Core.Token('ITEMTYPE', itemtype);
6135: Wf_Core.Token('ITEMKEY', itemkey);
6136: Wf_Core.Token('ACTIVITY', activity);
6137: Wf_Core.Token('COMMAND', command);
6138: Wf_Core.Raise('WFSQL_ARGS');
6139: end if;
6132: if ((itemtype is null) or (itemkey is null) or (activity is null) or
6133: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry))) then
6134: Wf_Core.Token('ITEMTYPE', itemtype);
6135: Wf_Core.Token('ITEMKEY', itemkey);
6136: Wf_Core.Token('ACTIVITY', activity);
6137: Wf_Core.Token('COMMAND', command);
6138: Wf_Core.Raise('WFSQL_ARGS');
6139: end if;
6140:
6133: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry))) then
6134: Wf_Core.Token('ITEMTYPE', itemtype);
6135: Wf_Core.Token('ITEMKEY', itemkey);
6136: Wf_Core.Token('ACTIVITY', activity);
6137: Wf_Core.Token('COMMAND', command);
6138: Wf_Core.Raise('WFSQL_ARGS');
6139: end if;
6140:
6141: -- If we are in a different Fwk session, need to clear Workflow PLSQL state
6134: Wf_Core.Token('ITEMTYPE', itemtype);
6135: Wf_Core.Token('ITEMKEY', itemkey);
6136: Wf_Core.Token('ACTIVITY', activity);
6137: Wf_Core.Token('COMMAND', command);
6138: Wf_Core.Raise('WFSQL_ARGS');
6139: end if;
6140:
6141: -- If we are in a different Fwk session, need to clear Workflow PLSQL state
6142: if (not Wfa_Sec.CheckSession) then
6145:
6146: -- Make sure item is valid
6147: Wf_Item.Root_Process(itemtype, itemkey, root, version);
6148: if (root is null) then
6149: Wf_Core.Token('TYPE', itemtype);
6150: Wf_Core.Token('KEY', itemkey);
6151: Wf_Core.Raise('WFENG_ITEM');
6152: end if;
6153: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
6146: -- Make sure item is valid
6147: Wf_Item.Root_Process(itemtype, itemkey, root, version);
6148: if (root is null) then
6149: Wf_Core.Token('TYPE', itemtype);
6150: Wf_Core.Token('KEY', itemkey);
6151: Wf_Core.Raise('WFENG_ITEM');
6152: end if;
6153: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
6154: if (rootid is null) then
6147: Wf_Item.Root_Process(itemtype, itemkey, root, version);
6148: if (root is null) then
6149: Wf_Core.Token('TYPE', itemtype);
6150: Wf_Core.Token('KEY', itemkey);
6151: Wf_Core.Raise('WFENG_ITEM');
6152: end if;
6153: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
6154: if (rootid is null) then
6155: Wf_Core.Token('TYPE', itemtype);
6151: Wf_Core.Raise('WFENG_ITEM');
6152: end if;
6153: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
6154: if (rootid is null) then
6155: Wf_Core.Token('TYPE', itemtype);
6156: Wf_Core.Token('KEY', itemkey);
6157: Wf_Core.Token('NAME', root);
6158: Wf_Core.Raise('WFENG_ITEM_ROOT');
6159: end if;
6152: end if;
6153: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
6154: if (rootid is null) then
6155: Wf_Core.Token('TYPE', itemtype);
6156: Wf_Core.Token('KEY', itemkey);
6157: Wf_Core.Token('NAME', root);
6158: Wf_Core.Raise('WFENG_ITEM_ROOT');
6159: end if;
6160:
6153: rootid := Wf_Process_Activity.RootInstanceId(itemtype, itemkey, root);
6154: if (rootid is null) then
6155: Wf_Core.Token('TYPE', itemtype);
6156: Wf_Core.Token('KEY', itemkey);
6157: Wf_Core.Token('NAME', root);
6158: Wf_Core.Raise('WFENG_ITEM_ROOT');
6159: end if;
6160:
6161: -- Look for the activity instance for this item
6154: if (rootid is null) then
6155: Wf_Core.Token('TYPE', itemtype);
6156: Wf_Core.Token('KEY', itemkey);
6157: Wf_Core.Token('NAME', root);
6158: Wf_Core.Raise('WFENG_ITEM_ROOT');
6159: end if;
6160:
6161: -- Look for the activity instance for this item
6162: actdate := Wf_Item.Active_Date(itemtype, itemkey);
6162: actdate := Wf_Item.Active_Date(itemtype, itemkey);
6163: actid := Wf_Process_Activity.FindActivity(rootid, activity, actdate);
6164:
6165: if (actid is null) then
6166: Wf_Core.Token('TYPE', itemtype);
6167: Wf_Core.Token('PROCESS', root);
6168: Wf_Core.Token('NAME', activity);
6169: Wf_Core.Raise('WFENG_ACTIVITY_EXIST');
6170: end if;
6163: actid := Wf_Process_Activity.FindActivity(rootid, activity, actdate);
6164:
6165: if (actid is null) then
6166: Wf_Core.Token('TYPE', itemtype);
6167: Wf_Core.Token('PROCESS', root);
6168: Wf_Core.Token('NAME', activity);
6169: Wf_Core.Raise('WFENG_ACTIVITY_EXIST');
6170: end if;
6171:
6164:
6165: if (actid is null) then
6166: Wf_Core.Token('TYPE', itemtype);
6167: Wf_Core.Token('PROCESS', root);
6168: Wf_Core.Token('NAME', activity);
6169: Wf_Core.Raise('WFENG_ACTIVITY_EXIST');
6170: end if;
6171:
6172: if (WF_CACHE.MetaRefreshed) then
6165: if (actid is null) then
6166: Wf_Core.Token('TYPE', itemtype);
6167: Wf_Core.Token('PROCESS', root);
6168: Wf_Core.Token('NAME', activity);
6169: Wf_Core.Raise('WFENG_ACTIVITY_EXIST');
6170: end if;
6171:
6172: if (WF_CACHE.MetaRefreshed) then
6173: null;
6178: HandleErrorInternal(itemtype, itemkey, root, rootid, activity, actid,
6179: actdate, upper(command), result);
6180: exception
6181: when others then
6182: Wf_Core.Context('Wf_Engine', 'HandleError', itemtype, itemkey, activity,
6183: command, result);
6184: raise;
6185: end HandleError;
6186:
6228:
6229: begin
6230: --Check arguments.
6231: if (itemtype is null) then
6232: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
6233: Wf_Core.Raise('WFSQL_ARGS');
6234: end if;
6235:
6236: if (WF_CACHE.MetaRefreshed) then
6229: begin
6230: --Check arguments.
6231: if (itemtype is null) then
6232: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
6233: Wf_Core.Raise('WFSQL_ARGS');
6234: end if;
6235:
6236: if (WF_CACHE.MetaRefreshed) then
6237: null;
6254: end if;
6255:
6256: -- Not allowed in synch mode
6257: if (c_item_key = wf_engine.eng_synch) then
6258: wf_core.token('OPERATION', 'Wf_Engine.HandleErrorAll');
6259: wf_core.raise('WFENG_SYNCH_DISABLED');
6260: end if;
6261:
6262: -- Argument validation
6255:
6256: -- Not allowed in synch mode
6257: if (c_item_key = wf_engine.eng_synch) then
6258: wf_core.token('OPERATION', 'Wf_Engine.HandleErrorAll');
6259: wf_core.raise('WFENG_SYNCH_DISABLED');
6260: end if;
6261:
6262: -- Argument validation
6263: if ((itemtype is null) or (c_item_key is null) or (c_activity is null) or
6262: -- Argument validation
6263: if ((itemtype is null) or (c_item_key is null) or (c_activity is null) or
6264: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry)))
6265: then
6266: Wf_Core.Token('ITEMTYPE', itemtype);
6267: Wf_Core.Token('ITEMKEY', c_item_key);
6268: Wf_Core.Token('ACTIVITY', c_activity);
6269: Wf_Core.Token('COMMAND', command);
6270: Wf_Core.Raise('WFSQL_ARGS');
6263: if ((itemtype is null) or (c_item_key is null) or (c_activity is null) or
6264: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry)))
6265: then
6266: Wf_Core.Token('ITEMTYPE', itemtype);
6267: Wf_Core.Token('ITEMKEY', c_item_key);
6268: Wf_Core.Token('ACTIVITY', c_activity);
6269: Wf_Core.Token('COMMAND', command);
6270: Wf_Core.Raise('WFSQL_ARGS');
6271: end if;
6264: (upper(command) not in (wf_engine.eng_skip, wf_engine.eng_retry)))
6265: then
6266: Wf_Core.Token('ITEMTYPE', itemtype);
6267: Wf_Core.Token('ITEMKEY', c_item_key);
6268: Wf_Core.Token('ACTIVITY', c_activity);
6269: Wf_Core.Token('COMMAND', command);
6270: Wf_Core.Raise('WFSQL_ARGS');
6271: end if;
6272:
6265: then
6266: Wf_Core.Token('ITEMTYPE', itemtype);
6267: Wf_Core.Token('ITEMKEY', c_item_key);
6268: Wf_Core.Token('ACTIVITY', c_activity);
6269: Wf_Core.Token('COMMAND', command);
6270: Wf_Core.Raise('WFSQL_ARGS');
6271: end if;
6272:
6273: -- Make sure item is valid
6266: Wf_Core.Token('ITEMTYPE', itemtype);
6267: Wf_Core.Token('ITEMKEY', c_item_key);
6268: Wf_Core.Token('ACTIVITY', c_activity);
6269: Wf_Core.Token('COMMAND', command);
6270: Wf_Core.Raise('WFSQL_ARGS');
6271: end if;
6272:
6273: -- Make sure item is valid
6274: Wf_Item.Root_Process(itemtype, c_item_key, root, version);
6272:
6273: -- Make sure item is valid
6274: Wf_Item.Root_Process(itemtype, c_item_key, root, version);
6275: if (root is null) then
6276: Wf_Core.Token('TYPE', itemtype);
6277: Wf_Core.Token('KEY', c_item_key);
6278: Wf_Core.Raise('WFENG_ITEM');
6279: end if;
6280: rootid := Wf_Process_Activity.RootInstanceId(itemtype, c_item_key, root);
6273: -- Make sure item is valid
6274: Wf_Item.Root_Process(itemtype, c_item_key, root, version);
6275: if (root is null) then
6276: Wf_Core.Token('TYPE', itemtype);
6277: Wf_Core.Token('KEY', c_item_key);
6278: Wf_Core.Raise('WFENG_ITEM');
6279: end if;
6280: rootid := Wf_Process_Activity.RootInstanceId(itemtype, c_item_key, root);
6281: if (rootid is null) then
6274: Wf_Item.Root_Process(itemtype, c_item_key, root, version);
6275: if (root is null) then
6276: Wf_Core.Token('TYPE', itemtype);
6277: Wf_Core.Token('KEY', c_item_key);
6278: Wf_Core.Raise('WFENG_ITEM');
6279: end if;
6280: rootid := Wf_Process_Activity.RootInstanceId(itemtype, c_item_key, root);
6281: if (rootid is null) then
6282: Wf_Core.Token('TYPE', itemtype);
6278: Wf_Core.Raise('WFENG_ITEM');
6279: end if;
6280: rootid := Wf_Process_Activity.RootInstanceId(itemtype, c_item_key, root);
6281: if (rootid is null) then
6282: Wf_Core.Token('TYPE', itemtype);
6283: Wf_Core.Token('KEY', c_item_key);
6284: Wf_Core.Token('NAME', root);
6285: Wf_Core.Raise('WFENG_ITEM_ROOT');
6286: end if;
6279: end if;
6280: rootid := Wf_Process_Activity.RootInstanceId(itemtype, c_item_key, root);
6281: if (rootid is null) then
6282: Wf_Core.Token('TYPE', itemtype);
6283: Wf_Core.Token('KEY', c_item_key);
6284: Wf_Core.Token('NAME', root);
6285: Wf_Core.Raise('WFENG_ITEM_ROOT');
6286: end if;
6287:
6280: rootid := Wf_Process_Activity.RootInstanceId(itemtype, c_item_key, root);
6281: if (rootid is null) then
6282: Wf_Core.Token('TYPE', itemtype);
6283: Wf_Core.Token('KEY', c_item_key);
6284: Wf_Core.Token('NAME', root);
6285: Wf_Core.Raise('WFENG_ITEM_ROOT');
6286: end if;
6287:
6288: -- Look for the activity instance for this item
6281: if (rootid is null) then
6282: Wf_Core.Token('TYPE', itemtype);
6283: Wf_Core.Token('KEY', c_item_key);
6284: Wf_Core.Token('NAME', root);
6285: Wf_Core.Raise('WFENG_ITEM_ROOT');
6286: end if;
6287:
6288: -- Look for the activity instance for this item
6289: actdate := Wf_Item.Active_Date(itemtype, c_item_key);
6317: end if;
6318:
6319: exception
6320: when others then
6321: Wf_Core.Context('Wf_Engine', 'HandleErrorAll', itemtype, itemkey);
6322: raise;
6323: end HandleErrorAll;
6324:
6325: --
6341: begin
6342: --Check arguments.
6343: if ((itemtype is null) or
6344: (itemkey is null)) then
6345: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
6346: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
6347: Wf_Core.Raise('WFSQL_ARGS');
6348: end if;
6349:
6342: --Check arguments.
6343: if ((itemtype is null) or
6344: (itemkey is null)) then
6345: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
6346: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
6347: Wf_Core.Raise('WFSQL_ARGS');
6348: end if;
6349:
6350: wf_item_activity_status.root_status(itemtype,itemkey,status,result);
6343: if ((itemtype is null) or
6344: (itemkey is null)) then
6345: Wf_Core.Token('ITEMTYPE', nvl(itemtype, 'NULL'));
6346: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
6347: Wf_Core.Raise('WFSQL_ARGS');
6348: end if;
6349:
6350: wf_item_activity_status.root_status(itemtype,itemkey,status,result);
6351: exception
6349:
6350: wf_item_activity_status.root_status(itemtype,itemkey,status,result);
6351: exception
6352: when others then
6353: Wf_Core.Context('Wf_Engine', 'ItemStatus', itemtype, itemkey);
6354: raise;
6355: end ItemStatus;
6356:
6357: -- API to reterive more granular information from the
6468: result := l_result ;
6469: end if;
6470: exception
6471: when others then
6472: Wf_Core.Context('Wf_Engine', 'ItemInfo', itemtype, itemkey);
6473: raise;
6474: end ItemInfo;
6475:
6476:
6522: active_date=>active_date));
6523:
6524: exception
6525: when others then
6526: Wf_Core.Context('Wf_Engine', 'Activity_Exist_In_Process',
6527: p_item_type, p_item_key,
6528: nvl(p_activity_item_type, p_item_type),
6529: p_activity_name);
6530: raise;
6623: end if;
6624:
6625: exception
6626: when OTHERS then
6627: Wf_Core.Context('Wf_Engine', 'Activity_Exist',
6628: p_process_item_type, p_process_name,
6629: nvl(p_activity_item_type, p_process_item_type),
6630: p_activity_name);
6631: raise;
6697: -- Check args
6698: if ((itemtype is null) or
6699: (itemkey is null) or
6700: (event_message is null)) then
6701: Wf_Core.Token('ITEMTYPE', itemtype);
6702: Wf_Core.Token('ITEMKEY', itemkey);
6703: Wf_Core.Token('EVENT_MESSAGE', '');
6704: Wf_Core.Raise('WFSQL_ARGS');
6705: end if;
6698: if ((itemtype is null) or
6699: (itemkey is null) or
6700: (event_message is null)) then
6701: Wf_Core.Token('ITEMTYPE', itemtype);
6702: Wf_Core.Token('ITEMKEY', itemkey);
6703: Wf_Core.Token('EVENT_MESSAGE', '');
6704: Wf_Core.Raise('WFSQL_ARGS');
6705: end if;
6706:
6699: (itemkey is null) or
6700: (event_message is null)) then
6701: Wf_Core.Token('ITEMTYPE', itemtype);
6702: Wf_Core.Token('ITEMKEY', itemkey);
6703: Wf_Core.Token('EVENT_MESSAGE', '');
6704: Wf_Core.Raise('WFSQL_ARGS');
6705: end if;
6706:
6707: -- Not allowed in synch mode
6700: (event_message is null)) then
6701: Wf_Core.Token('ITEMTYPE', itemtype);
6702: Wf_Core.Token('ITEMKEY', itemkey);
6703: Wf_Core.Token('EVENT_MESSAGE', '');
6704: Wf_Core.Raise('WFSQL_ARGS');
6705: end if;
6706:
6707: -- Not allowed in synch mode
6708: if (itemkey = wf_engine.eng_synch) then
6705: end if;
6706:
6707: -- Not allowed in synch mode
6708: if (itemkey = wf_engine.eng_synch) then
6709: Wf_Core.Token('OPERATION', 'Wf_Engine.Set_Item_Parent');
6710: Wf_Core.Raise('WFENG_SYNCH_DISABLED');
6711: end if;
6712:
6713: -- Retrieve event name from message
6706:
6707: -- Not allowed in synch mode
6708: if (itemkey = wf_engine.eng_synch) then
6709: Wf_Core.Token('OPERATION', 'Wf_Engine.Set_Item_Parent');
6710: Wf_Core.Raise('WFENG_SYNCH_DISABLED');
6711: end if;
6712:
6713: -- Retrieve event name from message
6714: event_name := event_message.GetEventName;
6712:
6713: -- Retrieve event name from message
6714: event_name := event_message.GetEventName;
6715: if (event_name is null) then
6716: Wf_Core.Token('EVENT_MESSAGE.EVENT_NAME', '');
6717: Wf_Core.Raise('WFSQL_ARGS');
6718: end if;
6719:
6720: if (WF_CACHE.MetaRefreshed) then
6713: -- Retrieve event name from message
6714: event_name := event_message.GetEventName;
6715: if (event_name is null) then
6716: Wf_Core.Token('EVENT_MESSAGE.EVENT_NAME', '');
6717: Wf_Core.Raise('WFSQL_ARGS');
6718: end if;
6719:
6720: if (WF_CACHE.MetaRefreshed) then
6721: null;
6764: end if;
6765:
6766: -- Check at least one matching event activity found
6767: if (i = 0) then
6768: Wf_Core.Token('TYPE', itemtype);
6769: Wf_Core.Token('KEY', itemkey);
6770: Wf_Core.Token('EVENT', event_name);
6771: Wf_Core.Raise('WFENG_EVENT_NOTFOUND');
6772: end if;
6765:
6766: -- Check at least one matching event activity found
6767: if (i = 0) then
6768: Wf_Core.Token('TYPE', itemtype);
6769: Wf_Core.Token('KEY', itemkey);
6770: Wf_Core.Token('EVENT', event_name);
6771: Wf_Core.Raise('WFENG_EVENT_NOTFOUND');
6772: end if;
6773:
6766: -- Check at least one matching event activity found
6767: if (i = 0) then
6768: Wf_Core.Token('TYPE', itemtype);
6769: Wf_Core.Token('KEY', itemkey);
6770: Wf_Core.Token('EVENT', event_name);
6771: Wf_Core.Raise('WFENG_EVENT_NOTFOUND');
6772: end if;
6773:
6774: -- Set item attributes for all parameters contained in the event
6767: if (i = 0) then
6768: Wf_Core.Token('TYPE', itemtype);
6769: Wf_Core.Token('KEY', itemkey);
6770: Wf_Core.Token('EVENT', event_name);
6771: Wf_Core.Raise('WFENG_EVENT_NOTFOUND');
6772: end if;
6773:
6774: -- Set item attributes for all parameters contained in the event
6775: -- message body.
6812: Wf_Engine.SetEventItemAttr(itemtype, itemkey, aname, avalue);
6813: end if;
6814: exception
6815: when others then
6816: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
6817: -- If attr doesn't exist create runtime itemattr
6818: Wf_Core.Clear;
6819: Wf_Engine.AddItemAttr(itemtype, itemkey, aname, avalue);
6820: else
6814: exception
6815: when others then
6816: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
6817: -- If attr doesn't exist create runtime itemattr
6818: Wf_Core.Clear;
6819: Wf_Engine.AddItemAttr(itemtype, itemkey, aname, avalue);
6820: else
6821: raise; -- All other errors are raised up.
6822: end if;
6860: -- 2. set this activity to error status
6861: -- 3. execute the error process (if any)
6862: -- 4. clear the error to continue with next activity
6863: rollback to wf_savepoint;
6864: Wf_Core.Context('Wf_Engine', 'Event', itemtype, itemkey,
6865: process_name, event_name);
6866: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actarr(i),
6867: wf_engine.eng_exception, FALSE);
6868: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actarr(i),
6866: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actarr(i),
6867: wf_engine.eng_exception, FALSE);
6868: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actarr(i),
6869: wf_engine.eng_exception);
6870: Wf_Core.Clear;
6871: end;
6872: i := i + 1;
6873: end loop;
6874:
6873: end loop;
6874:
6875: exception
6876: when others then
6877: Wf_Core.Context('Wf_Engine', 'Event', itemtype, itemkey,
6878: process_name, event_name);
6879: raise;
6880: end Event;
6881:
6953: begin
6954:
6955: -- Check args
6956: if ((event_message is null)) then
6957: Wf_Core.Token('EVENT_MESSAGE', '');
6958: Wf_Core.Raise('WFSQL_ARGS');
6959: end if;
6960:
6961: -- Retrieve event name from message
6954:
6955: -- Check args
6956: if ((event_message is null)) then
6957: Wf_Core.Token('EVENT_MESSAGE', '');
6958: Wf_Core.Raise('WFSQL_ARGS');
6959: end if;
6960:
6961: -- Retrieve event name from message
6962: event_name := event_message.GetEventName;
6962: event_name := event_message.GetEventName;
6963: businesskey := event_message.GetEventKey;
6964:
6965: if (event_name is null) then
6966: Wf_Core.Token('EVENT_MESSAGE.EVENT_NAME', '');
6967: Wf_Core.Raise('WFSQL_ARGS');
6968: end if;
6969:
6970: --Here before opening the cursor we will set the savepoint
6963: businesskey := event_message.GetEventKey;
6964:
6965: if (event_name is null) then
6966: Wf_Core.Token('EVENT_MESSAGE.EVENT_NAME', '');
6967: Wf_Core.Raise('WFSQL_ARGS');
6968: end if;
6969:
6970: --Here before opening the cursor we will set the savepoint
6971: --This is so that we do not have to depend on the cursor behaviour itself
7000: evtacts_rec.item_key, aname, avalue);
7001: end if;
7002: exception
7003: when others then
7004: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
7005: -- If attr doesn't exist create runtime itemattr
7006: Wf_Core.Clear;
7007:
7008: Wf_Engine.AddItemAttr(evtacts_rec.item_type,
7002: exception
7003: when others then
7004: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
7005: -- If attr doesn't exist create runtime itemattr
7006: Wf_Core.Clear;
7007:
7008: Wf_Engine.AddItemAttr(evtacts_rec.item_type,
7009: evtacts_rec.item_key,
7010: aname, avalue);
7062: -- 2. set this activity to error status
7063: -- 3. execute the error process (if any)
7064: -- 4. clear the error to continue with next activity
7065: rollback to wf_savepoint;
7066: Wf_Core.Context('Wf_Engine', 'Event2', evtacts_rec.item_type,
7067: evtacts_rec.item_key, event_name);
7068: Wf_Item_Activity_Status.Set_Error(evtacts_rec.item_type,
7069: evtacts_rec.item_key,
7070: evtacts_rec.actid,
7072: Wf_Engine_Util.Execute_Error_Process(evtacts_rec.item_type,
7073: evtacts_rec.item_key,
7074: evtacts_rec.actid,
7075: wf_engine.eng_exception);
7076: Wf_Core.Clear;
7077: end;
7078:
7079: i := i + 1;
7080: end loop;
7080: end loop;
7081:
7082: -- Check at least one matching event activity found
7083: if (i = 0) then
7084: Wf_Core.Token('EVENT2', event_name);
7085: Wf_Core.Raise('WFENG_EVENT_NOTFOUND');
7086: end if;
7087:
7088: exception
7081:
7082: -- Check at least one matching event activity found
7083: if (i = 0) then
7084: Wf_Core.Token('EVENT2', event_name);
7085: Wf_Core.Raise('WFENG_EVENT_NOTFOUND');
7086: end if;
7087:
7088: exception
7089: when resource_busy then
7090: --Rollback to ensure that we aren't locking anything here
7091: rollback to wf_savepoint_event2;
7092: raise;
7093: when others then
7094: Wf_Core.Context('Wf_Engine', 'Event2', businesskey, event_name);
7095: raise;
7096: end Event2;
7097:
7098: --
7123: -- Check Arguments
7124: if ((p_itemtype is null) or
7125: (p_itemkey is null) or
7126: (p_aname is null)) then
7127: Wf_Core.Token('P_ITEMTYPE', nvl(p_itemtype, 'NULL'));
7128: Wf_Core.Token('P_ITEMKEY', nvl(p_itemkey, 'NULL'));
7129: Wf_Core.Token('P_ANAME', nvl(p_aname, 'NULL'));
7130: Wf_Core.Raise('WFSQL_ARGS');
7131: end if;
7124: if ((p_itemtype is null) or
7125: (p_itemkey is null) or
7126: (p_aname is null)) then
7127: Wf_Core.Token('P_ITEMTYPE', nvl(p_itemtype, 'NULL'));
7128: Wf_Core.Token('P_ITEMKEY', nvl(p_itemkey, 'NULL'));
7129: Wf_Core.Token('P_ANAME', nvl(p_aname, 'NULL'));
7130: Wf_Core.Raise('WFSQL_ARGS');
7131: end if;
7132:
7125: (p_itemkey is null) or
7126: (p_aname is null)) then
7127: Wf_Core.Token('P_ITEMTYPE', nvl(p_itemtype, 'NULL'));
7128: Wf_Core.Token('P_ITEMKEY', nvl(p_itemkey, 'NULL'));
7129: Wf_Core.Token('P_ANAME', nvl(p_aname, 'NULL'));
7130: Wf_Core.Raise('WFSQL_ARGS');
7131: end if;
7132:
7133: if (p_itemkey = wf_engine.eng_synch) then
7126: (p_aname is null)) then
7127: Wf_Core.Token('P_ITEMTYPE', nvl(p_itemtype, 'NULL'));
7128: Wf_Core.Token('P_ITEMKEY', nvl(p_itemkey, 'NULL'));
7129: Wf_Core.Token('P_ANAME', nvl(p_aname, 'NULL'));
7130: Wf_Core.Raise('WFSQL_ARGS');
7131: end if;
7132:
7133: if (p_itemkey = wf_engine.eng_synch) then
7134: WF_CACHE.GetItemAttrValue(p_itemtype, p_itemKey, p_aname, iStatus,
7177: when no_data_found then
7178: return NULL;
7179:
7180: when others then
7181: Wf_Core.Context('Wf_Engine', 'AddToItemAttrNumber', p_itemtype, p_itemkey,
7182: p_aname, to_char(p_addend));
7183: raise;
7184: end AddToItemAttrNumber;
7185:
7257: l_start_date := to_date(null);
7258: l_end_date := to_date(null);
7259:
7260: -- Date value from CP is in fnd_flex_val_util.g_date_format_19 - 'RRRR/MM/DD HH24:MI:SS'
7261: -- This is same as wf_core.canonical_date_mask.
7262: if (p_start_date is not null) then
7263: l_start_date := to_date(p_start_date, wf_core.canonical_date_mask);
7264: end if;
7265:
7259:
7260: -- Date value from CP is in fnd_flex_val_util.g_date_format_19 - 'RRRR/MM/DD HH24:MI:SS'
7261: -- This is same as wf_core.canonical_date_mask.
7262: if (p_start_date is not null) then
7263: l_start_date := to_date(p_start_date, wf_core.canonical_date_mask);
7264: end if;
7265:
7266: if (p_end_date is not null) then
7267: l_end_date := to_date(p_end_date, wf_core.canonical_date_mask);
7263: l_start_date := to_date(p_start_date, wf_core.canonical_date_mask);
7264: end if;
7265:
7266: if (p_end_date is not null) then
7267: l_end_date := to_date(p_end_date, wf_core.canonical_date_mask);
7268: end if;
7269:
7270: if (nvl(p_docommit, 'Y') = 'Y') then
7271: l_docommit := TRUE;
7287: Fnd_File.Put_Line(Fnd_File.Log, 'p_docommit - '||p_docommit);
7288:
7289: -- Check Arguments
7290: if (p_itemtype is null) then
7291: Wf_Core.Token('ITEMTYPE', nvl(p_itemtype, 'NULL'));
7292: Wf_Core.Raise('WFSQL_ARGS');
7293: end if;
7294:
7295: if (WF_CACHE.MetaRefreshed) then
7288:
7289: -- Check Arguments
7290: if (p_itemtype is null) then
7291: Wf_Core.Token('ITEMTYPE', nvl(p_itemtype, 'NULL'));
7292: Wf_Core.Raise('WFSQL_ARGS');
7293: end if;
7294:
7295: if (WF_CACHE.MetaRefreshed) then
7296: null;
7331: p_retcode := 0;
7332:
7333: exception
7334: when others then
7335: Wf_Core.Get_error(l_errname, l_errmsg, l_stack);
7336:
7337: -- Completed with Error
7338: p_errbuf := nvl(l_errmsg, sqlerrm);
7339: p_retcode := '2';