REM *************************************************************************** REM Hand-carved package body for ATTRIBUTE DERIVATION RULE created on 13-JAN-99 REM *************************************************************************** CREATE OR REPLACE PACKAGE BODY cihadr IS -- Generic post-process routines PROCEDURE check_delete(id number); sac_type constant varchar2(6) := 'ADR'; pac_type constant varchar2(6) := 'CAT'; --======================== PRE-PROCESS (INS,UPD) ============================-- PROCEDURE pre_process(operation varchar2,id number, pl in out NOCOPY cioattribute_derivation_rule.data) IS dummy number; eat_data cioentity_object_attribute.data; BEGIN -- Access rights for attribute derivation rule derive from the classifier attribute -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_access_rights(pl.v.classifier_attribute_reference,pac_type, -- 'UPD','SAC'); -- Initialize unassigned properties with default values on INSERT if operation = 'INS' then pl.v.element_type_name := sac_type; pl.i.element_type_name := true; --If owning object is EAT then set persitent flag for that eat to N select count(*) into dummy from sdd_cat where classifier_attribute_subtype = 'EAT' and irid = pl.v.classifier_attribute_reference; if dummy > 0 then eat_data.v.persistent_flag := 'N'; eat_data.i.persistent_flag := true; cioentity_object_attribute.upd(pl.v.classifier_attribute_reference, eat_data); end if; end if; --Maintain the out_of_sync_flag for a corresponding file_usage ciheoc.maintain_sync_flag(pl.v.pac_reference); END; --======================== PRE-PROCESS (DEL,SEL) ============================-- PROCEDURE pre_process(operation varchar2,id number) IS BEGIN -- Access rights for attribute derivation rule derive from the classifier attribute -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_access_rights(id,sac_type,operation,'SAC'); -- 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 cioattribute_derivation_rule.data) IS BEGIN null; END; --========================= POST PROCESS (DEL) ==============================-- PROCEDURE post_process(operation varchar2,id number) IS BEGIN null; END; --============================= CHECK DELETE ================================-- PROCEDURE check_delete(id number) IS dummy number; error_count number := 0; CURSOR file_c(irid_ref number) IS select pac_reference cla from ci_attribute_derivation_rules where irid = irid_ref; BEGIN FOR file_rec IN file_c(check_delete.id) LOOP --Maintain the out_of_sync_flag for a corresponding file_usage ciheoc.maintain_sync_flag(file_rec.cla); END LOOP; END; --================================== END ====================================-- -- -- Package instantiation block -- BEGIN is_installed := true; END; /