[Home] [Help]
88: and END_DATE IS NULL;
89:
90: cursor cItemActivityStatuses (l_oldname varchar2) is
91: select ITEM_TYPE, ITEM_KEY, PROCESS_ACTIVITY
92: from WF_ITEM_ACTIVITY_STATUSES
93: where ASSIGNED_USER = l_oldname;
94:
95: cursor cItemActivityStatuses2 (l_oldname varchar2) is
96: select WIAS.ITEM_TYPE, WIAS.ITEM_KEY, WIAS.PROCESS_ACTIVITY
93: where ASSIGNED_USER = l_oldname;
94:
95: cursor cItemActivityStatuses2 (l_oldname varchar2) is
96: select WIAS.ITEM_TYPE, WIAS.ITEM_KEY, WIAS.PROCESS_ACTIVITY
97: from WF_ITEM_ACTIVITY_STATUSES WIAS, WF_ITEMS WI
98: where WIAS.ITEM_TYPE = wi.item_type
99: and WIAS.ITEM_KEY = wi.item_key
100: and WI.END_DATE IS NULL
101: and WIAS.ASSIGNED_USER = l_oldname;
101: and WIAS.ASSIGNED_USER = l_oldname;
102:
103: cursor cItemActivityStatuses_H (l_oldname varchar2) is
104: select ITEM_TYPE, ITEM_KEY, PROCESS_ACTIVITY
105: from WF_ITEM_ACTIVITY_STATUSES_H
106: where ASSIGNED_USER = l_oldname;
107:
108: cursor cItemActivityStatuses_H2 (l_oldname varchar2) is
109: select WIASH.ITEM_TYPE, WIASH.ITEM_KEY, WIASH.PROCESS_ACTIVITY
106: where ASSIGNED_USER = l_oldname;
107:
108: cursor cItemActivityStatuses_H2 (l_oldname varchar2) is
109: select WIASH.ITEM_TYPE, WIASH.ITEM_KEY, WIASH.PROCESS_ACTIVITY
110: from WF_ITEM_ACTIVITY_STATUSES_H WIASH, WF_ITEMS WI
111: where WIASH.ITEM_TYPE = wi.item_type
112: and WIASH.ITEM_KEY = wi.item_key
113: and WI.END_DATE IS NULL
114: and WIASH.ASSIGNED_USER = l_oldname;
131: or WN.MORE_INFO_ROLE = l_oldname
132: or WN.FROM_ROLE = l_oldname
133: or WN.RESPONDER = l_oldname)
134: and (exists (select '1'
135: from WF_ITEM_ACTIVITY_STATUSES WIAS, WF_ITEMS WI
136: where WIAS.NOTIFICATION_ID = WN.NOTIFICATION_ID
137: and WIAS.NOTIFICATION_ID is not null
138: and WIAS.ITEM_TYPE = WI.ITEM_TYPE
139: and WIAS.ITEM_KEY = WI.ITEM_KEY
138: and WIAS.ITEM_TYPE = WI.ITEM_TYPE
139: and WIAS.ITEM_KEY = WI.ITEM_KEY
140: and WI.END_DATE IS NULL)
141: or exists (select '1'
142: from WF_ITEM_ACTIVITY_STATUSES_H WIASH, WF_ITEMS WI
143: where WIASH.NOTIFICATION_ID = WN.NOTIFICATION_ID
144: and WIASH.NOTIFICATION_ID is not null
145: and WIASH.ITEM_TYPE = WI.ITEM_TYPE
146: and WIASH.ITEM_KEY = WI.ITEM_KEY
182: where (WC.FROM_ROLE = l_oldname
183: or WC.TO_ROLE = l_oldname
184: or WC.PROXY_ROLE = l_oldname)
185: and (exists (select '1'
186: from WF_ITEM_ACTIVITY_STATUSES WIAS, WF_ITEMS WI
187: where WIAS.NOTIFICATION_ID = WC.NOTIFICATION_ID
188: and WIAS.NOTIFICATION_ID is not null
189: and WIAS.ITEM_TYPE = WI.ITEM_TYPE
190: and WIAS.ITEM_KEY = WI.ITEM_KEY
189: and WIAS.ITEM_TYPE = WI.ITEM_TYPE
190: and WIAS.ITEM_KEY = WI.ITEM_KEY
191: and WI.END_DATE IS NULL)
192: or exists (select '1'
193: from WF_ITEM_ACTIVITY_STATUSES_H WIASH, WF_ITEMS WI
194: where WIASH.NOTIFICATION_ID = WC.NOTIFICATION_ID
195: and WIASH.NOTIFICATION_ID is not null
196: and WIASH.ITEM_TYPE = WI.ITEM_TYPE
197: and WIASH.ITEM_KEY = WI.ITEM_KEY
311: exit;
312: end if;
313:
314: forall i in itemActTbl.first..itemActTbl.last
315: update WF_ITEM_ACTIVITY_STATUSES
316: set ASSIGNED_USER = l_newname
317: where ITEM_TYPE = itemActTbl(i).item_type
318: and ITEM_KEY = itemActTbl(i).item_key
319: and PROCESS_ACTIVITY = itemActTbl(i).process_activity;
331: exit;
332: end if;
333:
334: forall i in itemActTbl.first..itemActTbl.last
335: update WF_ITEM_ACTIVITY_STATUSES_H
336: set ASSIGNED_USER = l_newname
337: where ITEM_TYPE = itemActTbl(i).item_type
338: and ITEM_KEY = itemActTbl(i).item_key
339: and PROCESS_ACTIVITY = itemActTbl(i).process_activity;
439: exit;
440: end if;
441:
442: forall i in itemActTbl.first..itemActTbl.last
443: update WF_ITEM_ACTIVITY_STATUSES
444: set ASSIGNED_USER = l_newname
445: where ITEM_TYPE = itemActTbl(i).item_type
446: and ITEM_KEY = itemActTbl(i).item_key
447: and PROCESS_ACTIVITY = itemActTbl(i).process_activity;
459: exit;
460: end if;
461:
462: forall i in itemActTbl.first..itemActTbl.last
463: update WF_ITEM_ACTIVITY_STATUSES_H
464: set ASSIGNED_USER = l_newname
465: where ITEM_TYPE = itemActTbl(i).item_type
466: and ITEM_KEY = itemActTbl(i).item_key
467: and PROCESS_ACTIVITY = itemActTbl(i).process_activity;
2018: end if;
2019: l_wfcount_tab.TABLE_NAME :='WF_ITEMS';
2020: pipe ROW (l_wfcount_tab);
2021:
2022: -- Determine rows to change in WF_ITEM_ACTIVITY_STATUSES
2023: if (l_pvalue is null or l_pvalue = 'Y') then
2024: select nvl(count(1), 0) into l_wfcount_tab.REC_CNT
2025: from WF_ITEM_ACTIVITY_STATUSES WIAS
2026: where ASSIGNED_USER = p_name;
2021:
2022: -- Determine rows to change in WF_ITEM_ACTIVITY_STATUSES
2023: if (l_pvalue is null or l_pvalue = 'Y') then
2024: select nvl(count(1), 0) into l_wfcount_tab.REC_CNT
2025: from WF_ITEM_ACTIVITY_STATUSES WIAS
2026: where ASSIGNED_USER = p_name;
2027: else
2028: select nvl(count(1), 0) into l_wfcount_tab.REC_CNT
2029: from WF_ITEM_ACTIVITY_STATUSES WIAS
2025: from WF_ITEM_ACTIVITY_STATUSES WIAS
2026: where ASSIGNED_USER = p_name;
2027: else
2028: select nvl(count(1), 0) into l_wfcount_tab.REC_CNT
2029: from WF_ITEM_ACTIVITY_STATUSES WIAS
2030: where exists (select '1'
2031: from WF_ITEMS WI
2032: where WI.ITEM_TYPE=WIAS.ITEM_TYPE and
2033: WI.ITEM_KEY=WIAS.ITEM_KEY and
2033: WI.ITEM_KEY=WIAS.ITEM_KEY and
2034: WI.END_DATE is null) and
2035: ASSIGNED_USER = p_name;
2036: end if;
2037: l_wfcount_tab.TABLE_NAME :='WF_ITEM_ACTIVITY_STATUSES';
2038: pipe ROW (l_wfcount_tab);
2039:
2040: -- Determine rows to change in WF_ITEM_ACTIVITY_STATUSES_H
2041: if (l_pvalue is null or l_pvalue = 'Y') then
2036: end if;
2037: l_wfcount_tab.TABLE_NAME :='WF_ITEM_ACTIVITY_STATUSES';
2038: pipe ROW (l_wfcount_tab);
2039:
2040: -- Determine rows to change in WF_ITEM_ACTIVITY_STATUSES_H
2041: if (l_pvalue is null or l_pvalue = 'Y') then
2042: select nvl(count(1), 0) into l_wfcount_tab.REC_CNT
2043: from WF_ITEM_ACTIVITY_STATUSES_H WIASH
2044: where ASSIGNED_USER = p_name;
2039:
2040: -- Determine rows to change in WF_ITEM_ACTIVITY_STATUSES_H
2041: if (l_pvalue is null or l_pvalue = 'Y') then
2042: select nvl(count(1), 0) into l_wfcount_tab.REC_CNT
2043: from WF_ITEM_ACTIVITY_STATUSES_H WIASH
2044: where ASSIGNED_USER = p_name;
2045: else
2046: select nvl(count(1), 0) into l_wfcount_tab.REC_CNT
2047: from WF_ITEM_ACTIVITY_STATUSES_H WIASH
2043: from WF_ITEM_ACTIVITY_STATUSES_H WIASH
2044: where ASSIGNED_USER = p_name;
2045: else
2046: select nvl(count(1), 0) into l_wfcount_tab.REC_CNT
2047: from WF_ITEM_ACTIVITY_STATUSES_H WIASH
2048: where exists (select '1'
2049: from WF_ITEMS WI
2050: where WI.ITEM_TYPE=WIASH.ITEM_TYPE and
2051: WI.ITEM_KEY=WIASH.ITEM_KEY and
2051: WI.ITEM_KEY=WIASH.ITEM_KEY and
2052: WI.END_DATE is null) and
2053: ASSIGNED_USER = p_name;
2054: end if;
2055: l_wfcount_tab.TABLE_NAME :='WF_ITEM_ACTIVITY_STATUSES_H';
2056: pipe ROW (l_wfcount_tab);
2057:
2058: -- Determine rows to change in WF_NOTIFICATIONS
2059: if (l_pvalue is null or l_pvalue = 'Y') then
2067: else
2068: select nvl(count(1), 0) into l_wfcount_tab.REC_CNT
2069: from WF_NOTIFICATIONS WN
2070: where (exists (select '1'
2071: from WF_ITEM_ACTIVITY_STATUSES WIAS, WF_ITEMS WI
2072: where WIAS.NOTIFICATION_ID = WN.NOTIFICATION_ID
2073: and WIAS.ITEM_TYPE = WI.ITEM_TYPE
2074: and WIAS.ITEM_KEY = WI.ITEM_KEY
2075: and WI.END_DATE IS NULL)
2073: and WIAS.ITEM_TYPE = WI.ITEM_TYPE
2074: and WIAS.ITEM_KEY = WI.ITEM_KEY
2075: and WI.END_DATE IS NULL)
2076: or exists (select '1'
2077: from WF_ITEM_ACTIVITY_STATUSES_H WIASH, WF_ITEMS WI
2078: where WIASH.NOTIFICATION_ID = WN.NOTIFICATION_ID
2079: and WIASH.ITEM_TYPE = WI.ITEM_TYPE
2080: and WIASH.ITEM_KEY = WI.ITEM_KEY
2081: and WI.END_DATE IS NULL))
2162: where (WC.FROM_ROLE = p_name
2163: or WC.TO_ROLE = p_name
2164: or WC.PROXY_ROLE = p_name)
2165: and (exists (select '1'
2166: from WF_ITEM_ACTIVITY_STATUSES WIAS, WF_ITEMS WI
2167: where WIAS.NOTIFICATION_ID = WC.NOTIFICATION_ID
2168: and WIAS.ITEM_TYPE = WI.ITEM_TYPE
2169: and WIAS.ITEM_KEY = WI.ITEM_KEY
2170: and WI.END_DATE IS NULL)
2168: and WIAS.ITEM_TYPE = WI.ITEM_TYPE
2169: and WIAS.ITEM_KEY = WI.ITEM_KEY
2170: and WI.END_DATE IS NULL)
2171: or exists (select '1'
2172: from WF_ITEM_ACTIVITY_STATUSES_H WIASH, WF_ITEMS WI
2173: where WIASH.NOTIFICATION_ID = WC.NOTIFICATION_ID
2174: and WIASH.ITEM_TYPE = WI.ITEM_TYPE
2175: and WIASH.ITEM_KEY = WI.ITEM_KEY
2176: and WI.END_DATE IS NULL));