1: package body WF_ITEM as
2: /* $Header: wfengb.pls 120.25.12010000.3 2008/10/28 15:19:48 alepe ship $ */
3:
4: c_itemtype varchar2(8);
5: c_itemkey varchar2(240);
17: --
18: procedure ClearCache
19: is
20: begin
21: wf_item.c_itemtype := '';
22: wf_item.c_itemkey := '';
23: wf_item.c_root_activity := '';
24: wf_item.c_root_activity_version := '';
25: wf_item.c_begin_date := to_date(NULL);
18: procedure ClearCache
19: is
20: begin
21: wf_item.c_itemtype := '';
22: wf_item.c_itemkey := '';
23: wf_item.c_root_activity := '';
24: wf_item.c_root_activity_version := '';
25: wf_item.c_begin_date := to_date(NULL);
26: wf_item.c_userkey := '';
19: is
20: begin
21: wf_item.c_itemtype := '';
22: wf_item.c_itemkey := '';
23: wf_item.c_root_activity := '';
24: wf_item.c_root_activity_version := '';
25: wf_item.c_begin_date := to_date(NULL);
26: wf_item.c_userkey := '';
27:
20: begin
21: wf_item.c_itemtype := '';
22: wf_item.c_itemkey := '';
23: wf_item.c_root_activity := '';
24: wf_item.c_root_activity_version := '';
25: wf_item.c_begin_date := to_date(NULL);
26: wf_item.c_userkey := '';
27:
28: --clear ondemand flag
21: wf_item.c_itemtype := '';
22: wf_item.c_itemkey := '';
23: wf_item.c_root_activity := '';
24: wf_item.c_root_activity_version := '';
25: wf_item.c_begin_date := to_date(NULL);
26: wf_item.c_userkey := '';
27:
28: --clear ondemand flag
29: wf_item.c_ondemand := null;
22: wf_item.c_itemkey := '';
23: wf_item.c_root_activity := '';
24: wf_item.c_root_activity_version := '';
25: wf_item.c_begin_date := to_date(NULL);
26: wf_item.c_userkey := '';
27:
28: --clear ondemand flag
29: wf_item.c_ondemand := null;
30: -- Clear the synch attribute cache too
25: wf_item.c_begin_date := to_date(NULL);
26: wf_item.c_userkey := '';
27:
28: --clear ondemand flag
29: wf_item.c_ondemand := null;
30: -- Clear the synch attribute cache too
31: wf_engine.synch_attr_count := 0;
32:
33: exception
31: wf_engine.synch_attr_count := 0;
32:
33: exception
34: when others then
35: Wf_Core.Context('Wf_Item', 'ClearCache');
36: raise;
37: end ClearCache;
38:
39: --
53: status varchar2(8);
54: onDemandFlag wf_activity_attributes.text_default%type;
55: begin
56: -- Check for refresh
57: if ((itemtype = wf_item.c_itemtype) and
58: (itemkey = wf_item.c_itemkey)) then
59: return;
60: end if;
61:
54: onDemandFlag wf_activity_attributes.text_default%type;
55: begin
56: -- Check for refresh
57: if ((itemtype = wf_item.c_itemtype) and
58: (itemkey = wf_item.c_itemkey)) then
59: return;
60: end if;
61:
62: -- SYNCHMODE: If
64: -- 2. The cached item is a synch process AND
65: -- 3. The cached item has not yet completed
66: -- then raise an error. Other items cannot be accessed until synch
67: -- item completes, because it can't be restarted from db
68: if (wf_item.c_itemkey = wf_engine.eng_synch) then
69: -- Get status of root process of cached item
70: -- Note: If process completed successfully, the last thing in the
71: -- WIAS runtime cache should be the root process, which is the
72: -- only reason this will work.
72: -- only reason this will work.
73: begin
74: rootid := Wf_Process_Activity.RootInstanceId(c_itemtype, c_itemkey,
75: c_root_activity);
76: Wf_Item_Activity_Status.Status(c_itemtype, c_itemkey, rootid, status);
77: exception
78: when others then
79: status := 'x'; -- Treat errors like incomplete process
80: end;
87:
88: -- Query new values
89: select WI.ROOT_ACTIVITY, WI.ROOT_ACTIVITY_VERSION, WI.BEGIN_DATE,
90: WI.USER_KEY
91: into wf_item.c_root_activity, wf_item.c_root_activity_version,
92: wf_item.c_begin_date, wf_item.c_userkey
93: from WF_ITEMS WI
94: where WI.ITEM_TYPE = InitCache.itemtype
95: and WI.ITEM_KEY = InitCache.itemkey;
88: -- Query new values
89: select WI.ROOT_ACTIVITY, WI.ROOT_ACTIVITY_VERSION, WI.BEGIN_DATE,
90: WI.USER_KEY
91: into wf_item.c_root_activity, wf_item.c_root_activity_version,
92: wf_item.c_begin_date, wf_item.c_userkey
93: from WF_ITEMS WI
94: where WI.ITEM_TYPE = InitCache.itemtype
95: and WI.ITEM_KEY = InitCache.itemkey;
96:
89: select WI.ROOT_ACTIVITY, WI.ROOT_ACTIVITY_VERSION, WI.BEGIN_DATE,
90: WI.USER_KEY
91: into wf_item.c_root_activity, wf_item.c_root_activity_version,
92: wf_item.c_begin_date, wf_item.c_userkey
93: from WF_ITEMS WI
94: where WI.ITEM_TYPE = InitCache.itemtype
95: and WI.ITEM_KEY = InitCache.itemkey;
96:
97: -- Save cache key values
94: where WI.ITEM_TYPE = InitCache.itemtype
95: and WI.ITEM_KEY = InitCache.itemkey;
96:
97: -- Save cache key values
98: wf_item.c_itemtype := itemtype;
99: wf_item.c_itemkey := itemkey;
100:
101: --cache ondemand flag
102: -- this could potentially have some impact on the performance as this
95: and WI.ITEM_KEY = InitCache.itemkey;
96:
97: -- Save cache key values
98: wf_item.c_itemtype := itemtype;
99: wf_item.c_itemkey := itemkey;
100:
101: --cache ondemand flag
102: -- this could potentially have some impact on the performance as this
103: -- routine is called many times while we are dealing with design time data.
110: and activity_name = c_root_activity
111: and activity_version=c_root_activity_version
112: and name = '#ONDEMANDATTR';
113:
114: wf_item.c_ondemand := true;
115: exception
116: when no_data_found then
117: wf_item.c_ondemand := false;
118: end;
113:
114: wf_item.c_ondemand := true;
115: exception
116: when no_data_found then
117: wf_item.c_ondemand := false;
118: end;
119:
120:
121:
121:
122: exception
123: when NO_DATA_FOUND then
124: if (ignore_notfound) then
125: WF_ITEM.ClearCache;
126:
127: else
128:
129: Wf_Core.Context('Wf_Item', 'InitCache', itemtype, itemkey);
125: WF_ITEM.ClearCache;
126:
127: else
128:
129: Wf_Core.Context('Wf_Item', 'InitCache', itemtype, itemkey);
130: raise;
131:
132: end if;
133:
131:
132: end if;
133:
134: when others then
135: Wf_Core.Context('Wf_Item', 'InitCache', itemtype, itemkey);
136: raise;
137: end InitCache;
138:
139: --
154: --
155: --we need to call in case itemtype and itemkey are not in synch with
156: --cached value.
157: --
158: Wf_Item.InitCache(itemtype, itemkey, ignore_notfound=>TRUE);
159: return c_ondemand;
160: end Attribute_On_Demand;
161:
162: --
179: ValTooLarge EXCEPTION;
180: pragma exception_init(ValTooLarge, -01401);
181:
182: begin
183: update WF_ITEMS set
184: PARENT_ITEM_TYPE = Set_Item_Parent.parent_itemtype,
185: PARENT_ITEM_KEY = Set_Item_Parent.parent_itemkey,
186: PARENT_CONTEXT = Set_Item_Parent.parent_context
187: where ITEM_TYPE = Set_Item_Parent.itemtype
217:
218: else
219: -- Parent context is null
220: -- increase all known #CNT counter by 1
221: update WF_ITEM_ATTRIBUTE_VALUES
222: set NUMBER_VALUE = NUMBER_VALUE + 1
223: where NAME like '#CNT_%'
224: and NUMBER_VALUE is not null
225: and ITEM_TYPE = parent_itemType
230: end if; --Caller is signalling that this "should" be a coordinated flow.
231:
232: exception
233: when no_data_found then
234: Wf_Core.Context('Wf_Item', 'Set_Item_Parent', itemtype, itemkey,
235: parent_itemtype, parent_itemkey, parent_context);
236: Wf_Core.Token('TYPE', itemtype);
237: Wf_Core.Token('KEY', itemkey);
238: Wf_Core.Raise('WFENG_ITEM');
237: Wf_Core.Token('KEY', itemkey);
238: Wf_Core.Raise('WFENG_ITEM');
239:
240: when ValTooLarge then
241: Wf_Core.Context('Wf_Item', 'Set_Item_Parent', itemtype, itemkey,
242: parent_itemtype, parent_itemkey, parent_context, 'TRUE');
243: WF_CORE.Token('LABEL', parent_context);
244: WF_CORE.Token('LENGTH', 25);
245: WF_CORE.Raise('WFENG_LABEL_TOO_LARGE');
244: WF_CORE.Token('LENGTH', 25);
245: WF_CORE.Raise('WFENG_LABEL_TOO_LARGE');
246:
247: when others then
248: Wf_Core.Context('Wf_Item', 'Set_Item_Parent', itemtype, itemkey,
249: parent_itemtype, parent_itemkey, parent_context);
250: raise;
251: end Set_Item_Parent;
252:
265: is
266: begin
267:
268: -- Update owner column
269: update WF_ITEMS WI set
270: OWNER_ROLE = SetItemOwner.owner
271: where WI.ITEM_TYPE = SetItemOwner.itemtype
272: and WI.ITEM_KEY = SetItemOwner.itemkey;
273:
275: raise no_data_found;
276: end if;
277: exception
278: when no_data_found then
279: Wf_Core.Context('Wf_Item', 'SetItemOwner', itemtype, itemkey,
280: owner);
281: Wf_Core.Token('TYPE', itemtype);
282: Wf_Core.Token('KEY', itemkey);
283: Wf_Core.Raise('WFENG_ITEM');
281: Wf_Core.Token('TYPE', itemtype);
282: Wf_Core.Token('KEY', itemkey);
283: Wf_Core.Raise('WFENG_ITEM');
284: when others then
285: Wf_Core.Context('Wf_Item', 'SetItemOwner', itemtype, itemkey,
286: owner);
287: raise;
288: end SetItemOwner;
289:
300: itemkey in varchar2,
301: userkey in varchar2)
302: is
303: begin
304: update WF_ITEMS WI set
305: USER_KEY = SetItemUserKey.userkey
306: where WI.ITEM_TYPE = SetItemUserKey.itemtype
307: and WI.ITEM_KEY = SetItemUserKey.itemkey;
308:
310: raise no_data_found;
311: end if;
312:
313: -- Set value in the local cache the right item
314: if ((itemtype = wf_item.c_itemtype) and
315: (itemkey = wf_item.c_itemkey)) then
316: wf_item.c_userkey := userkey;
317: end if;
318: exception
311: end if;
312:
313: -- Set value in the local cache the right item
314: if ((itemtype = wf_item.c_itemtype) and
315: (itemkey = wf_item.c_itemkey)) then
316: wf_item.c_userkey := userkey;
317: end if;
318: exception
319: when no_data_found then
312:
313: -- Set value in the local cache the right item
314: if ((itemtype = wf_item.c_itemtype) and
315: (itemkey = wf_item.c_itemkey)) then
316: wf_item.c_userkey := userkey;
317: end if;
318: exception
319: when no_data_found then
320: Wf_Core.Context('Wf_Item', 'SetItemUserKey', itemtype, itemkey,
316: wf_item.c_userkey := userkey;
317: end if;
318: exception
319: when no_data_found then
320: Wf_Core.Context('Wf_Item', 'SetItemUserKey', itemtype, itemkey,
321: userkey);
322: Wf_Core.Token('TYPE', itemtype);
323: Wf_Core.Token('KEY', itemkey);
324: Wf_Core.Raise('WFENG_ITEM');
322: Wf_Core.Token('TYPE', itemtype);
323: Wf_Core.Token('KEY', itemkey);
324: Wf_Core.Raise('WFENG_ITEM');
325: when others then
326: Wf_Core.Context('Wf_Item', 'SetItemUserKey', itemtype, itemkey,
327: userkey);
328: raise;
329: end SetItemUserKey;
330:
344: is
345: buf varchar2(240);
346: begin
347: -- Check first for cached value
348: if ((itemtype = wf_item.c_itemtype) and
349: (itemkey = wf_item.c_itemkey)) then
350: return(wf_item.c_userkey);
351: end if;
352:
345: buf varchar2(240);
346: begin
347: -- Check first for cached value
348: if ((itemtype = wf_item.c_itemtype) and
349: (itemkey = wf_item.c_itemkey)) then
350: return(wf_item.c_userkey);
351: end if;
352:
353: -- No cached value, go directly to the source
346: begin
347: -- Check first for cached value
348: if ((itemtype = wf_item.c_itemtype) and
349: (itemkey = wf_item.c_itemkey)) then
350: return(wf_item.c_userkey);
351: end if;
352:
353: -- No cached value, go directly to the source
354: select USER_KEY
352:
353: -- No cached value, go directly to the source
354: select USER_KEY
355: into buf
356: from WF_ITEMS WI
357: where WI.ITEM_TYPE = GetItemUserKey.itemtype
358: and WI.ITEM_KEY = GetItemUserKey.itemkey;
359:
360: return(buf);
359:
360: return(buf);
361: exception
362: when no_data_found then
363: Wf_Core.Context('Wf_Item', 'GetItemUserKey', itemtype, itemkey);
364: Wf_Core.Token('TYPE', itemtype);
365: Wf_Core.Token('KEY', itemkey);
366: Wf_Core.Raise('WFENG_ITEM');
367: when others then
364: Wf_Core.Token('TYPE', itemtype);
365: Wf_Core.Token('KEY', itemkey);
366: Wf_Core.Raise('WFENG_ITEM');
367: when others then
368: Wf_Core.Context('Wf_Item', 'GetItemUserKey', itemtype, itemkey);
369: raise;
370: end GetItemUserKey;
371:
372: --
381: return boolean
382: is
383: begin
384:
385: Wf_Item.InitCache(itemtype, itemkey, ignore_notfound=>TRUE);
386:
387: if (wf_item.c_itemtype is not null) then
388:
389: return(TRUE);
383: begin
384:
385: Wf_Item.InitCache(itemtype, itemkey, ignore_notfound=>TRUE);
386:
387: if (wf_item.c_itemtype is not null) then
388:
389: return(TRUE);
390:
391: else
395: end if;
396:
397: exception
398: when OTHERS then
399: Wf_Core.Context('Wf_Item', 'Item_Exist', itemtype, itemkey);
400: raise;
401: end Item_Exist;
402:
403: --
417: version out NOCOPY number)
418: is
419: begin
420:
421: Wf_Item.InitCache(itemtype, itemkey);
422: wflow := wf_item.c_root_activity;
423: version := wf_item.c_root_activity_version;
424:
425: exception
418: is
419: begin
420:
421: Wf_Item.InitCache(itemtype, itemkey);
422: wflow := wf_item.c_root_activity;
423: version := wf_item.c_root_activity_version;
424:
425: exception
426: when NO_DATA_FOUND then
419: begin
420:
421: Wf_Item.InitCache(itemtype, itemkey);
422: wflow := wf_item.c_root_activity;
423: version := wf_item.c_root_activity_version;
424:
425: exception
426: when NO_DATA_FOUND then
427: wflow := '';
426: when NO_DATA_FOUND then
427: wflow := '';
428: version := -1;
429: when OTHERS then
430: Wf_Core.Context('Wf_Item', 'Root_Process', itemtype, itemkey);
431: raise;
432: end Root_Process;
433:
434: --
432: end Root_Process;
433:
434: --
435: -- Create_Item (PRIVATE)
436: -- Create one row in the WF_ITEMS table with the given item type, item key
437: -- and the root process name.
438: -- IN
439: -- itemtype - item type
440: -- itemkey - item key
461:
462: cursor attrcurs(itype in varchar2) is
463: select WIA.ITEM_TYPE, WIA.NAME, WIA.TYPE, WIA.SUBTYPE, WIA.FORMAT,
464: WIA.TEXT_DEFAULT, WIA.NUMBER_DEFAULT, WIA.DATE_DEFAULT
465: from WF_ITEM_ATTRIBUTES WIA
466: where WIA.ITEM_TYPE = itype;
467:
468: begin
469:
470: rootversion := Wf_Activity.Version(itemtype, wflow, actdate);
471:
472: if (itemkey <> wf_engine.eng_synch) then
473: -- NORMAL: Insert new item and attributes directly in the db
474: insert into WF_ITEMS (
475: ITEM_TYPE,
476: ITEM_KEY,
477: ROOT_ACTIVITY,
478: ROOT_ACTIVITY_VERSION,
496: );
497: end if;
498:
499: -- Initialize runtime cache (used in both NORMAL and SYNCHMODE).
500: wf_item.c_itemtype := itemtype;
501: wf_item.c_itemkey := itemkey;
502: wf_item.c_root_activity := wflow;
503: wf_item.c_root_activity_version := rootversion;
504: wf_item.c_begin_date := actdate;
497: end if;
498:
499: -- Initialize runtime cache (used in both NORMAL and SYNCHMODE).
500: wf_item.c_itemtype := itemtype;
501: wf_item.c_itemkey := itemkey;
502: wf_item.c_root_activity := wflow;
503: wf_item.c_root_activity_version := rootversion;
504: wf_item.c_begin_date := actdate;
505: wf_item.c_userkey := Create_item.user_key;
498:
499: -- Initialize runtime cache (used in both NORMAL and SYNCHMODE).
500: wf_item.c_itemtype := itemtype;
501: wf_item.c_itemkey := itemkey;
502: wf_item.c_root_activity := wflow;
503: wf_item.c_root_activity_version := rootversion;
504: wf_item.c_begin_date := actdate;
505: wf_item.c_userkey := Create_item.user_key;
506:
499: -- Initialize runtime cache (used in both NORMAL and SYNCHMODE).
500: wf_item.c_itemtype := itemtype;
501: wf_item.c_itemkey := itemkey;
502: wf_item.c_root_activity := wflow;
503: wf_item.c_root_activity_version := rootversion;
504: wf_item.c_begin_date := actdate;
505: wf_item.c_userkey := Create_item.user_key;
506:
507: --
500: wf_item.c_itemtype := itemtype;
501: wf_item.c_itemkey := itemkey;
502: wf_item.c_root_activity := wflow;
503: wf_item.c_root_activity_version := rootversion;
504: wf_item.c_begin_date := actdate;
505: wf_item.c_userkey := Create_item.user_key;
506:
507: --
508: --ondemand flag
501: wf_item.c_itemkey := itemkey;
502: wf_item.c_root_activity := wflow;
503: wf_item.c_root_activity_version := rootversion;
504: wf_item.c_begin_date := actdate;
505: wf_item.c_userkey := Create_item.user_key;
506:
507: --
508: --ondemand flag
509: --
512: where activity_item_type = c_itemtype
513: and activity_name = c_root_activity
514: and activity_version=c_root_activity_version
515: and name = '#ONDEMANDATTR';
516: wf_item.c_ondemand := true;
517: exception
518: when no_data_found then
519: wf_item.c_ondemand := false;
520: end;
515: and name = '#ONDEMANDATTR';
516: wf_item.c_ondemand := true;
517: exception
518: when no_data_found then
519: wf_item.c_ondemand := false;
520: end;
521:
522: -- Initialize item attributes
523: if (itemkey <> wf_engine.eng_synch) then
521:
522: -- Initialize item attributes
523: if (itemkey <> wf_engine.eng_synch) then
524: -- NORMAL: store attributes in table
525: if(not wf_item.c_ondemand) then
526: -- only popluate when the flag is false
527: insert into WF_ITEM_ATTRIBUTE_VALUES (
528: ITEM_TYPE,
529: ITEM_KEY,
523: if (itemkey <> wf_engine.eng_synch) then
524: -- NORMAL: store attributes in table
525: if(not wf_item.c_ondemand) then
526: -- only popluate when the flag is false
527: insert into WF_ITEM_ATTRIBUTE_VALUES (
528: ITEM_TYPE,
529: ITEM_KEY,
530: NAME,
531: TEXT_VALUE,
537: WIA.NAME,
538: WIA.TEXT_DEFAULT,
539: WIA.NUMBER_DEFAULT,
540: WIA.DATE_DEFAULT
541: from WF_ITEM_ATTRIBUTES WIA
542: where WIA.ITEM_TYPE = itemtype;
543: end if;
544: else
545: -- SYNCHMODE: store attributes in plsql only
573: end if;
574:
575: exception
576: when DUP_VAL_ON_INDEX then
577: Wf_Core.Context('Wf_Item', 'Create_Item', itemtype, itemkey, wflow);
578: Wf_Core.Token('TYPE', itemtype);
579: Wf_Core.Token('KEY', itemkey);
580: Wf_Core.Raise('WFENG_ITEM_UNIQUE');
581: when OTHERS then
578: Wf_Core.Token('TYPE', itemtype);
579: Wf_Core.Token('KEY', itemkey);
580: Wf_Core.Raise('WFENG_ITEM_UNIQUE');
581: when OTHERS then
582: Wf_Core.Context('Wf_Item', 'Create_Item', itemtype, itemkey, wflow);
583: raise;
584: end Create_Item;
585:
586: --
596: itemkey in varchar2)
597: return date
598: is
599: begin
600: Wf_Item.InitCache(itemtype, itemkey);
601: return(wf_item.c_begin_date);
602: exception
603: when NO_DATA_FOUND then
604: Wf_Core.Context('Wf_Item', 'Active_Date', itemtype, itemkey);
597: return date
598: is
599: begin
600: Wf_Item.InitCache(itemtype, itemkey);
601: return(wf_item.c_begin_date);
602: exception
603: when NO_DATA_FOUND then
604: Wf_Core.Context('Wf_Item', 'Active_Date', itemtype, itemkey);
605: Wf_Core.Token('TYPE', itemtype);
600: Wf_Item.InitCache(itemtype, itemkey);
601: return(wf_item.c_begin_date);
602: exception
603: when NO_DATA_FOUND then
604: Wf_Core.Context('Wf_Item', 'Active_Date', itemtype, itemkey);
605: Wf_Core.Token('TYPE', itemtype);
606: Wf_Core.Token('KEY', itemkey);
607: Wf_Core.Raise('WFENG_ITEM');
608: when OTHERS then
605: Wf_Core.Token('TYPE', itemtype);
606: Wf_Core.Token('KEY', itemkey);
607: Wf_Core.Raise('WFENG_ITEM');
608: when OTHERS then
609: Wf_Core.Context('Wf_Item', 'Active_Date', itemtype, itemkey);
610: end Active_Date;
611:
612: --Function Acquire_lock (PRIVATE)
613: --This function tries to lock the particular item (for the give
610: end Active_Date;
611:
612: --Function Acquire_lock (PRIVATE)
613: --This function tries to lock the particular item (for the give
614: --itemtype/itemkey ) in the wf_items table. It returns true if the lock
615: --acquired else returns false.
616:
617: --Here we will not do any error handling but return true/false
618: --for the case of lock_acquired or not . This leaves the caller
628: --Bug 2607770
629: --Cursor for acquiring lock
630: cursor itemlock (itemtype varchar2, itemkey varchar2) is
631: select '1'
632: from wf_items
633: where item_type = itemtype
634: and item_key = itemkey
635: for update nowait;
636:
666: CLOSE itemlock;
667: end if;
668: --In this case we do not want a TRUE/FALSE return
669: --we just raise the error.
670: Wf_Core.Context('Wf_Item', 'Acquire_lock', itemtype, itemkey);
671: raise;
672: end;
673:
674: --
695:
696: l_result NUMBER;
697: i NUMBER;
698: begin
699: UPDATE wf_items
700: SET end_date = sysdate
701: WHERE item_type = p_itemType
702: AND item_key = p_itemKey
703: AND end_date is NULL
725: end if;
726: else
727: SELECT TEXT_VALUE
728: bulk collect into attrNames
729: FROM WF_ITEM_ATTRIBUTE_VALUES
730: WHERE ITEM_TYPE = p_itemType
731: AND ITEM_KEY = p_itemKey
732: AND NAME like ('#LBL_%')
733: AND TEXT_VALUE is NOT null;
747: --in the parent which the child may not have created the corresponding
748: --#LBL_ (did not arrive) such as in the case of an AbortProcess()
749: SELECT wiav.NAME
750: bulk collect into attrNames
751: FROM WF_ITEM_ATTRIBUTE_VALUES wiav
752: WHERE wiav.ITEM_TYPE = l_parent_itemType
753: AND wiav.ITEM_KEY = l_parent_itemKey
754: and wiav.NAME like ('#CNT_%')
755: AND NOT EXISTS (select null
752: WHERE wiav.ITEM_TYPE = l_parent_itemType
753: AND wiav.ITEM_KEY = l_parent_itemKey
754: and wiav.NAME like ('#CNT_%')
755: AND NOT EXISTS (select null
756: from wf_item_attribute_values wiav2
757: where wiav2.item_type = p_itemType
758: and wiav2.item_key = p_itemKey
759: and wiav2.name = REPLACE(wiav.name,'#CNT_','#LBL_'));
760: if (attrNames.COUNT > 0) then
769: end if; --This item has a parent.
770: return 0;
771: exception
772: when OTHERS then
773: WF_CORE.Context('WF_ITEM', 'SetEndDate', p_itemType, p_itemKey);
774: raise;
775:
776: end SetEndDate;
777:
774: raise;
775:
776: end SetEndDate;
777:
778: end WF_ITEM;