<ROOT>
 <APPS_INITIALIZE_DATA>
  <USER_NAME>ENGINATICS</USER_NAME>
  <RESPONSIBILITY_KEY>SYSTEM_ADMINISTRATOR</RESPONSIBILITY_KEY>
  <APPLICATION_SHORT_NAME>SYSADMIN</APPLICATION_SHORT_NAME>
 </APPS_INITIALIZE_DATA>
<REPORTS>
<!-- loader xml for Enginatics Blitz Report: EIS Report Conditions -->
 <REPORTS_ROW>
  <GUID>5C69E66DDF03056DE0630100007F964C</GUID><ENABLED>Y</ENABLED>
  <SQL_TEXT>select
x.application,
x.category,
x.report_name,
x.&quot;EIS Report ID&quot;,
x.view_name,
x.seeded,
x.condition_seq,
x.condition_name,
x.condition_type,
x.enabled,
x.detail_seq,
x.item_type,
x.item,
x.operator,
x.value,
x.value2,
x.advanced_template,
x.condition_text,
xxen_util.yes(x.hardcoded) hardcoded
from
(
select
y.*,
case when y.condition_text is not null and count(case when regexp_like(y.condition_text,&apos;:[[:alpha:]]&apos;) then 1 end) over (partition by y.condition_id)=0 then &apos;Y&apos; end hardcoded
from
(
select
era.application_name application,
errc.category_name category,
err.report_name,
err.report_id &quot;EIS Report ID&quot;,
err.view_name,
xxen_util.yes(err.seeded_flag) seeded,
errch.display_order condition_seq,
errch.condition_name,
initcap(replace(errch.condition_type,&apos;_&apos;,&apos; &apos;)) condition_type,
xxen_util.yes(errch.enabled) enabled,
errcd.display_order detail_seq,
d.item_type,
d.item,
d.operator,
d.value1 value,
d.value2,
decode(errch.condition_type,&apos;ADVANCED&apos;,trim(errch.advanced_condition)) advanced_template,
case
when d.free_text is not null then d.free_text
when d.item is null then null
when d.operator in (&apos;is null&apos;,&apos;is not null&apos;) then d.item||&apos; &apos;||d.operator
when d.value1 is null then null
when d.operator=&apos;between&apos; then d.item||&apos; between &apos;||d.value1||&apos; and &apos;||d.value2
when d.operator in (&apos;in&apos;,&apos;not in&apos;) then d.item||&apos; &apos;||d.operator||&apos; (&apos;||d.value1||&apos;)&apos;
else d.item||&apos; &apos;||d.operator||&apos; &apos;||d.value1
end condition_text,
errch.condition_id,
errcd.detail_id
from
xxeis.eis_rs_reports err,
xxeis.eis_rs_applications era,
xxeis.eis_rs_report_categories errc,
xxeis.eis_rs_report_cond_headers errch,
xxeis.eis_rs_report_cond_details errcd,
(
select
o.detail_id,
o.operator,
o.free_text,
max(decode(o.role,1,o.operand_type)) item_type,
max(decode(o.role,1,o.operand)) item,
max(decode(o.role,2,o.operand)) value1,
max(decode(o.role,3,o.operand)) value2
from
(
select
c.detail_id,
c.role,
c.operator,
c.free_text,
case
when c.text is not null then &apos;Expression&apos;
when c.view_column_id is not null and ervc.view_column_id is not null then &apos;View Column&apos;
when c.column_id is not null then &apos;Report Column&apos;
when errp.parameter_id is not null then &apos;Parameter&apos;
end operand_type,
case
when c.text is not null then c.text
when c.view_column_id is null and c.derived_flag=&apos;Y&apos; then c.calculation_column
when ervc.view_column_id is not null then
coalesce(
ervc_comp.alias_name,
(
select
min(ervc_comp2.alias_name)
from
xxeis.eis_rs_report_views errv,
xxeis.eis_rs_view_components ervc_comp2
where
c.report_id=errv.report_id and
ervc.view_id=errv.view_id and
errv.view_component_id=ervc_comp2.view_component_id
having
count(*)=1
),
erv.view_alias
)||&apos;.&apos;||ervc.column_name
when c.column_id is not null then c.column_name
when errp.parameter_id is not null then &apos;:&apos;||errp.parameter_name
end operand
from
(
select
z.*,
errc_col.column_id,
errc_col.column_name,
errc_col.derived_flag,
errc_col.calculation_column,
nvl(z.view_column_id,errc_col.view_column_id) resolved_view_column_id,
nvl(z.view_component_id,errc_col.view_component_id) resolved_view_component_id
from
(
select
errch.report_id,
errcd.detail_id,
rowgen.column_value role,
decode(errcd.operator,
&apos;IN&apos;,&apos;in&apos;,
&apos;NOTIN&apos;,&apos;not in&apos;,
&apos;EQUALS&apos;,&apos;=&apos;,
&apos;NOTEQUALS&apos;,&apos;&lt;&gt;&apos;,
&apos;NOT_EQUAL&apos;,&apos;&lt;&gt;&apos;,
&apos;GREATER_THAN&apos;,&apos;&gt;&apos;,
&apos;GREATER_THAN_EQUALS&apos;,&apos;&gt;=&apos;,
&apos;LESS_THAN&apos;,&apos;&lt;&apos;,
&apos;LESS_THAN_EQUALS&apos;,&apos;&lt;=&apos;,
&apos;LIKE&apos;,&apos;like&apos;,
&apos;BETWEEN&apos;,&apos;between&apos;,
&apos;IS&apos;,&apos;is&apos;,
&apos;IS_NULL&apos;,&apos;is null&apos;,
&apos;IS_NOT_NULL&apos;,&apos;is not null&apos;
) operator,
regexp_replace(errcd.free_text,&apos;^\s*and\s*|\s+$&apos;,&apos;&apos;,1,0,&apos;i&apos;) free_text,
trim(decode(rowgen.column_value,1,errcd.item,2,errcd.value1,3,errcd.value2)) text,
decode(rowgen.column_value,1,errcd.item_view_column_id,2,errcd.value1_view_column_id,3,errcd.value2_view_column_id) view_column_id,
decode(rowgen.column_value,1,errcd.item_view_component_id,2,to_number(errcd.value1_view_component_id),3,to_number(errcd.value2_view_component_id)) view_component_id,
decode(rowgen.column_value,1,errcd.item_report_column_id,2,errcd.value1_report_column_id,3,errcd.value2_report_column_id) report_column_id,
decode(rowgen.column_value,1,errcd.item_report_parameter_id,2,errcd.value1_report_parameter_id,3,errcd.value2_report_parameter_id) parameter_id
from
xxeis.eis_rs_report_cond_headers errch,
xxeis.eis_rs_report_cond_details errcd,
table(xxen_util.rowgen(3)) rowgen
where
errch.condition_id=errcd.condition_id
) z,
xxeis.eis_rs_report_columns errc_col
where
z.report_column_id=errc_col.column_id(+)
) c,
xxeis.eis_rs_view_columns ervc,
xxeis.eis_rs_views erv,
xxeis.eis_rs_view_components ervc_comp,
xxeis.eis_rs_report_parameters errp
where
c.resolved_view_column_id=ervc.view_column_id(+) and
ervc.view_id=erv.view_id(+) and
c.resolved_view_component_id=ervc_comp.view_component_id(+) and
c.parameter_id=errp.parameter_id(+)
) o
group by
o.detail_id,
o.operator,
o.free_text
) d
where
1=1 and
err.application_id=era.application_id and
err.category_id=errc.category_id(+) and
err.report_id=errch.report_id and
errch.condition_id=errcd.condition_id and
errcd.detail_id=d.detail_id
) y
) x
where
2=2
order by
x.application,
x.category,
x.report_name,
x.condition_seq,
x.condition_id,
x.detail_seq,
x.detail_id</SQL_TEXT>
  <VERSION_COMMENTS>Initial version: one row per EIS report condition detail with rendered condition text, advanced template and hardcoded flag.</VERSION_COMMENTS>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>EIS Report Conditions</REPORT_NAME>
    <DESCRIPTION>EIS eXpress report conditions: one row per condition detail (eis_rs_report_cond_details). A Simple or Advanced condition has one detail per term, a Free Text condition one detail holding its SQL fragment, shown without the leading and.

Condition Text renders the term as EIS adds it to the report SQL: item (view column with its alias, report column expression, expression text or :Parameter Name), operator and value. At run time EIS replaces :Parameter Name by the value as a literal, skips a condition whose parameter is empty and appends % to a like parameter value. Condition Text is blank for an incomplete detail without item or value.

Advanced Template combines the details of an Advanced condition: N#$# is the detail with Detail Seq N. In a condition with several details, EIS replaces a detail whose parameter is empty by 1=1. Condition Name is the name EIS stored when the condition was created and can still show the alias of a view or report it was copied from.

Hardcoded flags conditions that reference no parameter in any detail, so they apply to every run.

Executed within Days keeps the reports run from eXpress or XL Connect in that window. EIS purges its run history; EIS Execution History shows the earliest retained run.</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
  </REPORT_TRANSLATIONS>
  <CATEGORY_ASSIGNMENTS>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>EIS</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
  </CATEGORY_ASSIGNMENTS>
  <ANCHORS>
   <ANCHORS_ROW>
    <ANCHOR>1=1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>2=2</ANCHOR>
   </ANCHORS_ROW>
  </ANCHORS>
  <PARAMETERS>
   <PARAMETERS_ROW>
    <SORT_ORDER>1</SORT_ORDER>
    <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>era.application_name=:application</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
era.application_name value,
era.description
from
xxeis.eis_rs_applications era
order by
era.application_name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Application</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>2</SORT_ORDER>
    <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>errc.category_name=:category</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select distinct
errc.category_name value,
null description
from
xxeis.eis_rs_report_categories errc,
xxeis.eis_rs_applications era
where
errc.application_id=era.application_id and
(:$flex$.application is null or xxen_util.contains(:$flex$.application,era.application_name)=&apos;Y&apos;)
order by
errc.category_name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Category</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>3</SORT_ORDER>
    <DISPLAY_SEQUENCE>30</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>err.report_name=:report_name</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
err.report_name value,
err.description
from
xxeis.eis_rs_reports err
order by
err.report_name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Report Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>4</SORT_ORDER>
    <DISPLAY_SEQUENCE>40</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>err.seeded_flag=&apos;Y&apos;</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes_No</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
lookup_code id,
meaning value,
null description
from
fnd_lookups
where fnd_lookups.lookup_type=&apos;YES_NO&apos;
order by value,description</LOV_QUERY_DSP>
    <MATCHING_VALUE>Y</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Seeded</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>5</SORT_ORDER>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>err.seeded_flag is null</SQL_TEXT>
    <MATCHING_VALUE>N</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Seeded</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>6</SORT_ORDER>
    <DISPLAY_SEQUENCE>50</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>err.report_id in (select /*+ no_unnest */ erp.report_id from xxeis.eis_rs_processes erp where erp.submission_source in (&apos;eXpress&apos;,&apos;XL Connect&apos;) and erp.start_time&gt;=sysdate-:executed_within_days)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Number</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>365</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Executed within Days</PARAMETER_NAME>
      <DESCRIPTION>Reports run within this many days before today. Blank includes reports without runs.</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>7</SORT_ORDER>
    <DISPLAY_SEQUENCE>60</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>errch.condition_type=:condition_type</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select &apos;SIMPLE&apos; id, &apos;Simple&apos; value, &apos;Column, operator and value&apos; description from dual union all
select &apos;ADVANCED&apos;, &apos;Advanced&apos;, &apos;Details combined by a template&apos; from dual union all
select &apos;FREE_TEXT&apos;, &apos;Free Text&apos;, &apos;SQL fragment&apos; from dual</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Condition Type</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>8</SORT_ORDER>
    <DISPLAY_SEQUENCE>70</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>errch.enabled=:enabled</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes_No</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
lookup_code id,
meaning value,
null description
from
fnd_lookups
where fnd_lookups.lookup_type=&apos;YES_NO&apos;
order by value,description</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Enabled</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>9</SORT_ORDER>
    <DISPLAY_SEQUENCE>80</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>x.hardcoded=&apos;Y&apos;</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes_No</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
lookup_code id,
meaning value,
null description
from
fnd_lookups
where fnd_lookups.lookup_type=&apos;YES_NO&apos;
order by value,description</LOV_QUERY_DSP>
    <MATCHING_VALUE>Y</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Hardcoded</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>10</SORT_ORDER>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>x.hardcoded is null</SQL_TEXT>
    <MATCHING_VALUE>N</MATCHING_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Hardcoded</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
  </PARAMETERS>
  <TEMPLATES>
  </TEMPLATES>
  <DEFAULT_TEMPLATES>
  </DEFAULT_TEMPLATES>
  <UPLOAD_COLUMNS>
  </UPLOAD_COLUMNS>
  <UPLOAD_PARAMETERS>
  </UPLOAD_PARAMETERS>
  <UPLOAD_SQLS>
  </UPLOAD_SQLS>
 </REPORTS_ROW>
</REPORTS>
</ROOT>
