DBA Data[Home] [Help]

APPS.AMW_ORG_HIERARCHY_PKG dependencies on AMW_LATEST_HIERARCHIES

Line 21: from amw_latest_hierarchies

17: l_dummy number;
18: begin
19: select parent_id
20: into l_dummy
21: from amw_latest_hierarchies
22: where parent_id = p_child_process_id
23: start with child_id = p_parent_process_id and organization_id = p_org_id
24: connect by prior parent_id = child_id
25: and organization_id = p_org_id;

Line 512: l_child_order_num amw_latest_hierarchies.child_order_number%type;

508: p_child_process_id in number,
509: p_action in varchar2)
510: is
511: l_dummy number;
512: l_child_order_num amw_latest_hierarchies.child_order_number%type;
513: l_curr_log_level number := FND_LOG.G_CURRENT_RUNTIME_LEVEL;
514: l_log_stmt_level number := FND_LOG.LEVEL_STATEMENT;
515:
516: begin

Line 541: insert into amw_latest_hierarchies

537: revise_process_if_necessary(p_org_id, p_parent_process_id);
538:
539: --insert the latest hierarchy table
540: if p_action = 'ADD' then
541: insert into amw_latest_hierarchies
542: (ORGANIZATION_ID, PARENT_ID, CHILD_ID, CHILD_ORDER_NUMBER, LAST_UPDATE_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN, CREATION_DATE, CREATED_BY, object_version_number)
543: VALUES
544: (p_org_id,p_parent_process_id,p_child_process_id,AMW_ORG_CHILD_ORDER_S.nextval, sysdate, G_USER_ID, G_LOGIN_ID, sysdate, G_USER_ID, 1)
545: returning CHILD_ORDER_NUMBER

Line 553: delete from amw_latest_hierarchies

549: p_parent_id => p_parent_process_id,
550: p_child_id => p_child_process_id,
551: p_instance_id => l_child_order_num);
552: elsif p_action = 'DEL' then
553: delete from amw_latest_hierarchies
554: where parent_id = p_parent_process_id
555: and child_id = p_child_process_id
556: and organization_id = p_org_id;
557: end if;

Line 632: insert into amw_latest_hierarchies

628: revise_process_if_necessary(p_org_id, p_parent_process_id);
629:
630: --insert the latest hierarchy table
631: if p_action = 'ADD' then
632: insert into amw_latest_hierarchies
633: (ORGANIZATION_ID, PARENT_ID, CHILD_ID, CHILD_ORDER_NUMBER, LAST_UPDATE_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN, CREATION_DATE, CREATED_BY, object_version_number)
634: VALUES
635: (p_org_id,p_parent_process_id,p_child_process_id,AMW_ORG_CHILD_ORDER_S.nextval, sysdate, G_USER_ID, G_LOGIN_ID, sysdate, G_USER_ID, 1);
636: elsif p_action = 'DEL' then

Line 637: delete from amw_latest_hierarchies

633: (ORGANIZATION_ID, PARENT_ID, CHILD_ID, CHILD_ORDER_NUMBER, LAST_UPDATE_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN, CREATION_DATE, CREATED_BY, object_version_number)
634: VALUES
635: (p_org_id,p_parent_process_id,p_child_process_id,AMW_ORG_CHILD_ORDER_S.nextval, sysdate, G_USER_ID, G_LOGIN_ID, sysdate, G_USER_ID, 1);
636: elsif p_action = 'DEL' then
637: delete from amw_latest_hierarchies
638: where parent_id = p_parent_process_id
639: and child_id = p_child_process_id
640: and organization_id = p_org_id;
641: end if;

Line 846: insert into amw_latest_hierarchies

842: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT,
843: 'amw.plsql.AMW_ORG_HIERARCHY_PKG.IMPORT_RLPROC_AS_CHILD_OF_EX.insert_latest_hierarchy','insert_latest_hierarchy' );
844: end if;
845: --insert into latest hierarchy table
846: insert into amw_latest_hierarchies
847: (ORGANIZATION_ID, PARENT_ID, CHILD_ID, CHILD_ORDER_NUMBER, LAST_UPDATE_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN, CREATION_DATE, CREATED_BY, object_version_number)
848: VALUES
849: (p_org_id,p_parent_process_id,p_child_process_id,AMW_ORG_CHILD_ORDER_S.nextval, sysdate, G_USER_ID, G_LOGIN_ID, sysdate, G_USER_ID, 1);
850:

Line 1884: delete from amw_latest_hierarchies

1880: end if;
1881:
1882:
1883: -- first delete all children of this process in the org.
1884: delete from amw_latest_hierarchies
1885: where parent_id = p_parent_process_id
1886: and organization_id = p_org_id;
1887:
1888:

Line 2069: delete from amw_latest_hierarchies

2065: begin
2066:
2067: -- first delete all children of this process in the org.
2068: FORALL indx IN Org_Ids.FIRST .. Org_Ids.LAST
2069: delete from amw_latest_hierarchies
2070: where parent_id = p_parent_process_id
2071: and organization_id = Org_Ids(indx);
2072:
2073: FOR indx IN Org_Ids.FIRST .. Org_Ids.LAST

Line 2367: /*delete from amw_latest_hierarchies

2363: exit when c3%notfound;
2364: l_child_process_id := c3_rec.child_process_id;
2365:
2366: -- Remove the link between the parent process and the child process...
2367: /*delete from amw_latest_hierarchies
2368: where child_id = l_child_process_id
2369: and parent_id = p_process_id
2370: and organization_id = p_org_id;*/
2371: /*commenting the above delete and adding the following update

Line 2374: update amw_latest_hierarchies

2370: and organization_id = p_org_id;*/
2371: /*commenting the above delete and adding the following update
2372: so that when a process is dissasociated and approved,the
2373: children will also be approved using the below link*/
2374: update amw_latest_hierarchies
2375: set organization_id = organization_id * (-1),
2376: object_version_number = object_version_number + 1,
2377: LAST_UPDATE_DATE = sysdate,
2378: LAST_UPDATED_BY = g_user_id,

Line 2391: from amw_latest_hierarchies

2387: if not process_locked(l_child_process_id, p_org_id) then
2388: -- So we can update this to be deleted. But need to check whether this is existing as a child of any other process
2389: begin
2390: select 1 into l_dummy
2391: from amw_latest_hierarchies
2392: where child_id = l_child_process_id
2393: and organization_id = p_org_id
2394: and parent_id <> p_process_id;
2395:

Line 2407: -- delete from amw_latest_hierarchies

2403: end;
2404:
2405: if l_exists_elsewhere = false then
2406: -- So the Process does not exist any where..Delete from latest hierarchy..
2407: -- delete from amw_latest_hierarchies
2408: -- where child_id = l_child_process_id
2409: -- and parent_id = p_process_id
2410: -- and organization_id = p_org_id;
2411: -- We need to process the child hierarchy now to disassociate --So call disassociate_proc_org_hier on child.

Line 2450: delete from amw_latest_hierarchies

2446: end loop;
2447:
2448: --ko 3. So revised all the necessary parents. No go ahead and delete them from the latest hierarchy.
2449: -- delete all the links from latest hierarchy where p_process_id is child
2450: delete from amw_latest_hierarchies
2451: where child_id = p_process_id
2452: and organization_id = p_org_id;
2453: --remove the rcm links...dpatel
2454: delete_existing_rcm(p_process_id,p_org_id);

Line 2484: from amw_latest_hierarchies

2480: (select process_id
2481: from amw_process_organization
2482: where organization_id = p_org_id
2483: and process_id in ( select parent_id
2484: from amw_latest_hierarchies
2485: start with child_id = p_process_id and organization_id = p_org_id
2486: connect by prior parent_id = child_id
2487: and organization_id = p_org_id
2488: union all

Line 2538: from amw_latest_hierarchies

2534: select distinct risk_id from amw_risk_associations
2535: where pk1 = p_org_id
2536: and pk2 in (
2537: select child_id
2538: from amw_latest_hierarchies
2539: start with child_id = x(ctr) and organization_id = p_org_id
2540: connect by prior child_id = parent_id and organization_id = p_org_id
2541: )
2542: /* ko removing the usage of amw_org_hierarchy_denorm

Line 2578: from amw_latest_hierarchies

2574: select process_id
2575: from amw_process_organization
2576: where organization_id = p_org_id
2577: and process_id in ( select parent_id
2578: from amw_latest_hierarchies
2579: start with child_id = p_process_id and organization_id = p_org_id
2580: connect by prior parent_id = child_id
2581: and organization_id = p_org_id
2582: union all

Line 2631: from amw_latest_hierarchies

2627: set control_count_latest = (select count(*) from (
2628: select distinct control_id from amw_control_associations
2629: where pk1 = p_org_id
2630: and pk2 in ( select child_id
2631: from amw_latest_hierarchies
2632: start with child_id = x(ctr) and organization_id = p_org_id
2633: connect by prior child_id = parent_id and organization_id = p_org_id
2634: )
2635: /* ko remove org_denorm

Line 3053: from amw_latest_hierarchies alh

3049: set APO.risk_count_latest = (
3050: select count(distinct ARA.risk_id) from amw_risk_associations ARA
3051: where ARA.pk1 = APO.ORGANIZATION_ID
3052: and ARA.pk2 in ( select alh.child_id
3053: from amw_latest_hierarchies alh
3054: start with alh.child_id = APO.PROCESS_ID and alh.organization_id = APO.ORGANIZATION_ID
3055: connect by prior alh.child_id = alh.parent_id and alh.organization_id = APO.ORGANIZATION_ID
3056: )
3057: --ko replacing the below clause for removing amw_org_hierarchy_denorm usage...

Line 3074: from amw_latest_hierarchies alh

3070: APO.control_count_latest = (
3071: select count(distinct ACA.CONTROL_ID) from amw_control_associations ACA
3072: where ACA.pk1 = APO.ORGANIZATION_ID
3073: and ACA.pk2 in ( select alh.child_id
3074: from amw_latest_hierarchies alh
3075: start with alh.child_id = APO.PROCESS_ID and alh.organization_id = APO.ORGANIZATION_ID
3076: connect by prior alh.child_id = alh.parent_id and alh.organization_id = APO.ORGANIZATION_ID
3077: )
3078: --ko replacing the below clause for removing amw_org_hierarchy_denorm usage...

Line 3106: from amw_latest_hierarchies alh

3102: set APO.risk_count_latest = (
3103: select count(distinct ARA.risk_id) from amw_risk_associations ARA
3104: where ARA.pk1 = APO.ORGANIZATION_ID
3105: and ARA.pk2 in ( select alh.child_id
3106: from amw_latest_hierarchies alh
3107: start with alh.child_id = APO.PROCESS_ID and alh.organization_id = APO.ORGANIZATION_ID
3108: connect by prior alh.child_id = alh.parent_id and alh.organization_id = APO.ORGANIZATION_ID
3109: )
3110: --ko replacing the below clause for removing amw_org_hierarchy_denorm usage...

Line 3127: from amw_latest_hierarchies alh

3123: APO.control_count_latest = (
3124: select count(distinct ACA.CONTROL_ID) from amw_control_associations ACA
3125: where ACA.pk1 = APO.ORGANIZATION_ID
3126: and ACA.pk2 in ( select alh.child_id
3127: from amw_latest_hierarchies alh
3128: start with alh.child_id = APO.PROCESS_ID and alh.organization_id = APO.ORGANIZATION_ID
3129: connect by prior alh.child_id = alh.parent_id and alh.organization_id = APO.ORGANIZATION_ID
3130: )
3131: --ko replacing the below clause for removing amw_org_hierarchy_denorm usage...

Line 3601: from amw_latest_hierarchies alh

3597: set risk_count_latest = (select count(*) from (
3598: select distinct risk_id from amw_risk_associations
3599: where pk1 = l_orgs_tbl(ctr)
3600: and pk2 in (select alh.child_id
3601: from amw_latest_hierarchies alh
3602: start with alh.child_id = l_procs_tbl(ctr) and alh.organization_id = l_orgs_tbl(ctr)
3603: connect by prior alh.child_id = alh.parent_id and alh.organization_id = l_orgs_tbl(ctr)
3604: )
3605: --ko replacing the below clause for removing amw_org_hierarchy_denorm usage...

Line 3622: from amw_latest_hierarchies alh

3618: control_count_latest = (select count(*) from (
3619: select distinct control_id from amw_control_associations
3620: where pk1 = l_orgs_tbl(ctr)
3621: and pk2 in (select alh.child_id
3622: from amw_latest_hierarchies alh
3623: start with alh.child_id = l_procs_tbl(ctr) and alh.organization_id = l_orgs_tbl(ctr)
3624: connect by prior alh.child_id = alh.parent_id and alh.organization_id = l_orgs_tbl(ctr)
3625: )
3626: --ko replacing the below clause for removing amw_org_hierarchy_denorm usage...

Line 4081: from amw_latest_hierarchies

4077:
4078: BEGIN
4079: -- dO not add if the relation ship already exists in the latest hierarchy
4080: SELECT 1 INTo l_dummy
4081: from amw_latest_hierarchies
4082: where organization_id = p_organization_id
4083: and parent_id = p_parent_id
4084: and child_id = p_child_id;
4085:

Line 4652: from amw_latest_hierarchies

4648: and organization_id = p_organization_id
4649: and (end_date is null or end_date > sysdate)
4650: and child_id not in
4651: (select child_id
4652: from amw_latest_hierarchies
4653: where parent_id = p_process_id
4654: and organization_id = p_organization_id);
4655: exception
4656: when no_data_found then

Line 4660: from amw_latest_hierarchies

4656: when no_data_found then
4657: begin
4658: select child_id
4659: into l_dummy
4660: from amw_latest_hierarchies
4661: where parent_id = p_process_id
4662: and organization_id = p_organization_id
4663: and child_id not in
4664: (select child_id

Line 4799: from amw_latest_hierarchies

4795: l_risk_exists boolean :=false;
4796: l_control_exists boolean :=false;
4797: cursor parents(orgId NUMBER, pid number) is
4798: select parent_id
4799: from amw_latest_hierarchies
4800: where child_id = pid
4801: and organization_id = orgId ;
4802:
4803: parent_rec parents%rowtype;

Line 4883: delete from amw_latest_hierarchies

4879: -- So process is deleted..so remove the process from hierarchy
4880: for parent_rec in parents(p_organization_id,p_process_id) loop
4881: exit when parents%notfound;
4882: revise_process_if_necessary(p_organization_id,parent_rec.parent_id);
4883: delete from amw_latest_hierarchies
4884: where parent_id = parent_rec.parent_id
4885: and child_id = p_process_id
4886: and organization_id = p_organization_id;
4887: end loop;

Line 4889: delete from amw_latest_hierarchies

4885: and child_id = p_process_id
4886: and organization_id = p_organization_id;
4887: end loop;
4888:
4889: delete from amw_latest_hierarchies
4890: where parent_id = p_process_id
4891: and organization_id = p_organization_id;
4892: exception
4893: when no_data_found then

Line 4904: delete from amw_latest_hierarchies

4900:
4901: for parent_rec in parents(p_organization_id,p_process_id) loop
4902: exit when parents%notfound;
4903: revise_process_if_necessary(p_organization_id,parent_rec.parent_id);
4904: delete from amw_latest_hierarchies
4905: where parent_id = parent_rec.parent_id
4906: and child_id = p_process_id
4907: and organization_id = p_organization_id;
4908: end loop;

Line 4910: delete from amw_latest_hierarchies

4906: and child_id = p_process_id
4907: and organization_id = p_organization_id;
4908: end loop;
4909:
4910: delete from amw_latest_hierarchies
4911: where parent_id = p_process_id
4912: and organization_id = p_organization_id;
4913: delete from amw_process_organization where process_id = p_process_id and organization_id = p_organization_id;
4914:

Line 8040: delete from amw_latest_hierarchies

8036: end if;
8037: select SUBSTR(l_child_string, 1, diff) into childstr from dual;
8038: l_child_id := to_number(childstr);
8039:
8040: delete from amw_latest_hierarchies
8041: where parent_id = p_parent_process_id
8042: and child_id = l_child_id
8043: and organization_id = p_organization_id;
8044:

Line 8082: l_child_order_num amw_latest_hierarchies.child_order_number%type;

8078: diff number;
8079: childstr varchar2(100);
8080: l_child_string varchar2(4000);
8081: l_child_id number;
8082: l_child_order_num amw_latest_hierarchies.child_order_number%type;
8083:
8084: begin
8085: x_return_status := FND_API.G_RET_STS_SUCCESS;
8086: IF FND_API.to_Boolean( p_init_msg_list ) THEN

Line 8114: insert into amw_latest_hierarchies

8110: p_org_id => p_organization_id,
8111: p_parent_process_id => p_parent_process_id,
8112: p_child_process_id => l_child_id);
8113:
8114: insert into amw_latest_hierarchies
8115: (ORGANIZATION_ID, PARENT_ID, CHILD_ID, CHILD_ORDER_NUMBER, LAST_UPDATE_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN, CREATION_DATE, CREATED_BY, object_version_number)
8116: VALUES
8117: (p_organization_id,p_parent_process_id,l_child_id,AMW_ORG_CHILD_ORDER_S.nextval, sysdate, G_USER_ID, G_LOGIN_ID, sysdate, G_USER_ID, 1)
8118: returning CHILD_ORDER_NUMBER