rem rem $Header: L:\\\\model\\repman40\\api\\RCS\\CIBUN.HPB 1.3 1998/11/10 11:38:49 loldham Exp $ rem Rem Copyright (c) 1994 by Oracle Corporation Rem NAME Rem cibun.hpb - Rem DESCRIPTION Rem Rem RETURNS Rem Rem NOTES Rem Rem MODIFIED (MM/DD/YY) Rem L Oldham 10/11/98 - Update sdd_bun instead of ci_business_units Rem jwetherb 10/12/94 - Rebuilt package REM *************************************************************************** REM Hand-carved package body for BUSINESS UNIT created on 13-OCT-94 REM *************************************************************************** CREATE OR REPLACE PACKAGE BODY cihbun IS -- Generic post-process routines PROCEDURE check_delete(id number); pac_type constant varchar2(6) := 'BUN'; --======================== PRE-PROCESS (INS,UPD) ============================-- PROCEDURE pre_process(operation varchar2,id number, pl in out NOCOPY ciobusiness_unit.data) IS par ciobusiness_unit.data; BEGIN -- Access control checks -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_access_rights(pl.v.id,pac_type,operation,'SHR'); -- Validate user-defined properties if cieval.is_extended then cieval.check_element(id,pl.v.types,(operation='UPD') ,pl.v.user_defined_property_0,pl.i.user_defined_property_0 ,pl.v.user_defined_property_1,pl.i.user_defined_property_1 ,pl.v.user_defined_property_2,pl.i.user_defined_property_2 ,pl.v.user_defined_property_3,pl.i.user_defined_property_3 ,pl.v.user_defined_property_4,pl.i.user_defined_property_4 ,pl.v.user_defined_property_5,pl.i.user_defined_property_5 ,pl.v.user_defined_property_6,pl.i.user_defined_property_6 ,pl.v.user_defined_property_7,pl.i.user_defined_property_7 ,pl.v.user_defined_property_8,pl.i.user_defined_property_8 ,pl.v.user_defined_property_9,pl.i.user_defined_property_9 ,pl.v.user_defined_property_10,pl.i.user_defined_property_10 ,pl.v.user_defined_property_11,pl.i.user_defined_property_11 ,pl.v.user_defined_property_12,pl.i.user_defined_property_12 ,pl.v.user_defined_property_13,pl.i.user_defined_property_13 ,pl.v.user_defined_property_14,pl.i.user_defined_property_14 ,pl.v.user_defined_property_15,pl.i.user_defined_property_15 ,pl.v.user_defined_property_16,pl.i.user_defined_property_16 ,pl.v.user_defined_property_17,pl.i.user_defined_property_17 ,pl.v.user_defined_property_18,pl.i.user_defined_property_18 ,pl.v.user_defined_property_19,pl.i.user_defined_property_19 ); end if; -- Initialize unassigned properties with default values on INSERT if operation = 'INS' then pl.v.element_type_name := pac_type; pl.i.element_type_name := true; end if; -- Config 4.0.12 Bug 994810 remove code to populate decomp_flag and parent_name END; --======================== PRE-PROCESS (DEL,SEL) ============================-- PROCEDURE pre_process(operation varchar2,id number) IS BEGIN -- Access control checks -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_access_rights(id,pac_type,operation,'SHR'); -- if operation is 'DELETE', make sure no non-cascading references exist if operation = 'DEL' then check_delete(id); end if; END; --===================== POST-PROCESS (INS,UPD,SEL) ==========================-- PROCEDURE post_process(operation varchar2,id number, pl ciobusiness_unit.data) IS BEGIN if operation = 'INS' then ciiutl.create_appxxx(pac_type,pl.v.id,pl.v.name); elsif operation = 'UPD' and (pl.i.name or pl.i.short_name) then cioapp_con_interface.traverse('CIHAPPCONU1',id,'APPBUN'); end if; if pl.i.parent_reference then rmman.log_change('CIHBUNU1',pl.v.id); end if; END; --========================= POST PROCESS (DEL) ==============================-- PROCEDURE post_process(operation varchar2,id number) IS BEGIN if operation = 'DEL' then -- Delete the business unit and all it's related sub-bits ciiutl.delete_element(id,pac_type); end if; END; --============================= CHECK DELETE ================================-- PROCEDURE check_delete(id number) IS dummy number; error_count number := 0; BEGIN -- 4.0.12 Config, Bug 908351 -- Following blocks have been removed from API as now handled by triggers -- Check if this business unit is connected to other application systems -- Check if any business unit to objectives are connected to me -- Check if any business unit to problems are connected to me -- Check if any business unit use of nodes are connected to me -- Check if any datastores are connected to me -- Check if any entity business units are connected to me -- Check if any externals are connected to me -- Check if any function business units are connected to me -- Check if any module business units are connected to me -- Check if any planning items are connected to me null; END; --================================== END ====================================-- -- -- Package instantiation block -- BEGIN is_installed := true; END; /