Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 24th, 2012  |  syntax: XML  |  size: 6.28 KB  |  hits: 27  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <action-sequence>
  3.   <title>Refresh OEOS</title>
  4.   <version>1</version>
  5.   <logging-level>DEBUG</logging-level>
  6.   <documentation>
  7.     <author>Gerald E Butler</author>  
  8.     <description>Empty blank action sequence document</description>  
  9.     <help/>  
  10.     <result-type>rule</result-type>  
  11.     <icon/>
  12.   </documentation>
  13.  
  14.   <inputs/>
  15.  
  16.   <outputs>
  17.     <query_result type="result-set"/>
  18.   </outputs>
  19.  
  20.   <resources/>
  21.  
  22.   <actions>
  23.     <action-definition>
  24.       <component-name>MDXLookupRule</component-name>
  25.       <action-type>OLAP Connection</action-type>
  26.       <action-resources/>
  27.       <action-outputs>
  28.         <prepared_component type="mdx-connection" mapping="shared_olap_connection"/>
  29.       </action-outputs>
  30.       <component-definition>
  31.         <mdx-connection-string><![CDATA[DataSource=GlobalBI;Catalog=solution:/GlobalBI/Admin/RTC_GlobalBI_Sales.xml;DynamicSchemaProcessor=mondrian.i18n.LocalizingDynamicSchemaProcessor]]></mdx-connection-string>
  32.       </component-definition>
  33.     </action-definition>
  34.  
  35.     <action-definition>
  36.       <component-name>JavascriptRule</component-name>
  37.       <action-type>Clear OEOS Cache</action-type>
  38.       <action-inputs>
  39.         <shared_olap_connection type="mdx-connection"/>
  40.       </action-inputs>
  41.       <action-outputs>
  42.         <rule-result type="string" mapping="rule_result"/>
  43.       </action-outputs>
  44.       <component-definition>
  45.         <script><![CDATA[function clearOEOSCache() {
  46.                 out.println( "Acquiring Shared OLAP Connection" );
  47.                 //var session = org.pentaho.platform.engine.core.system.PentahoSessionHolder.getSession();
  48.                 //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) );
  49.                 out.println( "Got Here" );
  50.                 var pw = new java.io.PrintWriter( out, true );
  51.                 var conn                        = shared_olap_connection.shareConnection().getConnection();
  52.                 var oeosCube                    = conn.getSchema().lookupCube("OEOSBookingsBillingsWithTargets",true);
  53.                 var cacheControl                = conn.getCacheControl( null );
  54.                 var measureRegion               = cacheControl.createMeasuresRegion( oeosCube );
  55.                 out.println( "Cache before Flush" );
  56.                 cacheControl.printCacheState( pw, measureRegion );
  57.                 out.println( "Flush" );
  58.                 cacheControl.flush( measureRegion );
  59.                 out.println( "Cache after Flush" );
  60.                 cacheControl.printCacheState( pw, measureRegion );
  61.                 out.println( "Done" );
  62. }
  63. clearOEOSCache();]]></script>
  64.       </component-definition>
  65.     </action-definition>
  66.  
  67.     <action-definition>
  68.       <component-name>MDXLookupRule</component-name>
  69.       <action-type>OLAP</action-type>
  70.       <action-inputs>
  71.         <prepared_component type="mdx-connection" mapping="shared_olap_connection"/>
  72.       </action-inputs>
  73.       <action-outputs>
  74.         <query-results type="result-set" mapping="query_result"/>
  75.       </action-outputs>
  76.       <component-definition>
  77.         <query><![CDATA[select
  78.         [Measures].[Booking Lines] on columns,
  79.         [Company].AllMembers on rows
  80. from
  81.         [OEOSBookingsBillingsWithTargets]
  82. /*
  83. with
  84.                 member
  85.                         [Measures].[OEOS Booking Money Today]
  86.                 as
  87.                         '[Measures].[Booking Price In USD At Management Rate]'
  88.                 member [Measures].[OEOS Booking Money PTD]
  89.                 as
  90.                         '[Measures].[Booking Price In USD At Management Rate PTD]'
  91.                 member
  92.                         [Measures].[OEOS Billing Money Today]
  93.                 as
  94.                         '[Measures].[Billing Price In USD At Management Rate]'
  95.                 member [Measures].[OEOS Billing Money PTD]
  96.                 as
  97.                         '[Measures].[Billing Price In USD At Management Rate PTD]'
  98.                 select
  99.                         {
  100.                                 [Measures].[Booking Lines],
  101.                                 [Measures].[Booking Lines PTD],
  102.                                 [Measures].[Booking Orders],
  103.                                 [Measures].[Booking Orders PTD],
  104.                                 [Measures].[OEOS Booking Money Today],
  105.                                 [Measures].[OEOS Booking Money PTD],
  106.                                 [Measures].[Target Booking Day of Month],
  107.                                 [Measures].[Target Booking Days in Month],
  108.                                 [Measures].[Target Booking Amount For Month],
  109.                                 [Measures].[Target Booking Amount Month To Date],
  110.                                 [Measures].[Billing Lines],
  111.                                 [Measures].[Billing Lines PTD],
  112.                                 [Measures].[Billing Shipments],
  113.                                 [Measures].[Billing Shipments PTD],
  114.                                 [Measures].[OEOS Billing Money Today],
  115.                                 [Measures].[OEOS Billing Money PTD],
  116.                                 [Measures].[Target Billing Day of Month],
  117.                                 [Measures].[Target Billing Days in Month],
  118.                                 [Measures].[Target Billing Amount For Month],
  119.                                 [Measures].[Target Billing Amount Month To Date]
  120.                         }
  121.                         ON COLUMNS,
  122.                         Hierarchize(
  123.                                 Union(
  124.                                         (       {
  125.                                                         [Customer Local Reporting Group.Local Reporting Group].[All Customer Local Reporting Group.Local Reporting Groups]
  126.                                                 }
  127.                                                 *
  128.                                                 {      
  129.                                                         [Company].[EUR]
  130.                                                 }
  131.                                         ),
  132.                                         (      
  133.                                                 [Customer Local Reporting Group.Local Reporting Group].[Group].Members
  134.                                                 *
  135.                                                  [Company].[EUR].Children
  136.                                          )
  137.                                 ),
  138.                                 POST    )
  139.                         ON ROWS
  140.                 from
  141.                         [OEOSBookingsBillingsWithTargets]
  142.                 where
  143.                         CurrentDateMember( [OEOS BCR Date.YQMD], '["OEOS BCR Date.YQMD"]\.["Day"]\.[yyyymmdd]' )
  144. */]]></query>
  145.       </component-definition>
  146.     </action-definition>
  147.  
  148.     <action-definition>
  149.       <component-name>JavascriptRule</component-name>
  150.       <action-type>Check cache state</action-type>
  151.       <action-inputs>
  152.         <shared_olap_connection type="mdx-connection"/>
  153.       </action-inputs>
  154.       <action-outputs>
  155.         <rule-result type="string"/>
  156.       </action-outputs>
  157.       <component-definition>
  158.         <script><![CDATA[function clearOEOSCache() {
  159.                 var pw = new java.io.PrintWriter( out, true );
  160.                 var conn                        = shared_olap_connection.shareConnection().getConnection();
  161.                 var oeosCube                    = conn.getSchema().lookupCube("OEOSBookingsBillingsWithTargets",true);
  162.                 var cacheControl                = conn.getCacheControl( null );
  163.                 var measureRegion               = cacheControl.createMeasuresRegion( oeosCube );
  164.                 out.println( "Cache after refresh Flush" );
  165.                 cacheControl.printCacheState( pw, measureRegion );
  166.                 out.println( "Done" );
  167. }
  168. clearOEOSCache();]]></script>
  169.       </component-definition>
  170.     </action-definition>
  171.  
  172.   </actions>
  173. </action-sequence>