rem rem $Header: L:\\\\model\\repman40\\api\\RCS\\cievt.hpb 1.3 1998/10/09 11:58:43 jkchow Exp $ rem Rem Copyright (c) 1994 by Oracle Corporation Rem NAME Rem cievt.hpb - Rem DESCRIPTION Rem Rem RETURNS Rem Rem NOTES Rem Rem MODIFIED (MM/DD/YY) Rem aheath 07/08/94 - Creation CREATE OR REPLACE PACKAGE BODY cihevt IS -- Generic pre-process routines PROCEDURE assign_insert_defaults(pl in out NOCOPY cioevent.data); PROCEDURE assign_derived_values(pl in out NOCOPY cioevent.data); -- PROCEDURE check_fatal_constraints(pl in out NOCOPY cioevent.data); -- Type-specific pre-process routines -- Type-specific post-process routines -- PROCEDURE check_delete(id rm.reference); -- plo cioevent.data; pac_type constant varchar2(6) := 'EVT'; --======================== PRE-PROCESS (INS,UPD) ============================-- PROCEDURE pre_process(operation varchar2,id rm.reference, pl in out NOCOPY cioevent.data) IS BEGIN -- Access control checks -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_pac(pl.v.id,pac_type,operation); -- Initialize unassigned properties with default values on INSERT if operation = 'INS' then assign_insert_defaults(pl); -- Cannot update 'end of function' events elsif operation = 'UPD' and pl.v.created_by = '#+SYSTEM+#' then ciierr.fatal(701,ciiutl.identify(pl.v.id, pl.v.types)); end if; -- 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; -- Assign denormalized and derived property values assign_derived_values(pl); END; --======================== PRE-PROCESS (DEL,SEL) ============================-- PROCEDURE pre_process(operation varchar2,id rm.reference) IS BEGIN -- access control checks -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_pac(id,pac_type,operation); -- if operation is 'DELETE', check that non-cascade references don't exist if operation = 'DEL' then for funevt in (select id,types from ci_event_triggers where (triggered_event_reference = pre_process.id or triggering_event_reference = pre_process.id)) loop cioevent_trigger.del(funevt.id); end loop; end if; END; --===================== POST-PROCESS (INS,UPD,SEL) ==========================-- PROCEDURE post_process(operation varchar2,id rm.reference,pl cioevent.data) IS BEGIN if operation = 'INS' then ciiutl.create_appxxx(pac_type,pl.v.id,pl.v.name); end if; if operation = 'UPD' and pl.i.name then cioapp_con_interface.traverse('CIHAPPCONU1',pl.v.id,'APPEVT'); end if; END; --========================= POST PROCESS (DEL) ==============================-- PROCEDURE post_process(operation varchar2,id rm.reference) IS BEGIN if operation = 'DEL' then -- Delete the event and all it's related sub-bits ciiutl.delete_element(id,pac_type); end if; END; --========================= ASSIGN INSERT DEFAULTS ==========================-- PROCEDURE assign_insert_defaults(pl in out NOCOPY cioevent.data) IS BEGIN -- Default the element_type_name, etc. --pl.v.application_system_name := cdapi.app_sys_name; --pl.i.application_system_name := true; pl.v.element_type_name := pac_type; pl.i.element_type_name := true; if pl.v.attribute_reference is not null then select max(ci.entity_reference) into pl.v.entity_reference from ci_attributes ci where ci.id = pl.v.attribute_reference; if pl.v.entity_reference is null then ciierr.fatal(3500,ciiutl.identify(pl.v.id, pl.v.types),'attribute', pl.v.attribute_reference); end if; end if; END; --========================= CHECK FATAL CONSTRAINTS =========================-- PROCEDURE check_fatal_constraints(pl in out NOCOPY cioevent.data) IS BEGIN null; END; --========================== ASSIGN DERIVED VALUES ==========================-- PROCEDURE assign_derived_values(pl in out NOCOPY cioevent.data) IS BEGIN if cdapi.load_mode then return; end if; if pl.i.event_type then if pl.v.event_type = 'TIME' then pl.v.attribute_reference := null; pl.i.attribute_reference := true; pl.v.entity_reference := null; pl.i.entity_reference := true; pl.v.system_description := null; pl.i.system_description := true; elsif pl.v.event_type = 'CHANGE' then pl.v.system_description := null; pl.i.system_description := true; pl.v.time := null; pl.i.time := true; pl.v.frequency := null; pl.i.frequency := true; pl.v.unit_of_frequency := null; pl.i.unit_of_frequency := true; elsif pl.v.event_type = 'SYSTEM' then pl.v.frequency := null; pl.i.frequency := true; pl.v.unit_of_frequency := null; pl.i.unit_of_frequency := true; pl.v.attribute_reference := null; pl.i.attribute_reference := true; pl.v.entity_reference := null; pl.i.entity_reference := true; pl.v.time := null; pl.i.time := true; end if; end if; END; --============================= CHECK DELETE ================================-- PROCEDURE check_delete(id rm.reference) IS dummy number; BEGIN null; END; --================================== END ====================================-- -- -- Package instantiation block -- BEGIN is_installed := true; END; /