REM *************************************************************************** REM Hand-carved package body for METHOD PARAMETER created on 07-DEC-98 REM *************************************************************************** CREATE OR REPLACE PACKAGE BODY cihmpa IS -- Generic post-process routines PROCEDURE check_delete(id number); PROCEDURE main_sync_flag(id number); sac_type constant varchar2(6) := 'MPA'; pac_type constant varchar2(6) := 'MET'; --======================== PRE-PROCESS (INS,UPD) ============================-- PROCEDURE pre_process(operation varchar2,id number, pl in out NOCOPY ciomethod_parameter.data) IS BEGIN -- Access rights for method parameter derive from the method -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_access_rights(pl.v.method_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 not pl.i.sequence then pl.v.sequence :=ciiexp.default_seq(pl.v.method_reference, sac_type, 10); pl.i.sequence :=true; end if; end if; -- Remove spaces from name pl.v.name := REPLACE (pl.v.name, ' ', NULL); pl.i.name := true; if pl.i.scalar_datatype and pl.v.scalar_datatype is not NULL then pl.v.datatype_format := 'SCALAR'; pl.v.classifier_reference := null; pl.i.classifier_reference := true; elsif pl.i.classifier_reference and pl.v.classifier_reference is not NULL then pl.v.datatype_format := 'CLASSIFIER'; pl.v.scalar_datatype := null; pl.i.scalar_datatype := false; elsif pl.v.classifier_reference is NULL and pl.v.scalar_datatype is NULL then pl.v.datatype_format := 'SCALAR'; pl.v.scalar_datatype := 'int'; pl.i.scalar_datatype := true; end if; pl.i.datatype_format := true; END; --======================== PRE-PROCESS (DEL,SEL) ============================-- PROCEDURE pre_process(operation varchar2,id number) IS BEGIN -- Access rights for method parameter derive from the method -- 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); main_sync_flag(pre_process.id); end if; END; --===================== POST-PROCESS (INS,UPD,SEL) ==========================-- PROCEDURE post_process(operation varchar2,id number, pl ciomethod_parameter.data) IS owning_classsifer number; BEGIN if operation = 'INS' or operation = 'UPD' then -- Maintain the out_of_sync_flag for any corresponding file_usages -- Should be maintained on INSERT and UPDATE main_sync_flag(post_process.id); end if; END; --========================= POST PROCESS (DEL, LCK) ==============================-- PROCEDURE post_process(operation varchar2,id number) IS CURSOR cfilpac IS select usage.primary_access_file_reference file_irid , usage.irid fu_irid from ci_file_usages usage , ci_method_parameters mpa where usage.classifier_reference = mpa.pac_reference and mpa.id = post_process.id; vfile_irid number; vfu_irid number; BEGIN if operation = 'LCK' then FOR files_rec IN cfilpac LOOP vfile_irid := files_rec.file_irid; vfu_irid := files_rec.fu_irid; cioprimary_access_file.lck(files_rec.file_irid); END LOOP; end if; EXCEPTION WHEN cioprimary_access_file.invalid_ref then ciierr.fatal(6089,ciiutl.identify(id, 'MPA'), to_char(vfile_irid), ciiutl.identify(vfu_irid, 'FILPAC')); raise; WHEN OTHERS then raise; END; --============================= CHECK DELETE ================================-- PROCEDURE check_delete(id number) IS BEGIN null; END; --============================= MAINTAIN SYNC FLAG =============================-- PROCEDURE main_sync_flag(id number) IS CURSOR file_c(irid_ref number) IS select pac_reference cla from ci_method_parameters where irid = irid_ref; BEGIN FOR file_rec IN file_c(main_sync_flag.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; /