rem rem $Header: L:\\\\model\\repman40\\api\\RCS\\CIFUNENT.HPB 1.2 1998/12/30 14:55:06 loldham Exp $ rem Rem Copyright (c) 1994 by Oracle Corporation Rem NAME Rem cifunent.hpb - Rem DESCRIPTION Rem Rem RETURNS Rem Rem NOTES Rem Rem MODIFIED (MM/DD/YY) Rem aheath 07/08/94 - Creation REM *************************************************************************** REM Hand-carved package body for Function Entity Usage created on 14-FEB-94 REM *************************************************************************** CREATE OR REPLACE PACKAGE BODY cihfunent IS -- Type-specific post-process routines PROCEDURE check_delete(id rm.reference); str_type constant varchar2(6) := 'FUNENT'; part_type constant varchar2(6) := 'FUN'; use_type constant varchar2(6) := 'ENT'; entity_reference rm.reference; function_reference rm.reference; --======================== PRE-PROCESS (INS,UPD) ============================-- PROCEDURE pre_process(operation varchar2,id rm.reference, pl in out NOCOPY ciofunction_entity_usage.data) IS BEGIN -- Perform INSERT-specific processing if operation = 'INS' then -- Check for existence of function and entity -- elements if ciiutl.el_exists(pl.v.function_reference,part_type) = false then ciierr.fatal(3500,'FUNCTION ENTITY USAGE','function', pl.v.function_reference); end if; if ciiutl.el_exists(pl.v.entity_reference,use_type) = false then ciierr.fatal(3500,'FUNCTION ENTITY USAGE','entity', pl.v.entity_reference); end if ; else if ciiutl.el_exists(id,str_type) = false then ciierr.fatal(3504,ciiutl.nls_type_name('FUNCTION_ENTITY_USAGE'),id); end if; end if; -- Access control checks -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_pac(pl.v.function_reference,part_type,'UPD'); -- if operation = 'INS' then -- ciiacc.check_access_rights(pl.v.entity_reference, use_type,'SEL','SHR'); -- end if; -- Check that function entity usage with this function and -- entity doesn't already exist on insert -- CHECK REPLACED BY DEFERRED CONSTRAINT AT 4.0.6 if operation = 'INS' then -- Assign miscellaneous initial default values pl.v.element_type_name := str_type; pl.i.element_type_name := true; end if; -- Check that the referenced ENTITY is connected to the context app sys if ciiutl.in_context_appsys(pl.v.entity_reference,'ENT') = false then ciierr.fatal(6004,ciiutl.identify(pl.v.entity_reference, 'ENT'), ciiutl.identify(cdapi.app_sys_ref, 'CEL')); end if; -- Validate user-defined properties if cieval.is_extended then cieval.check_association(id,pl.v.types,(operation='UPD') ,pl.v.function_reference ,pl.v.entity_reference ,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; END; --======================== PRE-PROCESS (DEL,SEL) ============================-- PROCEDURE pre_process(operation varchar2,id rm.reference) IS pac_reference rm.reference; BEGIN -- Access rights for a Function Entity Usage derive from the referenced -- Function's rights -- Access rights checking performed by triggers in config 4.0.9 /* select max(ci.function_reference),max(ci.entity_reference) into function_reference,entity_reference from ci_function_entity_usages ci where ci.id = pre_process.id; pac_reference := function_reference; if operation = 'DEL' and pac_reference is not null then ciiacc.check_pac(pac_reference,part_type,'UPD'); elsif pac_reference is not null then ciiacc.check_pac(pac_reference,part_type,operation); end if; */ null; END; --===================== POST-PROCESS (INS,UPD,SEL) ==========================-- PROCEDURE post_process(operation varchar2,id rm.reference, pl ciofunction_entity_usage.data) IS BEGIN -- Check that the null flags are null also in corresponding FUNATT's if operation in ('INS','UPD') and (pl.i.create_flag or pl.i.retrieve_flag or pl.i.update_flag) then for funatt in (select id from ci_function_attribute_usages where funent_reference = pl.v.id) loop rmman.log_change('CIHFUNATTE_USAGE',funatt.id); end loop; end if; END; --========================= POST PROCESS (DEL) ==============================-- PROCEDURE post_process(operation varchar2,id rm.reference) IS BEGIN if operation = 'DEL' then -- Delete all function_attribute_usages associated with this funent for funatt in (select id,types from ci_function_attribute_usages where function_reference = cihfunent.function_reference and entity_reference = cihfunent.entity_reference) loop ciofunction_attribute_usage.del(funatt.id); end loop; end if; END; --============================= CHECK DELETE ================================-- PROCEDURE check_delete(id rm.reference) IS dummy varchar2(1); BEGIN -- Check if non-cascading associations and references exist null; END; --================================== END ====================================-- -- -- Package instantiation block -- BEGIN is_installed := true; END; /