rem rem $Header: L:\\\\model\\repman40\\api\\RCS\\cidfl.hpb 1.1 1998/05/28 16:11:35 mfrobins Exp $ rem Rem Copyright (c) 1994 by Oracle Corporation Rem NAME Rem cidfl.hpb - Rem DESCRIPTION Rem Rem RETURNS Rem Rem NOTES Rem Rem MODIFIED (MM/DD/YY) Rem jwetherb 10/13/94 - Fix typo in source/destination_type calculation Rem jwetherb 10/12/94 - Calculate values for source/destination_type Rem jwetherb 09/03/94 - Reference external instead of entity Rem aheath 07/08/94 - Creation CREATE OR REPLACE PACKAGE BODY cihdfl IS -- Generic pre-process routines PROCEDURE assign_insert_defaults(pl in out NOCOPY ciodataflow.data); -- Type-specific pre-process routines -- Generic post-process routines -- Type-specific post-process routines sac_type varchar2(10) := 'DFL'; pac_type varchar2(10) := 'FUN'; --======================== PRE-PROCESS (INS,UPD) ============================-- PROCEDURE pre_process( operation varchar2, id rm.reference, pl in out NOCOPY ciodataflow.data ) IS fun_ref rm.reference; BEGIN if pl.i.function_source_reference and pl.v.function_source_reference is not null then fun_ref := pl.v.function_source_reference; if pl.v.source_type is null or pl.v.source_type != 'FUNCTION' then pl.v.source_type := 'FUNCTION'; pl.i.source_type := true; end if; elsif pl.i.external_source_reference and pl.v.external_source_reference is not null then if pl.v.source_type is null or pl.v.source_type != 'EXTERNAL' then pl.v.source_type := 'EXTERNAL'; pl.i.source_type := true; end if; elsif pl.i.datastore_source_reference and pl.v.datastore_source_reference is not null then if pl.v.source_type is null or pl.v.source_type != 'DATASTORE' then pl.v.source_type := 'DATASTORE'; pl.i.source_type := true; end if; elsif pl.v.function_source_reference is not null then pl.v.source_type := 'FUNCTION'; fun_ref := pl.v.function_source_reference; end if; if pl.i.function_dest_reference and pl.v.function_dest_reference is not null then fun_ref := pl.v.function_dest_reference; if pl.v.destination_type is null or pl.v.destination_type != 'FUNCTION' then pl.v.destination_type := 'FUNCTION'; pl.i.destination_type := true; end if; elsif pl.i.external_dest_reference and pl.v.external_dest_reference is not null then if pl.v.destination_type is null or pl.v.destination_type != 'EXTERNAL' then pl.v.destination_type := 'EXTERNAL'; pl.i.destination_type := true; end if; elsif pl.i.datastore_dest_reference and pl.v.datastore_dest_reference is not null then if pl.v.destination_type is null or pl.v.destination_type != 'DATASTORE' then pl.v.destination_type := 'DATASTORE'; pl.i.destination_type := true; end if; elsif pl.v.function_dest_reference is not null then pl.v.destination_type := 'FUNCTION'; fun_ref := pl.v.function_dest_reference; end if; -- Access control checks if fun_ref is not null then -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_access_rights(fun_ref,'FUN','UPD','NSHR'); null; else ciierr.fatal(2022, 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; -- Initialize unassigned properties with default values on INSERT if operation = 'INS' then assign_insert_defaults(pl); end if; END; --======================== PRE-PROCESS (DEL,SEL) ============================-- PROCEDURE pre_process(operation varchar2,id rm.reference) IS pac_ref rm.reference; BEGIN -- access control checks select max(nvl(decode(source_type,'FUNCTION',function_source_reference,null), decode(destination_type,'FUNCTION',function_dest_reference,null))) into pac_ref from ci_dataflows ci where ci.id = pre_process.id; -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_sac(id,sac_type,operation,pac_ref,pac_type); -- Delete all DFLATT's and DFLDIT's associated with this DFL if operation = 'DEL' then -- Delete the dataflow attribute usages for dflatt in (select id,types from ci_dataflow_attribute_usages where dataflow_reference = pre_process.id) loop ciodataflow_attribute_usage.del(dflatt.id); end loop; -- Delete the dataflow data item usages for dfldit in (select id,types from ci_dataflow_data_item_usages where dataflow_reference = pre_process.id) loop ciodataflow_data_item_usage.del(dfldit.id); end loop; end if; END; --===================== POST-PROCESS (INS,UPD,SEL) ==========================-- PROCEDURE post_process( operation varchar2, id rm.reference, pl in out NOCOPY ciodataflow.data ) IS BEGIN -- B2043288 : Update parent_ivid of multiline text belonging to dataflow if (operation = 'UPD') then declare parentIVID number; begin select parent_ivid into parentIVID from ci_dataflows where irid = post_process.id; -- new parent ivid update rm_text_lines rtl set rtl.parent_ivid = parentIVID where rtl.parent_ivid = pl.v.parent_ivid -- original parent ivid and rtl.txt_ref = post_process.id; end; end if; -- Nullify arc reference properties on exit if pl.v.source_type != 'FUNCTION' then pl.v.function_source_reference := null; end if; if pl.v.source_type != 'EXTERNAL' then pl.v.external_source_reference := null; end if; if pl.v.source_type != 'DATASTORE' then pl.v.datastore_source_reference := null; end if; if pl.v.destination_type != 'FUNCTION' then pl.v.function_dest_reference := null; end if; if pl.v.destination_type != 'EXTERNAL' then pl.v.external_dest_reference := null; end if; if pl.v.destination_type != 'DATASTORE' then pl.v.datastore_dest_reference := null; end if; END; --========================= POST PROCESS (DEL) ==============================-- PROCEDURE post_process(operation varchar2,id rm.reference) IS BEGIN if operation = 'DEL' then -- Delete this and all it's related sub-bits ciiutl.delete_element(id,sac_type); end if; END; --======================== ASSIGN INSERT DEFAULTS ===========================-- PROCEDURE assign_insert_defaults(pl in out NOCOPY ciodataflow.data) IS BEGIN -- Assign miscellaneous default values pl.v.element_type_name := sac_type; pl.i.element_type_name := true; END; --================================== END ====================================-- -- -- Package instantiation block -- BEGIN is_installed := true; END; /