create or replace package body cdwp_brd is /***************************************************************************************** Purpose HTML Report of Business Rule Design Definitions for ODWA Usage Remarks Revision history When Who Construct Revision What ------------------------------------------------------------------------------------------ $REVISION_HISTORY$ 15-feb-2001 Sandra Muller 2.7 Fix for issue 205: show when condition + Fix for issue 206: ora-error in browser + removed program datums, datastructures, sub PLMs, parent PLM (not applicable) 02-feb-2001 SANDRA MULLER 2.6 fix for issue 169 12-sep-2000 Lucas Jellema 2.5 Migrate to 6i Tune queries, use RULE hints, make version resolved 19-jun-2000 Lucas Jellema list_brdd 2.4 + show the triggering modules only when triggering columns are updated (not just any update) 13-jun-2000 Lucas Jellema list_mde 2.3 + show the triggering modules 29-may-2000 Lucas Jellema list_brdd_definitions 2.2 + write menu_bar (status bar) for one_file = 'Y' 27-may-2000 Lucas Jellema list_ 2.1 + property Table should be a real hyperlink to table 26-may-2000 Lucas Jellema short_list_ and list_ 2.0 + all functional improvements, such as + write_not_found + write_about + use report_link for hyperjumps + app_summary + icon bar + set_context and set_app + set_base_url and local_link 19-may-2000 Sandra Muller summary_modfun_definitions, list_brdd_defs 1.2 changed function.gif to function_hierarchy_diagrammer.gif 11-may-2000 Sandra Muller list_brdd_definitions 1.1 removed heading bar just before multi line text, added purpose in html heading and removed purpose as property (short_)list_brdd_definitions added write_about summary_modfun_definitions heading 'implementing functions' instead of only 'implementing' 15-mar-2000 Lucas Jellema 1.0 Creation, based on CDWP_PLM Created after the PLM.Doc Specification prepared for Solutron, Publisher/2000 *****************************************************************************************/ -- -- private constants -- REVISION_LABEL constant varchar2(30) := '$x.y::2.7 $'; PACKAGE_NAME constant varchar2(30) := 'CDWP_BRD'; g_edit_text cdwp_txt.cdi_text_lines; g_edit_text_count number(5,0); g_plm_name varchar2(40); g_plm_id number(38); -- -- cursor to select properties of one or more plsql module definitions of type BRDD -- in a specific -- application system (owned by or shared) -- cursor c_plm ( b_plm_ivid in number , b_enabled_flag in varchar2 default null ) is select /*+ RULE */ plm.ACTIVITY_CODE , plm.CANDIDATE_FLAG , plm.COMPLETION_STATUS , plm.COMPLEXITY , plm.ESTIMATE , plm.ESTIMATE_UNITS , plm.FREE_FORMAT_TEXT_FLAG , plm.ID , plm.IriD , plm.IviD , plm.IMPLEMENTATION_NAME , plm.NAME , plm.PLSQL_MODULE_TYPE , plm.PROJECT_CODE , plm.PURPOSE , plm.RETURN_TYPE , plm.RNDS_FLAG , plm.RNPS_FLAG , plm.SCOPE , plm.SHORT_NAME , plm.SIZE_OF_MODULE , plm.SOURCE_PATHNAME , plm.TASK_CODE , plm.TOP_LEVEL_FLAG , plm.TYPE_MEMBER_ORDERING , plm.WNDS_FLAG , plm.WNPS_FLAG , tab.name tab_name , tab.irid tab_id , tab.irid tab_irid , tab.ivid tab_ivid , trg.irid trg_id , trg.ivid trg_ivid , trg.enabled_flag trg_enabled_flag , trg.COMPLETE_FLAG trg_complete_flag , trg.EXECUTE_TIME , trg.FIRE_WHEN_PROPAGATED_FLAG , trg.NEW_ALIAS , trg.OLD_ALIAS , trg.PURPOSE trg_purpose , trg.TRIGGER_LEVEL , trg.TRIGGER_ON_DELETE , trg.TRIGGER_ON_INSERT , trg.TRIGGER_ON_UPDATE , trg.name trg_name from i$sdd_trg trg , i$sdd_tab tab , ci_plsql_modules plm where plm.ivid = b_plm_ivid and trg.enabled_flag = nvl(b_enabled_flag, trg.enabled_flag) and tab.irid = trg.table_definition_ref and trg.parent_ivid = tab.ivid -- 2.7 had to take out next condition, because of issue 206 -- this one conflicted with trg.parent_ivid when table checked out and no context --and tab.ivid = cdwpbase.get_best_ivid( tab.irid) and trg.plsql_module_ref = plm.id ; r_plm c_plm%rowtype; -- MODULE ARGUMENT instances owned by b_plm_id cursor c_arg_plm (B_PLM_IviD in number ,b_old_or_new in varchar2 ) is select arg.id arg_id , arg.attribute_or_dataitem arg_attribute_or_dataitem , arg.column_reference arg_column_reference , arg.datastructure_reference arg_datastructure_reference , arg.datatype arg_datatype , arg.datatype|| decode(arg.length , null , null , '('|| to_char(arg.length)|| decode(arg.scale , null , ')' , ', '|| arg.scale|| ')' ) ) arg_datatype_full , arg.default_value arg_default_value , arg.display_flag arg_display_flag , arg.domain_reference arg_domain_reference , arg.input_mask arg_input_mask , arg.input_output_identifier arg_input_output_identifier , arg.length arg_length , arg.module_argument_for arg_module_argument_for , arg.name arg_name , arg.optional_flag arg_optional_flag , arg.oracle_type_reference arg_oracle_type_reference , arg.position arg_position , arg.prompt arg_prompt , arg.remark arg_remark , arg.scale arg_scale , arg.soft_lov arg_soft_lov , arg.substitution_variable arg_substitution_variable , arg.suggestion_list_flag arg_suggestion_list_flag , arg.table_definition_reference arg_table_definition_reference from ci_module_arguments arg where arg.parent_ivid = b_plm_ivid and lower(arg.name) like lower('p_'||b_old_or_new||'%') and lower(arg.name) not like decode(b_old_or_new, 'old','XZXZQA','p_old%') order by arg.position; -- -- cursor to select the triggering modules -- cursor c_mde ( b_trg_id number , b_tbl_ivid in number ) is select /*+ RULE */ mco.general_module_ref gem_id , mco.name mco_name -- now if the MCO has insert, then if the trigger has the Flag is set, else it is not , decode( mco.insert_flag ,'Y' , trg.trigger_on_insert ,'N' ) insert_flag , decode( mco.update_flag ,'Y' , trg.trigger_on_update ,'N' ) update_flag , decode( mco.delete_flag ,'Y' , trg.trigger_on_delete ,'N' ) delete_flag , trg.trigger_on_insert trg_insert_flag , trg.trigger_on_update trg_update_flag , trg.trigger_on_delete trg_delete_flag , mco.irid mco_id from i$sdd_mti mti , i$sdd_mun mco , i$sdd_mcn mcn , i$sdd_trg trg where trg.irid = b_trg_id and trg.parent_ivid = b_tbl_ivid and mti.table_ref = trg.table_definition_ref and mti.usage_type = 'BASE' and mti.module_unit_ref = mco.irid and mcn.module_component_ref = mco.irid and ( (mco.insert_flag = 'Y' and trg.trigger_on_insert = 'Y') or (mco.update_flag = 'Y' and trg.trigger_on_update = 'Y') or (mco.delete_flag = 'Y' and trg.trigger_on_delete = 'Y') ) and mti.parent_ivid = cdwpbase.get_best_ivid( mti.pac_ref) and mcn.parent_ivid = mti.parent_ivid and mco.parent_ivid = mti.parent_ivid UNION -- with the Module Components with MTI based on Views based on the table triggering this rule! select mco.general_module_ref gem_id , mco.name mco_name -- now if the MCO has insert, then if the trigger has the Flag is set, else it is not , decode( mco.insert_flag ,'Y' , trg.trigger_on_insert ,'N' ) insert_flag , decode( mco.update_flag ,'Y' , trg.trigger_on_update ,'N' ) update_flag , decode( mco.delete_flag ,'Y' , trg.trigger_on_delete ,'N' ) delete_flag , trg.trigger_on_insert trg_insert_flag , trg.trigger_on_update trg_update_flag , trg.trigger_on_delete trg_delete_flag , mco.irid mco_id from i$sdd_vwtab vwtab , i$sdd_tab vw , i$sdd_mun mco , i$sdd_mcn mcn , i$sdd_mti mti , i$sdd_trg trg where trg.irid = b_trg_id and trg.parent_ivid = b_tbl_ivid and mti.table_ref = vw.irid and vwtab.parent_ivid = vw.ivid and vw.ivid = cdwpbase.get_best_ivid( vw.irid) and vwtab.view_ref = vw.irid and vwtab.table_ref = trg.table_definition_ref and mti.usage_type = 'BASE' and mti.module_unit_ref = mco.irid and mcn.module_component_ref = mco.irid and mti.parent_ivid = cdwpbase.get_best_ivid( mti.pac_ref) and mcn.parent_ivid = mti.parent_ivid and mco.parent_ivid = mti.parent_ivid and ( ( mco.insert_flag = 'Y' and trg.trigger_on_insert = 'Y' and exists -- at least one Data Bound Item in this Module Component -- should have insert flag, should link to a column in the View -- based on a Column in the base table ( select /*+ RULE */ 'x' from i$sdd_col tblcol , i$sdd_col vwcol , i$sdd_ite dbi where dbi.column_ref = vwcol.irid and vwcol.base_column_ref = tblcol.irid and dbi.insert_flag = 'Y' and dbi.parent_ivid = mti.parent_ivid and vwcol.parent_ivid = vw.ivid and tblcol.parent_ivid = b_tbl_ivid ) ) or ( mco.update_flag = 'Y' and trg.trigger_on_update = 'Y' and exists -- at least one Data Bound Item in this Module Component -- should have update flag, should link to a column in the View -- based on a Column in the base table ( select /*+ RULE */ 'x' from i$sdd_col tblcol , i$sdd_col vwcol , i$sdd_ite dbi where dbi.column_ref = vwcol.irid and vwcol.base_column_ref = tblcol.irid and dbi.update_flag = 'Y' and dbi.parent_ivid = mti.parent_ivid and vwcol.parent_ivid = vw.ivid and tblcol.parent_ivid = b_tbl_ivid ) ) or ( mco.delete_flag = 'Y' and trg.trigger_on_delete = 'Y' and not exists -- allData Bound Items in this Module Component linked to columns -- in the view based on columns in the base triggering table -- should have nullify flag set ( select /*+ RULE */ 'x' from i$sdd_col tblcol , i$sdd_col vwcol , i$sdd_ite dbi where dbi.column_ref = vwcol.irid and vwcol.base_column_ref = tblcol.irid and dbi.nullify_flag = 'N' and dbi.parent_ivid = mti.parent_ivid and vwcol.parent_ivid = vw.ivid and tblcol.parent_ivid = b_tbl_ivid ) ) ) order by 1, 2 ; -- even if a BRDD has been found, we need to compare DataBound Items and Trigger Column Usages cursor c_brdd_col ( b_mco_id in number , b_trg_id in number , b_tbl_ivid in number ) is select /*+ RULE */ trgcol.column_ref col_irid , col.ivid col_ivid , col.name col_name from i$sdd_col col , i$sdd_ite dbi , i$sdd_trgcol trgcol where trgcol.database_trigger_ref = b_trg_id and trgcol.parent_ivid = b_tbl_ivid and dbi.column_ref = trgcol.column_ref and dbi.module_unit_ref = b_mco_id and dbi.parent_ivid = cdwpbase.get_best_ivid( dbi.pac_ref) and col.irid = trgcol.column_ref and col.parent_ivid = cdwpbase.get_best_ivid( col.pac_ref) and dbi.update_flag = 'Y' -- item is updatable, that means: mco can update column UNION -- the indirect columns (view columns based on base table columns) select vwcol.irid col_irid , vwcol.ivid col_ivid , vwcol.name col_name from i$sdd_ite dbi , i$sdd_col vwcol , i$sdd_trgcol trgcol where trgcol.database_trigger_ref = b_trg_id and trgcol.parent_ivid = b_tbl_ivid and dbi.module_unit_ref = b_mco_id and dbi.update_flag = 'Y' -- item is updatable, that means: mco can update column and dbi.parent_ivid = cdwpbase.get_best_ivid( dbi.pac_ref) and trgcol.column_ref = vwcol.base_column_ref and dbi.column_ref = vwcol.irid and vwcol.parent_ivid = cdwpbase.get_best_ivid(vwcol.pac_ref) order by 1 ; -- -- PLSQL MOdules -- procedure short_list_brdd_definitions ( p_session_id in number ) is begin odwactxt.update_context ( p_session_id => p_session_id , p_package_name => PACKAGE_NAME , p_procedure_name=> 'short_list_brdd_definitions' ); odwarprt.short_list_of_type_instances ( p_session_id => p_session_id , p_el_type_of => 'BRDD' , p_app_irid => odwactxt.get_folder_irid , p_plural_name => ROB_msg.getMsg(Rob_msg.DSP126_CDWP_BRDD, '', '', '', '') , p_order_by => 'NAME' , p_descriptor_column => 'NAME' ); end; -- short_list_brdd_definitions procedure columns_required ( p_old_or_new in varchar2 := 'new' ) is -- l_first boolean; function arg_gif(p_input_output_identifier in varchar2) return varchar2 is begin if p_input_output_identifier = 'INPUT' then return 'argument_in'; elsif p_input_output_identifier = 'OUTPUT' then return 'argument_out'; elsif p_input_output_identifier = 'MODIFY' then return 'argument_inout'; else return 'module_arg'; end if; end; --arg_gif begin cdwp.bookmark('ARG'||to_char(odwactxt.get_pac_irid)); -- BOOKMARK cdwp.tableOpen('BORDER="0"'); l_first := true; for r_arg in c_arg_plm ( b_plm_ivid => odwactxt.get_pac_ivid , b_old_or_new => p_old_or_new ) loop if l_first then cdwp.tableRowOpen; cdwp.TableDataHeading ( cdwp.add_images('{module_arg.gif}') ||initcap(p_old_or_new) ||ROB_msg.getMsg(Rob_msg.DSP127_CDWP_COLARG, '', '', '', '') ); htp.print(''); cdwp.tableRowOpen; cdwp.TableDataValue('', 1); cdwp.TableDataValue(ROB_msg.getMsg(Rob_msg.CAP019_CDWP_NAME, '', '', '', ''), 1); cdwp.TableDataValue(ROB_msg.getMsg(Rob_msg.CAP033_CDWP_COL, '', '', '', ''), 1); cdwp.TableDataValue(ROB_msg.getMsg(Rob_msg.CAP020_CDWP_DATATYPE, '', '', '', ''), 1); cdwp.tableRowClose; l_first := false; end if; -- l_first = true cdwp.tableRowOpen; cdwp.TableDataValue('', 1); cdwp.TableDataValue ( --cdwp.add_images('{'||arg_gif(r_arg.arg_input_output_identifier)||'.gif}') r_arg.arg_name ); if r_arg.arg_module_argument_for = 'COL' then cdwp.TableDataValue ( cdwp.sac_link ( p_sac_irid => r_arg.arg_column_reference , p_sac_type_of => 'COL' , p_text => cdwp.add_images('{column.gif}') ||'{sacname}' ) , 1 ); elsif r_arg.arg_module_argument_for = 'DAT' then cdwp.TableDataValue ( cdwp.sac_link ( p_sac_irid => r_arg.arg_datastructure_reference , p_sac_type_of => 'DAT' , p_pac_type_of => 'PLM' ) , 1 ); elsif r_arg.arg_module_argument_for = 'DATATYPE' then cdwp.TableDataValue('', 1); elsif r_arg.arg_module_argument_for = 'DOM' then cdwp.TableDataValue ( cdwp.report_link ( p_irid => r_arg.arg_domain_reference , p_type_of => 'DOM' ) , 1 ); elsif r_arg.arg_module_argument_for = 'TBL' then cdwp.TableDataValue ( cdwp.report_link ( p_irid => r_arg.arg_table_definition_reference , p_type_of => 'TBL' ) , 1 ); elsif r_arg.arg_module_argument_for = 'ORT' then cdwp.TableDataValue ( cdwp.report_link ( p_irid => r_arg.arg_oracle_type_reference , p_type_of => cdwpbase.get_el_type_of( r_arg.arg_oracle_type_reference) ) , 1 ); end if; -- r_arg.arg_module_argument_for = 'COL' cdwp.TableDataValue( r_arg.arg_datatype_full); cdwp.tableRowClose; end loop; -- r_arg cdwp.tableClose; htp.print(''); cdwp.tableRowClose; end; -- columns_required procedure print_trgcol ( p_trg_id in number , p_tbl_ivid in number ) is -- this procedure prints the triggering columns in the database trigger for the indicated trigger p_trg_id -- it prints them all in one row, assuming the row has been opened and will be closed by the calling routine cursor c_trgcol ( b_trg_id in number , b_tbl_ivid in number ) is select trgcol.column_reference col_id from ci_trigger_column_usages trgcol where trgcol.database_trigger_reference = b_trg_id and trgcol.parent_ivid = b_tbl_ivid ; l_trgcol varchar2(2000); l_first boolean :=true; begin for r_trgcol in c_trgcol ( b_trg_id => p_trg_id , b_tbl_ivid => p_tbl_ivid ) loop if not l_first then l_trgcol:= l_trgcol||','; else l_first:= false; end if; l_trgcol:= l_trgcol ||cdwp.sac_link ( p_sac_irid => r_trgcol.col_id , p_sac_type_of => 'COL' , p_pac_ivid => p_tbl_ivid , p_text => '{gif}{sacname}' ); end loop; -- r_trgcol cdwp.TableDataValue(l_trgcol, 1); end; -- print_trgcol procedure summary_trgmde ( p_trg_id in number , p_tbl_ivid in number ) -- list the triggering modules for this Business Rule is l_first boolean; l_upd_col varchar2(2000); l_previous_mde number(38):= -1; begin cdwp.bookmark('MDE'||to_char(g_plm_id)); -- BOOKMARK cdwp.tableOpen('BORDER="0"'); -- l_first := true; for r_mde in c_mde ( b_trg_id => p_trg_id , b_tbl_ivid => p_tbl_ivid ) loop l_upd_col:= ''; if r_mde.update_flag = 'Y' then -- go find all triggering columns for r_brdd_col in c_brdd_col ( b_mco_id => r_mde.mco_id , b_trg_id => p_trg_id , b_tbl_ivid => p_tbl_ivid ) loop l_upd_col:= l_upd_col||','||r_brdd_col.col_name; end loop; -- r_brdd_col l_upd_col:= substr(l_upd_col,2); -- remove first comma end if; -- r_brdd.update_flag = 'Y' if r_mde.update_flag = 'Y' and l_upd_col is not null or r_mde.delete_flag = 'Y' or r_mde.insert_flag = 'Y' then cdwp.tableRowOpen; if l_first then cdwp.TableDataHeading(cdwp.add_images('{module.gif}') ||ROB_msg.getMsg(Rob_msg.DSP128_CDWP_TBM, '', '', '', '')); htp.print(''); cdwp.tableRowOpen; cdwp.TableDataValue('', 1); cdwp.TableDataValue(ROB_msg.getMsg(Rob_msg.CAP019_CDWP_NAME, '', '', '', ''), 1, p_colspan => 4); cdwp.tableRowClose; cdwp.tableRowOpen; cdwp.TableDataValue('', 1); cdwp.TableDataValue('', 1); cdwp.TableDataValue(ROB_msg.getMsg(Rob_msg.CAP034_CDWP_MODULECOMP, '', '', '', ''), 1, p_colspan => 2); if r_mde.trg_insert_flag = 'Y' then cdwp.TableDataValue(ROB_msg.getMsg(Rob_msg.CAP035_CDWP_INSERT, '', '', '', ''), 1); end if; if r_mde.trg_update_flag = 'Y' then cdwp.TableDataValue(ROB_msg.getMsg(Rob_msg.CAP013_CDWP_UPDATE, '', '', '', ''), 1); end if; if r_mde.trg_delete_flag = 'Y' then cdwp.TableDataValue(ROB_msg.getMsg(Rob_msg.CAP014_CDWP_DELETE, '', '', '', ''), 1); end if; cdwp.tableRowClose; l_first := false; end if; -- l_first = true if l_previous_mde <> r_mde.gem_id then cdwp.tableRowOpen; cdwp.TableDataValue('', 1); cdwp.TableDataValue ( cdwp.report_link ( p_el_id => r_mde.gem_id ) ); cdwp.TableDataValue ( '' --r_mde.gem_name ||' - ' --||r_mde.gem_title ,p_colspan => 4 ); cdwp.tableRowClose; l_previous_mde := r_mde.gem_id; end if; -- l_previous_mde <> r_mde.gem_id cdwp.tableRowOpen; cdwp.TableDataValue('', 1, p_colspan => 2); cdwp.TableDataValue (cdwp.report_link ( p_el_id => r_mde.gem_id , p_text => cdwp.add_images ( '{forms_private_mco.gif}' ) ||r_mde.mco_name , p_bookmark => 'MCO'||to_char( r_mde.mco_id) ) , p_colspan => 2 ); if r_mde.trg_insert_flag = 'Y' then cdwp.TableDataValue(cdwp.convertYnToCheck(r_mde.insert_flag),1); end if; if r_mde.trg_update_flag = 'Y' and l_upd_col is not null then cdwp.TableDataValue ( cdwp.convertYnToCheck(r_mde.update_flag) ||' '||l_upd_col ,1 ); end if; if r_mde.trg_delete_flag = 'Y' then cdwp.TableDataValue(cdwp.convertYnToCheck(r_mde.delete_flag),1); end if; cdwp.tableRowClose; end if; -- r_mde.update_flag = 'Y' and l_upd_col <> '' .... end loop; -- r_mde cdwp.tableClose; htp.print(''); cdwp.tableRowClose; end summary_trgmde; procedure icon_bar ( p_irid in number default odwactxt.get_pac_irid , p_ivid in number default odwactxt.get_pac_ivid ) is begin odwarprt.init_short_cut_bar; cdwp.tableOpen('BORDER="0"'); cdwp.tableRowOpen; -- 2.7 moved Arguments to front, to correspond with reporting order if odwaxist.exists_detail ( p_pac_irid => p_irid , p_pac_ivid => p_ivid , p_el_type_of => 'ARG' ) then odwarprt.show_anchor ( p_anchor_name => 'arg'||to_char(p_irid) , p_gif => 'module_arg.gif' -- 2.6 made title match the heading it refers to -- (specific to business rule design defs) , p_title =>ROB_msg.getMsg(Rob_msg.DSP127_CDWP_COLARG, '', '', '', '') ); end if; -- triggered by modules -- open c_mde(r_plm.trg_id); -- fetch c_mde into r_mde; -- if c_mde%found then odwarprt.show_anchor ( p_anchor_name => 'mde'||to_char(p_irid) , p_gif => 'module.gif' , p_title => ROB_msg.getMsg(Rob_msg.DSP128_CDWP_TBM, '', '', '', '') ); -- end if; -- close c_mde; -- MODFUN if odwaxist.exists_detail ( p_pac_irid => p_irid , p_pac_ivid => p_ivid , p_el_type_of => 'MODFUN' ) then odwarprt.show_anchor ( p_anchor_name => 'modfun'||to_char(p_irid) , p_gif => 'system_privilege.gif' , p_title =>ROB_msg.getMsg(Rob_msg.DSP129_CDWP_IBRF, '', '', '', '') ); end if; -- 2.7 removed PUB MODMOD, not applicable to BRDD -- 2.7 removed PRIVATE MODMOD, not applicable to BRDD -- Called MODMOD if odwaxist.exists_detail ( p_pac_irid => p_irid , p_pac_ivid => p_ivid , p_el_type_of => 'MODMOD' , p_extra_where => 'METHOD = ''CALL'' ' ) then odwarprt.show_anchor ( p_anchor_name => 'modmod'||to_char(p_irid) , p_gif => 'plsql.gif' , p_title =>ROB_msg.getMsg(Rob_msg.DSP130_CDWP_PLSQLCALL, '', '', '', '') ); end if; -- 2.7 removed Datastructures, not applicable to BRDD -- 2.7 removed Program Datum, not applicable to BRDD -- 2.7 removed Parent Modules (included in), not applicable to BRDD -- Called by PL/SQL Definitions if odwaxist.exists_detail ( p_pac_irid => p_irid , p_el_type_of => 'MODMOD' , p_ref_column => 'CHILD_MODULE_REFERENCE' , p_extra_where => 'METHOD = ''CALL'' ' ) then odwarprt.show_anchor ( p_anchor_name => 'modmodin'||to_char(p_irid) , p_gif => 'plsql.gif' , p_title =>ROB_msg.getMsg(Rob_msg.DSP130_CDWP_PLSQLCALL, '', '', '', '') ); end if; -- 2.6 removed Implementing Database Triggers -- makes no sense for BRDD's if cdwp.exists_mlt( p_id => odwactxt.get_pac_irid) then odwarprt.show_anchor ( p_anchor_name => 'plm_mlt'||to_char(p_irid) , p_gif => 'mlt.gif' , p_title =>ROB_msg.getMsg(Rob_msg.DSP131_CDWP_MLT, '', '', '', '') ); end if; cdwp.tableRowClose; cdwp.tableClose; htp.nl; end icon_bar; procedure list_brdd_definitions ( p_session_id in number , p_irid in number default null , p_ivid in number default null ) is -- local variables -- l_first boolean; l_anchor_ctr number(2):=0; l_rule_type varchar2(2000); l_msg_code varchar2(2000); -- r_mde c_mde%ROWTYPE; begin -- list_brdd_definitions odwactxt.update_context ( p_session_id => p_session_id , p_package_name => PACKAGE_NAME , p_procedure_name=> 'list_brdd_definitions' -- 2.7 brdd instead of plm , P_PAC_IRID => p_irid , P_PAC_IvID => p_ivid , P_PAC_TYPE_ID => -4907 -- cdwpbase.short_name_to_type_id('BRDD') (PLM=4907) ); cdwpbase.start_timer; htp.htmlOpen; -- -- title -- htp.headOpen; cdwp.write_about(package_name, revision_label); cdwp.include_report_styles; if odwactxt.get_one_file = 'Y' then htp.title ( cdwpbase.get_el_name ( p_el_id => odwactxt.get_folder_irid , p_el_type_of => 'APP' ) ||' - '|| ROB_msg.getMsg(Rob_msg.DSP126_CDWP_BRDD, '', '', '', '') ); else htp.title ( cdwpbase.get_el_name ( p_el_id => odwactxt.get_folder_irid , p_el_type_of => 'APP' ) ||' - '||ROB_msg.getMsg(Rob_msg.DSP126_CDWP_BRDD, '', '', '', '')||' - ' ||cdwpbase.get_el_name( p_el_id => odwactxt.get_pac_irid, p_el_type_of => 'PLM') ); end if; -- odwactxt.get_one_file = 'Y' htp.headClose; htp.bodyOpen(cattributes=>'BGCOLOR="#FFFFFF"'); cdwpbase.open_timer_form; if odwactxt.get_one_file = 'Y' then cdwp.menu_bar ( p_level => 2 , p_el_short_name=> 'BRDD' , p_el_id => null ); cdwp.heading(2); cdwp.p ( cdwp.add_images('{'||cdwpbase.get_icon('BRDD')||'}') ||ROB_msg.getMsg(Rob_msg.DSP126_CDWP_BRDD, '', '', '', '') , p_style => 'reptitle' ); cdwp.tableOpen; cdwpbase.get_ivid_list ( p_app_id => odwactxt.get_folder_irid , p_ci_view_name => 'CI_PLSQL_MODULES' , p_order_by => 'SHORT_NAME' , p_descriptor_column => 'SHORT_NAME' ); for i in 1..cdwpbase.g_ividTab.count loop if cdwp_chk_plm_is_brdd ( p_plm_irid => cdwpbase.g_iridTab(i) , p_plm_ivid => cdwpbase.g_ividTab(i) ) = 'Y' -- Check if PLM is a BRDD then cdwp.tableRowOpen; cdwp.TableDataHeading(null); -- 2.1 cdwp.TableDataValue ( cdwpbase.local_link ( p_bookmark => cdwpbase.g_nameTab(i) , p_text => '{gif}'||cdwpbase.g_nameTab(i) , p_el_id => cdwpbase.g_iridTab(i) , p_type_of => 'BRDD' ) ); cdwp.tableRowClose; end if; end loop; cdwp.tableClose; htp.nl; htp.nl; else cdwpbase.get_ivid_list ( p_ivid => nvl( p_ivid, cdwpbase.get_ivid( p_irid)) ); end if; -- odwactxt.get_one_file = 'Y' -- detailed business rule design definitions for i in 1..cdwpbase.g_ividTab.count loop open c_plm( b_plm_ivid => cdwpbase.g_ividTab(i)); fetch c_plm into r_plm; close c_plm; odwactxt.update_context ( P_PAC_IRID => r_plm.irid , P_PAC_IvID => r_plm.ivid , p_new_request => false ); g_plm_name:=r_plm.name; g_plm_id :=r_plm.id; cdwp.bookmark( lower(r_plm.name)); -- 2.0 cdwp.menu_bar ( p_level => 2 , p_el_short_name=> 'BRDD' , p_el_id => odwactxt.get_pac_irid ); cdwp.heading(3); cdwp.p ( cdwp.add_images('{'||cdwpbase.get_icon('BRDD')||'}') ||r_plm.name , p_style => 'partitle' ); htp.nl; icon_bar ( p_irid => r_plm.irid , p_ivid => r_plm.ivid ); cdwp.tableOpen('BORDER="0"'); odwavrsn.version_status; cdwpbase.app_summary ( p_el_id => odwactxt.get_pac_irid ); -- get rule type and message code from the notes cdwp_txt.get_lines_from_repository ( r_plm.id , 'CDINOT' , g_edit_text , g_edit_text_count ); l_rule_type := cdwp_txt.get_html_tagged_text ( g_edit_text , g_edit_text_count , 'TY' ); l_msg_code := cdwp_txt.get_html_tagged_text ( g_edit_text , g_edit_text_count , 'MG' ); cdwp.tableRowOpen; cdwp.print_property ( p_property_name => ROB_msg.getMsg(Rob_msg.DSP261_CDWP_TABLE, '', '', '', '') , p_property_value => cdwp.report_link ( p_el_id => r_plm.tab_id , p_el_name => r_plm.tab_name ) ); cdwp.print_property ( p_property_name => ROB_msg.getMsg(Rob_msg.DSP262_CDWP_RULETYPE, '', '', '', '') , p_property_value => l_rule_type ); cdwp.print_property ( p_property_name => ROB_msg.getMsg(Rob_msg.DSP263_CDWP_MSGCODE, '', '', '', '') , p_property_value => l_msg_code ); cdwp.print_property ( p_property_name => ROB_msg.getMsg(Rob_msg.DSP264_CDWP_ENABLED, '', '', '', '') , p_property_value => cdwp.convertYnToCheck(r_plm.trg_enabled_flag) ); cdwp.tableRowClose; cdwp.tableClose; htp.print(''); cdwp.tableRowClose; cdwp.tableOpen('BORDER="0"'); cdwp.tableRowOpen; cdwp.TableDataHeading(ROB_msg.getMsg(Rob_msg.CAP036_CDWP_TRIGEVENTS, '', '', '', '')); cdwp.TableDataValue('Insert', 1); cdwp.TableDataValue('Update', 1); cdwp.TableDataValue('Delete', 1); htp.print(''); cdwp.tableRowOpen; cdwp.TableDataValue(null); cdwp.TableDataValue(cdwp.convertYnToCheck(r_plm.trigger_on_insert), 1); cdwp.TableDataValue(cdwp.convertYnToCheck(r_plm.trigger_on_update), 1); cdwp.TableDataValue(cdwp.convertYnToCheck(r_plm.trigger_on_delete), 1); cdwp.TableDataValue('of '||cdwp.report_link ( p_el_id => r_plm.tab_id , p_el_name => r_plm.tab_name ) , 1); cdwp.tablerowclose; cdwp.tableClose; htp.print(''); cdwp.tableRowClose; if odwaxist.exists_detail ( p_pac_irid => r_plm.trg_id , p_pac_ivid => r_plm.trg_ivid , p_el_type_of => 'TRGCOL' ) then cdwp.tableOpen('BORDER="0"'); cdwp.tableRowOpen; cdwp.TableDataHeading(ROB_msg.getMsg(Rob_msg.CAP037_CDWP_TRIGCOLS, '', '', '', '')); print_trgcol ( p_trg_id => r_plm.trg_id , p_tbl_ivid => r_plm.tab_ivid ); cdwp.tablerowclose; cdwp.tableClose; end if; htp.print(''); cdwp.tableRowClose; -- 2.7 fix for issue 205: temporarily set context to Table instead of PLM -- to be able to show When Condition odwactxt.update_context ( p_session_id => p_session_id , p_package_name => PACKAGE_NAME , p_procedure_name=> 'list_brdd_definitions' -- 2.7 brdd instead of plm , P_PAC_IRID => r_plm.tab_irid , P_PAC_IvID => r_plm.tab_ivid , P_PAC_TYPE_ID => -4907 -- cdwpbase.short_name_to_type_id('BRDD') (PLM=4907) ); cdwp.tableOpen('BORDER="0"'); cdwp_txt.display_mlt ( p_el_id => r_plm.trg_id , p_txt_type => 'CDIWHN' , p_mlt_prompt_name => 'When Condition' , p_max_lines => null , p_el_type => 'TRG' ); cdwp.tableClose; -- 2.7 fix for issue 205: reset context to PLM, to show Validation Code etc. odwactxt.update_context ( p_session_id => p_session_id , p_package_name => PACKAGE_NAME , p_procedure_name=> 'list_brdd_definitions' -- 2.7 brdd instead of plm , P_PAC_IRID => p_irid , P_PAC_IvID => p_ivid , P_PAC_TYPE_ID => -4907 -- cdwpbase.short_name_to_type_id('BRDD') (PLM=4907) ); htp.print(''); cdwp.tableRowClose; -- Columns Required columns_required ( p_old_or_new => '' ); -- Old COlumns Required columns_required ( p_old_or_new => 'old' ); -- 2.7 removed program datum list, not applicable to BRDD cdwp_plm.summary_modfun_definitions; -- 2.7 removed datastructure list, not applicable to BRDD htp.nl; summary_trgmde ( p_trg_id => r_plm.trg_id , p_tbl_ivid => r_plm.tab_ivid ); htp.nl; htp.nl; cdwp.bookmark('PLM_MLT'||to_char(r_plm.id)); -- BOOKMARK hwsp.fontOpen('Book Antiqua'); htp.bold(cdwp.add_images('{mlt.gif}') ||ROB_msg.getMsg(Rob_msg.DSP259_CDWP_MLTF, g_plm_name, '', '', '')); hwsp.fontClose; htp.nl; htp.nl; cdwp.tableOpen('BORDER="0"'); htp.nl; cdwp_txt.display_mlt ( p_el_id => r_plm.id , p_txt_type => 'CDIPLS' , p_mlt_prompt_name => ROB_msg.getMsg(Rob_msg.CAP038_CDWP_VALIDATECODE, '', '', '', '') , p_max_lines => 9999 , p_el_type => 'PLM' ); cdwp.tableClose; htp.print(''); cdwp.tableRowClose; cdwp.tableOpen('BORDER="0"'); cdwp_txt.display_mlt ( p_el_id => r_plm.id ,p_txt_type => 'CDIDSC' ,p_mlt_prompt_name => ROB_msg.getMsg(Rob_msg.CAP008_CDWP_DESC, '', '', '', '') ,p_max_lines => null ,p_el_type => 'PLM' ); cdwp.tableClose; htp.print(''); cdwp.tableRowClose; cdwp.tableClose; cdwp.tableOpen('BORDER="0"'); cdwp.tableRowOpen; cdwp_txt.display_all_mlt (p_el_id => r_plm.id ,p_max_lines => null ,p_do_not_display1 => 'CDIPLS' ,p_do_not_display2 => 'CDIDSC' ,p_el_type => 'PLM' ); cdwp.tableRowClose; cdwp.tableClose; end loop; -- r_plm cdwpbase.write_timer; htp.formClose; htp.bodyClose; htp.htmlClose; end; -- list_plm_definitions begin null; end; -- package body cdwp_brd /