<?xml version="1.0" encoding="UTF-8"?>
<action-sequence>
<title>Refresh OEOS</title>
<version>1</version>
<logging-level>DEBUG</logging-level>
<documentation>
<author>Gerald E Butler</author>
<description>Empty blank action sequence document</description>
<help/>
<result-type>rule</result-type>
<icon/>
</documentation>
<inputs/>
<outputs>
<query_result type="result-set"/>
</outputs>
<resources/>
<actions>
<action-definition>
<component-name>MDXLookupRule</component-name>
<action-type>OLAP Connection</action-type>
<action-resources/>
<action-outputs>
<prepared_component type="mdx-connection" mapping="shared_olap_connection"/>
</action-outputs>
<component-definition>
<mdx-connection-string><![CDATA[DataSource=GlobalBI;Catalog=solution:/GlobalBI/Admin/RTC_GlobalBI_Sales.xml;DynamicSchemaProcessor=mondrian.i18n.LocalizingDynamicSchemaProcessor]]></mdx-connection-string>
</component-definition>
</action-definition>
<action-definition>
<component-name>JavascriptRule</component-name>
<action-type>Clear OEOS Cache</action-type>
<action-inputs>
<shared_olap_connection type="mdx-connection"/>
</action-inputs>
<action-outputs>
<rule-result type="string" mapping="rule_result"/>
</action-outputs>
<component-definition>
<script><![CDATA[function clearOEOSCache() {
out.println( "Acquiring Shared OLAP Connection" );
//var session = org.pentaho.platform.engine.core.system.PentahoSessionHolder.getSession();
//shared_olap_connection = new Packages.org.pentaho.platform.plugin.services.connections.mondrian.SharedCacheMDXConnection( "DataSource=GlobalBI;Catalog=solution:/GlobalBI/Admin/RTC_GlobalBI_Sales.xml;DynamicSchemaProcessor=mondrian.i18n.LocalizingDynamicSchemaProcessor", Packages.org.pentaho.platform.api.engine.ILogger(session) );
out.println( "Got Here" );
var pw = new java.io.PrintWriter( out, true );
var conn = shared_olap_connection.shareConnection().getConnection();
var oeosCube = conn.getSchema().lookupCube("OEOSBookingsBillingsWithTargets",true);
var cacheControl = conn.getCacheControl( null );
var measureRegion = cacheControl.createMeasuresRegion( oeosCube );
out.println( "Cache before Flush" );
cacheControl.printCacheState( pw, measureRegion );
out.println( "Flush" );
cacheControl.flush( measureRegion );
out.println( "Cache after Flush" );
cacheControl.printCacheState( pw, measureRegion );
out.println( "Done" );
}
clearOEOSCache();]]></script>
</component-definition>
</action-definition>
<action-definition>
<component-name>MDXLookupRule</component-name>
<action-type>OLAP</action-type>
<action-inputs>
<prepared_component type="mdx-connection" mapping="shared_olap_connection"/>
</action-inputs>
<action-outputs>
<query-results type="result-set" mapping="query_result"/>
</action-outputs>
<component-definition>
<query><![CDATA[select
[Measures].[Booking Lines] on columns,
[Company].AllMembers on rows
from
[OEOSBookingsBillingsWithTargets]
/*
with
member
[Measures].[OEOS Booking Money Today]
as
'[Measures].[Booking Price In USD At Management Rate]'
member [Measures].[OEOS Booking Money PTD]
as
'[Measures].[Booking Price In USD At Management Rate PTD]'
member
[Measures].[OEOS Billing Money Today]
as
'[Measures].[Billing Price In USD At Management Rate]'
member [Measures].[OEOS Billing Money PTD]
as
'[Measures].[Billing Price In USD At Management Rate PTD]'
select
{
[Measures].[Booking Lines],
[Measures].[Booking Lines PTD],
[Measures].[Booking Orders],
[Measures].[Booking Orders PTD],
[Measures].[OEOS Booking Money Today],
[Measures].[OEOS Booking Money PTD],
[Measures].[Target Booking Day of Month],
[Measures].[Target Booking Days in Month],
[Measures].[Target Booking Amount For Month],
[Measures].[Target Booking Amount Month To Date],
[Measures].[Billing Lines],
[Measures].[Billing Lines PTD],
[Measures].[Billing Shipments],
[Measures].[Billing Shipments PTD],
[Measures].[OEOS Billing Money Today],
[Measures].[OEOS Billing Money PTD],
[Measures].[Target Billing Day of Month],
[Measures].[Target Billing Days in Month],
[Measures].[Target Billing Amount For Month],
[Measures].[Target Billing Amount Month To Date]
}
ON COLUMNS,
Hierarchize(
Union(
( {
[Customer Local Reporting Group.Local Reporting Group].[All Customer Local Reporting Group.Local Reporting Groups]
}
*
{
[Company].[EUR]
}
),
(
[Customer Local Reporting Group.Local Reporting Group].[Group].Members
*
[Company].[EUR].Children
)
),
POST )
ON ROWS
from
[OEOSBookingsBillingsWithTargets]
where
CurrentDateMember( [OEOS BCR Date.YQMD], '["OEOS BCR Date.YQMD"]\.["Day"]\.[yyyymmdd]' )
*/]]></query>
</component-definition>
</action-definition>
<action-definition>
<component-name>JavascriptRule</component-name>
<action-type>Check cache state</action-type>
<action-inputs>
<shared_olap_connection type="mdx-connection"/>
</action-inputs>
<action-outputs>
<rule-result type="string"/>
</action-outputs>
<component-definition>
<script><![CDATA[function clearOEOSCache() {
var pw = new java.io.PrintWriter( out, true );
var conn = shared_olap_connection.shareConnection().getConnection();
var oeosCube = conn.getSchema().lookupCube("OEOSBookingsBillingsWithTargets",true);
var cacheControl = conn.getCacheControl( null );
var measureRegion = cacheControl.createMeasuresRegion( oeosCube );
out.println( "Cache after refresh Flush" );
cacheControl.printCacheState( pw, measureRegion );
out.println( "Done" );
}
clearOEOSCache();]]></script>
</component-definition>
</action-definition>
</actions>
</action-sequence>