rules repository

A-1250 Avoid components with the condition type "Never".

Severity Info Check + SQL-based Test Free New

Reason

A component (region, process, button, ...) with the condition type Never is never rendered or executed. It is dead configuration that still has to be read and maintained, and it is easy to mistake for an active component. Remove it, or attach a Build Option that is excluded from the build if you want to keep it switched off for later.

A short-lived Never while debugging is fine; do not ship it.

The rule checks these component types:

  • Page items, buttons, regions, page processes, dynamic actions, validations and branches
  • Page computations and chart series
  • Classic report columns, Interactive Grid columns and Interactive Report columns
  • Breadcrumb entries, list entries, list of values entries and navigation bar entries
  • Application computations and application processes

Example

Non-Compliant Example

page 10 (
    // ...
    region second (
        name: Second
        type: staticContent
        // ...
        serverSideCondition {
            type: never
        }
    )

    process do-work (
        name: Do Work
        type: executeCode
        // ...
        serverSideCondition {
            type: never
        }
    )

    button save (
        buttonName: SAVE
        label: Save
        // ...
        serverSideCondition {
            type: never
        }
    )
)
Issues
LineColumnMessage
819Region has the condition type Never.
1719Process has the condition type Never.
2619Button has the condition type Never.

Compliant Solution - ★★★★★

page 10 (
    // ...
    region second (
        name: Second
        type: staticContent
        // ...
    )

    process do-work (
        name: Do Work
        type: executeCode
        // ...
    )

    button save (
        buttonName: SAVE
        label: Save
        // ...
    )
)

Tests

Test SQL query

select aa.workspace || '.' || aa.alias || '.' || c.page_id || '.' || c.item_name as identifier,
       'Item ' || c.item_name || ' on page ' || c.page_id || ' of app ' || aa.alias || ' in '
         || aa.workspace || ' has the condition type Never.' as message
  from apex_application_page_items c
  join apex_applications aa
    on aa.application_id = c.application_id
       and aa.workspace = c.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and c.condition_type_code = 'NEVER'
union all
select aa.workspace || '.' || aa.alias || '.' || c.page_id || '.' || coalesce(c.static_id, to_char(c.button_id)) as identifier,
       'Button ' || c.button_name || ' on page ' || c.page_id || ' of app ' || aa.alias || ' in '
         || aa.workspace || ' has the condition type Never.' as message
  from apex_application_page_buttons c
  join apex_applications aa
    on aa.application_id = c.application_id
       and aa.workspace = c.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and c.condition_type_code = 'NEVER'
union all
select aa.workspace || '.' || aa.alias || '.' || c.page_id || '.' || coalesce(c.static_id, to_char(c.region_id)) as identifier,
       'Region ' || c.region_name || ' on page ' || c.page_id || ' of app ' || aa.alias || ' in '
         || aa.workspace || ' has the condition type Never.' as message
  from apex_application_page_regions c
  join apex_applications aa
    on aa.application_id = c.application_id
       and aa.workspace = c.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and c.condition_type_code = 'NEVER'
union all
select aa.workspace || '.' || aa.alias || '.' || c.page_id || '.' || coalesce(c.static_id, to_char(c.process_id)) as identifier,
       'Process ' || c.process_name || ' on page ' || c.page_id || ' of app ' || aa.alias || ' in '
         || aa.workspace || ' has the condition type Never.' as message
  from apex_application_page_proc c
  join apex_applications aa
    on aa.application_id = c.application_id
       and aa.workspace = c.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and c.condition_type_code = 'NEVER'
union all
select aa.workspace || '.' || aa.alias || '.' || c.page_id || '.' || coalesce(c.static_id, to_char(c.dynamic_action_id)) as identifier,
       'Dynamic action ' || c.dynamic_action_name || ' on page ' || c.page_id || ' of app ' || aa.alias || ' in '
         || aa.workspace || ' has the condition type Never.' as message
  from apex_application_page_da c
  join apex_applications aa
    on aa.application_id = c.application_id
       and aa.workspace = c.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and c.condition_type_code = 'NEVER'
union all
select aa.workspace || '.' || aa.alias || '.' || c.page_id || '.' || coalesce(c.static_id, to_char(c.validation_id)) as identifier,
       'Validation ' || c.validation_name || ' on page ' || c.page_id || ' of app ' || aa.alias || ' in '
         || aa.workspace || ' has the condition type Never.' as message
  from apex_application_page_val c
  join apex_applications aa
    on aa.application_id = c.application_id
       and aa.workspace = c.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and c.condition_type_code = 'NEVER'
union all
select aa.workspace || '.' || aa.alias || '.' || c.page_id || '.' || to_char(c.branch_id) as identifier,
       'Branch ' || c.branch_name || ' on page ' || c.page_id || ' of app ' || aa.alias || ' in '
         || aa.workspace || ' has the condition type Never.' as message
  from apex_application_page_branches c
  join apex_applications aa
    on aa.application_id = c.application_id
       and aa.workspace = c.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and c.condition_type_code = 'NEVER'
union all
select aa.workspace || '.' || aa.alias || '.' || c.page_id || '.' || coalesce(c.static_id, to_char(c.computation_id)) as identifier,
       'Page computation ' || c.item_name || ' on page ' || c.page_id || ' of app ' || aa.alias || ' in '
         || aa.workspace || ' has the condition type Never.' as message
  from apex_application_page_comp c
  join apex_applications aa
    on aa.application_id = c.application_id
       and aa.workspace = c.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and c.condition_type_code = 'NEVER'
union all
select aa.workspace || '.' || aa.alias || '.' || c.page_id || '.' || to_char(c.series_id) as identifier,
       'Chart series ' || c.region_name || '.' || c.series_name || ' on page ' || c.page_id || ' of app ' || aa.alias || ' in '
         || aa.workspace || ' has the condition type Never.' as message
  from apex_application_page_chart_s c
  join apex_applications aa
    on aa.application_id = c.application_id
       and aa.workspace = c.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and c.condition_type_code = 'NEVER'
union all
select aa.workspace || '.' || aa.alias || '.' || c.page_id || '.' || to_char(c.region_report_column_id) as identifier,
       'Report column ' || c.region_name || '.' || c.column_alias || ' on page ' || c.page_id || ' of app ' || aa.alias || ' in '
         || aa.workspace || ' has the condition type Never.' as message
  from apex_application_page_rpt_cols c
  join apex_applications aa
    on aa.application_id = c.application_id
       and aa.workspace = c.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and c.condition_type_code = 'NEVER'
union all
select aa.workspace || '.' || aa.alias || '.' || c.page_id || '.' || to_char(c.column_id) as identifier,
       'IG column ' || c.region_name || '.' || c.name || ' on page ' || c.page_id || ' of app ' || aa.alias || ' in '
         || aa.workspace || ' has the condition type Never.' as message
  from apex_appl_page_ig_columns c
  join apex_applications aa
    on aa.application_id = c.application_id
       and aa.workspace = c.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and c.condition_type_code = 'NEVER'
union all
select aa.workspace || '.' || aa.alias || '.' || c.page_id || '.' || to_char(c.column_id) as identifier,
       'IR column ' || c.region_name || '.' || c.column_alias || ' on page ' || c.page_id || ' of app ' || aa.alias || ' in '
         || aa.workspace || ' has the condition type Never.' as message
  from apex_application_page_ir_col c
  join apex_applications aa
    on aa.application_id = c.application_id
       and aa.workspace = c.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and c.display_condition_type_code = 'NEVER'
union all
select aa.workspace || '.' || aa.alias || '.' || coalesce(c.static_id, to_char(c.breadcrumb_entry_id)) as identifier,
       'Breadcrumb entry ' || c.entry_label || ' of app ' || aa.alias || ' in '
         || aa.workspace || ' has the condition type Never.' as message
  from apex_application_bc_entries c
  join apex_applications aa
    on aa.application_id = c.application_id
       and aa.workspace = c.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and c.condition_type_code = 'NEVER'
union all
select aa.workspace || '.' || aa.alias || '.' || c.list_name || '.' || coalesce(c.static_id, to_char(c.list_entry_id)) as identifier,
       'List entry ' || c.list_name || '.' || c.entry_text || ' of app ' || aa.alias || ' in '
         || aa.workspace || ' has the condition type Never.' as message
  from apex_application_list_entries c
  join apex_applications aa
    on aa.application_id = c.application_id
       and aa.workspace = c.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and c.condition_type_code = 'NEVER'
union all
select aa.workspace || '.' || aa.alias || '.' || c.list_of_values_name || '.' || coalesce(c.static_id, to_char(c.lov_entry_id)) as identifier,
       'LOV entry ' || c.list_of_values_name || '.' || c.display_value || ' of app ' || aa.alias || ' in '
         || aa.workspace || ' has the condition type Never.' as message
  from apex_application_lov_entries c
  join apex_applications aa
    on aa.application_id = c.application_id
       and aa.workspace = c.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and c.condition_type_code = 'NEVER'
union all
select aa.workspace || '.' || aa.alias || '.' || coalesce(c.static_id, to_char(c.application_computation_id)) as identifier,
       'Application computation ' || c.computation_item || ' of app ' || aa.alias || ' in '
         || aa.workspace || ' has the condition type Never.' as message
  from apex_application_computations c
  join apex_applications aa
    on aa.application_id = c.application_id
       and aa.workspace = c.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and c.condition_type_code = 'NEVER'
union all
select aa.workspace || '.' || aa.alias || '.' || coalesce(c.static_id, to_char(c.application_process_id)) as identifier,
       'Application process ' || c.process_name || ' of app ' || aa.alias || ' in '
         || aa.workspace || ' has the condition type Never.' as message
  from apex_application_processes c
  join apex_applications aa
    on aa.application_id = c.application_id
       and aa.workspace = c.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and c.condition_type_code = 'NEVER'

Test results

IdentifierMessageMigration
WORKSPACE.CUSTOMERS.10.do-workProcess Do Work on page 10 of app CUSTOMERS in WORKSPACE has the condition type Never.-
WORKSPACE.CUSTOMERS.10.108086226527795312Region Second on page 10 of app CUSTOMERS in WORKSPACE has the condition type Never.-
WORKSPACE.CUSTOMERS.10.saveButton SAVE on page 10 of app CUSTOMERS in WORKSPACE has the condition type Never.-

Parameters

Use parameters to customize the rule to your needs.

ParameterDescriptionDefault Value
ApexWorkspacesComma-separated List of APEX workspaces owning APEX applications to check.dblinter, dbl_gui

References