Hitachi Vantara Pentaho Community Wiki
Child pages
  • 1 - Example Action Sequence XML
Skip to end of metadata
Go to start of metadata

This is a listing of the Example1.xaction Action Sequence Document.


   <!-- some header nodes deleted -->

      <region type="string">

      <from type="string">

      <subject type="string">
         <default-value>Pentaho Example1</default-value>

      <message-plain type="string">
                 This is an email from the Pentaho BI Platform - Example1



            <region type="string"/>

            <rule_result type="string"/>

                  if ( "Central".equals( region ) ) {
                     rule_result = "";
                  else {
                     rule_result = "";

            <to type="string" mapping="rule_result"/>
            <from type="string"/>
            <subject type="string"/>
            <message-plain type="string"/>


In this example, the Action Sequence has 4 inputs: region, from, subject and message-plain. For region, the type is defined as a string; it has a default value of Central and may come from one of two sources; request and session. When the RuntimeContext resolves the region input at runtime, it will first look in the request (most likely an http request.) If it doesn't find it in the request, it will look in the session (most likely the http session.) If it is not available in the session, the default value will be used. The order that the sources are specified in the XML document is the order that they will be searched. The default is always used as a last resort.

The other inputs only specify a default value. This is analogous to hard coding the parameters to a constant value. Since the output of this Action Sequence is an email, no output parameters will be set.

There are 2 action-definition nodes for this sequence. The first defines a JavaScript rule and requires a region parameter; it will create a new parameter called rule_result. This new parameter will be made available to other action-definition nodes in the sequence.

Without getting too deep into the workings of the JavaScript rule, the script defined in the component-definition will be executed and will set the value of rule_result to the appropriate email address based on the value of region.

When the first <action-definition> completes, the second will execute. It defines an interaction with the Email component. The email component requires 4 action-inputs: to, from, subject and message-plain. You may have noticed that the action-inputs: from, subject and message-plain are specified in the inputs section of the Action Sequence header. The RuntimeContext will take the values from there and hand them to the Email Component just as it handed region to the JavaScript Component. The source of the to action-input isn't directly defined. It is indirectly defined with the mapping attribute. This attribute is telling the RuntimeContext to use the value from rule_result that was generated by the JavaScript rule and use it as the components to input.

  • No labels


  1. user-0ac74


    Help to run on execution file "cache_query_mdx_rus5.xaction" that contains the query Russian characters. This same example using the circuit operates in English (used the same scheme, the only difference is that all the names were in English). Here is the code that causes the error at startup:

    <?xml version="1.0" encoding="UTF-8"?>


      <title>Prime Mondrian Cache</title>




        <author>Alexandr Dashkevich</author>

        <description>An example of priming Mondrian Cache</description>



















          <action-type>OLAP Connection</action-type>


            <catalog type="resource"/>



            <prepared_component type="mdx-connection" mapping="shared_olap_connection"/>











            <prepared_component type="mdx-connection" mapping="shared_olap_connection"/>



            <query-results type="result-set" mapping="query_result"/>





    Set [*NATIVE_CJ_SET] as 'Filter([*BASE_MEMBERS_Авиакомпания], Not IsEmpty ([Measures].[Тарифный объём]))'

    Set [*SORTED_ROW_AXIS] as 'Order([*CJ_ROW_AXIS],[Авиакомпания].CurrentMember.OrderKey,BASC)'

    Set [*BASE_MEMBERS_Measures] as '

    Unknown macro: {[Measures].[Тарифный объём]}


    Set [*CJ_ROW_AXIS] as 'Generate([*NATIVE_CJ_SET],

    Unknown macro: {([Авиакомпания].currentMember)}


    Set [*BASE_MEMBERS_Авиакомпания] as '[Авиакомпания].[Название авиакомпании].Members'

    Set [*CJ_COL_AXIS] as '[*NATIVE_CJ_SET]'


    [*BASE_MEMBERS_Measures] on columns,

    [*SORTED_ROW_AXIS] on rows

    From [Cube of sales]







    Run performance via URL query:


    Webbrowser an error:

    This page contains the following errors:">This page contains the following errors:

    error on line 2 at column 17: Extra content at the end of the document

    Below is a rendering of the page up to the first error.">Below is a rendering of the page up to the first error.

    I assume that the error in the settings. Help me to solve it.

    Thank you in advance.

  2. user-0e04f

    The solution is found. The problem has been the organization schema.

    Names in the scheme must be in English, in Russian сaption.

    MDX-query in English.