DBA Data[Home] [Help]

APPS.AME_ATTRIBUTE_USAGES_API dependencies on AME_ATTRIBUTE_USAGES

Line 1: PACKAGE BODY AME_ATTRIBUTE_USAGES_API AS

1: PACKAGE BODY AME_ATTRIBUTE_USAGES_API AS
2: /* $Header: ameauapi.pkb 120.5 2012/01/19 05:46:48 rpahune ship $ */
3: X_AME_INSTALLATION_LEVEL varchar2(255);
4:
5: function CALCULATE_USE_COUNT

Line 6: (X_ATTRIBUTE_ID ame_attribute_usages.attribute_id%type,

2: /* $Header: ameauapi.pkb 120.5 2012/01/19 05:46:48 rpahune ship $ */
3: X_AME_INSTALLATION_LEVEL varchar2(255);
4:
5: function CALCULATE_USE_COUNT
6: (X_ATTRIBUTE_ID ame_attribute_usages.attribute_id%type,
7: X_APPLICATION_ID ame_attribute_usages.application_id%type)
8: return integer as
9: cursor RULE_CURSOR
10: (X_APPLICATION_ID ame_attribute_usages.application_id%type) is

Line 7: X_APPLICATION_ID ame_attribute_usages.application_id%type)

3: X_AME_INSTALLATION_LEVEL varchar2(255);
4:
5: function CALCULATE_USE_COUNT
6: (X_ATTRIBUTE_ID ame_attribute_usages.attribute_id%type,
7: X_APPLICATION_ID ame_attribute_usages.application_id%type)
8: return integer as
9: cursor RULE_CURSOR
10: (X_APPLICATION_ID ame_attribute_usages.application_id%type) is
11: select AME_RULE_USAGES.RULE_ID, AME_RULES.ACTION_ID

Line 10: (X_APPLICATION_ID ame_attribute_usages.application_id%type) is

6: (X_ATTRIBUTE_ID ame_attribute_usages.attribute_id%type,
7: X_APPLICATION_ID ame_attribute_usages.application_id%type)
8: return integer as
9: cursor RULE_CURSOR
10: (X_APPLICATION_ID ame_attribute_usages.application_id%type) is
11: select AME_RULE_USAGES.RULE_ID, AME_RULES.ACTION_ID
12: from AME_RULES, AME_RULE_USAGES
13: where AME_RULES.RULE_ID = AME_RULE_USAGES.RULE_ID
14: and AME_RULE_USAGES.ITEM_ID = X_APPLICATION_ID

Line 112: ame_util.runtimeException('ame_attribute_usages_api',

108: end if;
109: return(NEW_USE_COUNT);
110: exception
111: when others then
112: ame_util.runtimeException('ame_attribute_usages_api',
113: 'CALCULATE_USE_COUNT',
114: sqlcode,
115: sqlerrm);
116: raise;

Line 120: (X_ATTRIBUTE_ID ame_attribute_usages.attribute_id%type,

116: raise;
117: return(null);
118: end CALCULATE_USE_COUNT;
119: function IS_SEED_USG_RULE_MODIFIED
120: (X_ATTRIBUTE_ID ame_attribute_usages.attribute_id%type,
121: X_APPLICATION_ID ame_attribute_usages.application_id%type)
122: return boolean as
123: --
124: -- Verify whether the attribute is a SEEDed attribute and is/was in use

Line 121: X_APPLICATION_ID ame_attribute_usages.application_id%type)

117: return(null);
118: end CALCULATE_USE_COUNT;
119: function IS_SEED_USG_RULE_MODIFIED
120: (X_ATTRIBUTE_ID ame_attribute_usages.attribute_id%type,
121: X_APPLICATION_ID ame_attribute_usages.application_id%type)
122: return boolean as
123: --
124: -- Verify whether the attribute is a SEEDed attribute and is/was in use
125: --

Line 128: from AME_ATTRIBUTE_USAGES

124: -- Verify whether the attribute is a SEEDed attribute and is/was in use
125: --
126: cursor CSR_USAGE_IS_SEEDED is
127: select 'Y'
128: from AME_ATTRIBUTE_USAGES
129: where ATTRIBUTE_ID = X_ATTRIBUTE_ID
130: and APPLICATION_ID = X_APPLICATION_ID
131: and LAST_UPDATED_BY not in (1,120)
132: and CREATED_BY in (1,120)

Line 136: from AME_ATTRIBUTE_USAGES

132: and CREATED_BY in (1,120)
133: and sysdate between START_DATE
134: and nvl(END_DATE - (1/86400), sysdate)
135: and exists (select null
136: from AME_ATTRIBUTE_USAGES
137: where ATTRIBUTE_ID = X_ATTRIBUTE_ID
138: and APPLICATION_ID = X_APPLICATION_ID
139: group by ATTRIBUTE_ID, APPLICATION_ID
140: having max(USE_COUNT) > 0)

Line 143: AME_ATTRIBUTE_USAGES ATTRU1

139: group by ATTRIBUTE_ID, APPLICATION_ID
140: having max(USE_COUNT) > 0)
141: and not exists (select null
142: from AME_ATTRIBUTES ATTR1,
143: AME_ATTRIBUTE_USAGES ATTRU1
144: where ATTR1.ATTRIBUTE_ID = X_ATTRIBUTE_ID
145: and ATTRU1.APPLICATION_ID = X_APPLICATION_ID
146: and ATTR1.ATTRIBUTE_ID = ATTRU1.ATTRIBUTE_ID
147: and ATTR1.LAST_UPDATED_BY not in (1,120)

Line 160: ame_util.runtimeException('ame_attribute_usages_api',

156: end if;
157: return(true);
158: exception
159: when others then
160: ame_util.runtimeException('ame_attribute_usages_api',
161: 'IS_SEED_USG_RULE_MODIFIED',
162: sqlcode,
163: sqlerrm);
164: raise;

Line 265: (X_ATTRIBUTE_ID in ame_attribute_usages.attribute_id%type,

261: X_QUERY_STRING_INOUT :=replace(queryString,'('||querySubstring||')',':lineItemIdList');
262: end if;
263: end PRESERVE_LINE_ITEM_ID_LIST;
264: procedure RECTIFY_RULE_MOD_SEED_USAGE
265: (X_ATTRIBUTE_ID in ame_attribute_usages.attribute_id%type,
266: X_APPLICATION_ID in ame_attribute_usages.application_id%type,
267: X_LAST_UPDATE_DATE in varchar2,
268: X_CURRENT_LAST_UPDATE_DATE in out nocopy varchar2 ) is
269: -- get all the seeded attributes impacted by the rules, when created first time

Line 266: X_APPLICATION_ID in ame_attribute_usages.application_id%type,

262: end if;
263: end PRESERVE_LINE_ITEM_ID_LIST;
264: procedure RECTIFY_RULE_MOD_SEED_USAGE
265: (X_ATTRIBUTE_ID in ame_attribute_usages.attribute_id%type,
266: X_APPLICATION_ID in ame_attribute_usages.application_id%type,
267: X_LAST_UPDATE_DATE in varchar2,
268: X_CURRENT_LAST_UPDATE_DATE in out nocopy varchar2 ) is
269: -- get all the seeded attributes impacted by the rules, when created first time
270: -- using the particular attribute

Line 274: from AME_ATTRIBUTE_USAGES

270: -- using the particular attribute
271: cursor ATTRIBUTE_USAGE_DATE_CUR (startDateIn date) is
272: select rowid,
273: END_DATE
274: from AME_ATTRIBUTE_USAGES
275: where ATTRIBUTE_ID = X_ATTRIBUTE_ID
276: and APPLICATION_ID = X_APPLICATION_ID
277: and START_DATE >= STARTDATEIN
278: order by START_DATE;

Line 291: from AME_ATTRIBUTE_USAGES

287: if(to_date(X_CURRENT_LAST_UPDATE_DATE,'YYYY/MM/DD HH24:MI:SS') >=
288: to_date(X_LAST_UPDATE_DATE,'YYYY/MM/DD HH24:MI:SS')) then
289: select min(START_DATE)
290: into minStartDate
291: from AME_ATTRIBUTE_USAGES
292: where ATTRIBUTE_ID = X_ATTRIBUTE_ID
293: and APPLICATION_ID = X_APPLICATION_ID
294: and LAST_UPDATED_BY not in (1,120);
295: recCounter := 0;

Line 307: update ame_attribute_usages

303: X_CURRENT_LAST_UPDATE_DATE := lastUpdateDate;
304: else
305: endDate := lastUpdateDate;
306: end if;
307: update ame_attribute_usages
308: set start_date = startDate,
309: end_date = endDate,
310: creation_date = creationDate,
311: last_update_date = lastUpdateDate

Line 316: update AME_ATTRIBUTE_USAGES

312: where rowid = rec.rowid;
313: recCounter := recCounter + 1;
314: end loop;
315: end if;
316: update AME_ATTRIBUTE_USAGES
317: set LAST_UPDATED_BY = 1
318: where ATTRIBUTE_ID = X_ATTRIBUTE_ID
319: and APPLICATION_ID = X_APPLICATION_ID;
320: exception

Line 322: ame_util.runtimeException('ame_attribute_usages_api',

318: where ATTRIBUTE_ID = X_ATTRIBUTE_ID
319: and APPLICATION_ID = X_APPLICATION_ID;
320: exception
321: when others then
322: ame_util.runtimeException('ame_attribute_usages_api',
323: 'RECTIFY_RULE_MOD_SEED_USAGE',
324: sqlcode,
325: sqlerrm);
326: raise;

Line 357: ame_util.runtimeException(packageNameIn => 'ame_attribute_usages_api',

353: when invalidIsStaticException then
354: errorCode := -20001;
355: errorMessage :=
356: 'OAM is attempting to upload an attribute usage that is neither static or dynamic. ';
357: ame_util.runtimeException(packageNameIn => 'ame_attribute_usages_api',
358: routineNameIn => 'validate_is_static',
359: exceptionNumberIn => errorCode,
360: exceptionStringIn => errorMessage);
361: raise_application_error(errorCode,

Line 364: ame_util.runtimeException('ame_attribute_usages_api',

360: exceptionStringIn => errorMessage);
361: raise_application_error(errorCode,
362: errorMessage);
363: when others then
364: ame_util.runtimeException('ame_attribute_usages_api',
365: 'validate_is_static',
366: sqlcode,
367: sqlerrm);
368: raise;

Line 390: ame_util.runtimeException(packageNameIn => 'ame_attribute_usages_api',

386: when invalidRejectionException then
387: errorCode := -20001;
388: errorMessage :=
389: 'OAM is attempting to upload a REJECTION RESPONSE attribute with an invalid usage. ';
390: ame_util.runtimeException(packageNameIn => 'ame_attribute_usages_api',
391: routineNameIn => 'validate_rejection',
392: exceptionNumberIn => errorCode,
393: exceptionStringIn => errorMessage);
394: raise_application_error(errorCode,

Line 397: ame_util.runtimeException('ame_attribute_usages_api',

393: exceptionStringIn => errorMessage);
394: raise_application_error(errorCode,
395: errorMessage);
396: when others then
397: ame_util.runtimeException('ame_attribute_usages_api',
398: 'validate_rejection',
399: sqlcode,
400: sqlerrm);
401: raise;

Line 446: from AME_ATTRIBUTE_USAGES

442: select ROWID, USER_EDITABLE,
443: LAST_UPDATED_BY,
444: to_char(LAST_UPDATE_DATE,'YYYY/MM/DD HH24:MI:SS'),
445: nvl(OBJECT_VERSION_NUMBER,1)
446: from AME_ATTRIBUTE_USAGES
447: where ATTRIBUTE_ID = X_ATTRIBUTE_ID
448: and APPLICATION_ID = X_APPLICATION_ID
449: and sysdate between START_DATE
450: and nvl(END_DATE - (1/86400), sysdate);

Line 601: insert into AME_ATTRIBUTE_USAGES

597: X_VALUE_SET_ID in NUMBER,
598: X_OBJECT_VERSION_NUMBER in NUMBER)
599: is
600: begin
601: insert into AME_ATTRIBUTE_USAGES
602: (ATTRIBUTE_ID,
603: APPLICATION_ID,
604: QUERY_STRING,
605: USE_COUNT,

Line 641: update AME_ATTRIBUTE_USAGES set

637: X_USAGES_ROWID in VARCHAR2,
638: X_END_DATE in DATE)
639: is
640: begin
641: update AME_ATTRIBUTE_USAGES set
642: END_DATE = X_END_DATE
643: where ROWID = X_USAGES_ROWID;
644: end UPDATE_ROW;
645:

Line 663: update AME_ATTRIBUTE_USAGES

659: X_END_DATE in DATE,
660: X_OBJECT_VERSION_NUMBER in NUMBER
661: ) is
662: begin
663: update AME_ATTRIBUTE_USAGES
664: set QUERY_STRING = X_QUERY_STRING,
665: USE_COUNT = X_USE_COUNT,
666: IS_STATIC = X_IS_STATIC,
667: USER_EDITABLE = X_USER_EDITABLE,

Line 685: delete from AME_ATTRIBUTE_USAGES

681: X_ATTRIBUTE_ID in NUMBER,
682: X_APPLICATION_ID in NUMBER
683: ) is
684: begin
685: delete from AME_ATTRIBUTE_USAGES
686: where ATTRIBUTE_ID = X_ATTRIBUTE_ID
687: and APPLICATION_ID = X_APPLICATION_ID;
688:
689: if (sql%notfound) then

Line 712: X_CALCULATED_USE_COUNT ame_attribute_usages.use_count%type;

708: X_APPLICATION_ID NUMBER;
709: X_CREATED_BY NUMBER;
710: X_CURRENT_LAST_UPDATE_DATE VARCHAR2(19);
711: X_CURRENT_OWNER VARCHAR2(100);
712: X_CALCULATED_USE_COUNT ame_attribute_usages.use_count%type;
713: X_CURRENT_USER_EDITABLE ame_attribute_usages.user_editable%type;
714: X_LAST_UPDATED_BY NUMBER;
715: X_LAST_UPDATE_LOGIN NUMBER;
716: X_LINE_ATTRIBUTE_NAME ame_attributes.name%type := null;

Line 713: X_CURRENT_USER_EDITABLE ame_attribute_usages.user_editable%type;

709: X_CREATED_BY NUMBER;
710: X_CURRENT_LAST_UPDATE_DATE VARCHAR2(19);
711: X_CURRENT_OWNER VARCHAR2(100);
712: X_CALCULATED_USE_COUNT ame_attribute_usages.use_count%type;
713: X_CURRENT_USER_EDITABLE ame_attribute_usages.user_editable%type;
714: X_LAST_UPDATED_BY NUMBER;
715: X_LAST_UPDATE_LOGIN NUMBER;
716: X_LINE_ATTRIBUTE_NAME ame_attributes.name%type := null;
717: X_LINE_ITEM_ID_QUERY ame_attribute_usages.query_string%type;

Line 717: X_LINE_ITEM_ID_QUERY ame_attribute_usages.query_string%type;

713: X_CURRENT_USER_EDITABLE ame_attribute_usages.user_editable%type;
714: X_LAST_UPDATED_BY NUMBER;
715: X_LAST_UPDATE_LOGIN NUMBER;
716: X_LINE_ATTRIBUTE_NAME ame_attributes.name%type := null;
717: X_LINE_ITEM_ID_QUERY ame_attribute_usages.query_string%type;
718: X_QUERY_STRING_OUT ame_attribute_usages.query_string%type;
719: X_USAGES_ROWID ROWID;
720: X_VALUE_SET_ID NUMBER;
721: X_CURRENT_OVN NUMBER;

Line 718: X_QUERY_STRING_OUT ame_attribute_usages.query_string%type;

714: X_LAST_UPDATED_BY NUMBER;
715: X_LAST_UPDATE_LOGIN NUMBER;
716: X_LINE_ATTRIBUTE_NAME ame_attributes.name%type := null;
717: X_LINE_ITEM_ID_QUERY ame_attribute_usages.query_string%type;
718: X_QUERY_STRING_OUT ame_attribute_usages.query_string%type;
719: X_USAGES_ROWID ROWID;
720: X_VALUE_SET_ID NUMBER;
721: X_CURRENT_OVN NUMBER;
722: X_LOCK_HANDLE varchar2(500);

Line 896: from ame_attribute_usages

892: if X_RETURN_VALUE = 0 then
893: begin
894: select START_DATE
895: into l_current_db_date
896: from ame_attribute_usages
897: where ATTRIBUTE_ID = X_ATTRIBUTE_ID
898: and sysdate between START_DATE and nvl(END_DATE-(1/86400),sysdate);
899: if l_current_db_date >= X_LAST_UPDATE_DATE then
900: return;

Line 940: ame_util.runtimeException('ame_attribute_usages_api',

936: end if;
937: end;
938: exception
939: when others then
940: ame_util.runtimeException('ame_attribute_usages_api',
941: 'load_row',
942: sqlcode,
943: sqlerrm);
944: raise;

Line 978: END AME_ATTRIBUTE_USAGES_API;

974: ,X_CUSTOM_MODE => X_CUSTOM_MODE
975: );
976: end if;
977: end LOAD_SEED_ROW;
978: END AME_ATTRIBUTE_USAGES_API;