Hitachi Vantara Pentaho Community Forums
Results 1 to 9 of 9

Thread: CDF: Problem with Executing Xaction

  1. #1
    Join Date
    Aug 2008
    Posts
    563

    Default CDF: Problem with Executing Xaction

    Hi,
    I have just started using CDF and followed the examples.
    Basically, I use the Date Range Picker which create the two variables date1 and date2. I aslo use a Select Menu to choose the output format. Then, in the last tab I have the Execute Xaction. When I try to click the button I get following error message:
    Code:
    Error: RuntimeContext.ERROR_0012 - ActionDefinition for JFreeReportComponent did not execute successfully (org.pentaho.platform.engine.services.runtime.RuntimeContext)Debug: Starting execute of Peoplesound/NewRegistrations/NewRegistrationsNoPar.xaction (org.pentaho.platform.engine.services.solution.SolutionEngine)
    Debug: Getting runtime context and data (org.pentaho.platform.engine.services.solution.SolutionEngine)
    Debug: Loading action sequence definition file (org.pentaho.platform.engine.services.solution.SolutionEngine)
    Debug: audit: instanceId=41a02358-2f26-11de-a69d-77623bce1d49, objectId=org.pentaho.platform.engine.services.runtime.RuntimeContext, messageType=action_sequence_start (org.pentaho.platform.engine.services.runtime.RuntimeContext)
    Error: RuntimeContext.ERROR_0012 - ActionDefinition for JFreeReportComponent did not execute successfully (org.pentaho.platform.engine.services.runtime.RuntimeContext)
    Error: SolutionEngine.ERROR_0007 - Action sequence execution failed (org.pentaho.platform.engine.services.solution.SolutionEngine)
    
      Server Version: Pentaho Platform Engine Core 2.0.0.stable.35509
    This is the CDF execute xaction code that I use :
    Code:
        var executeNewRegistrations = 
            {
              name: "executeNewRegistrations",
              type: "ExecuteXaction",
              solution: "Peoplesound",
              path: "NewRegistrations",
              action: "NewRegistrationsNoPar.xaction",
              listeners:["date1", "date2", "outputType" ],
              parameters: [["date1", null ], ["date2", null], ["outputType", null]],
              htmlObject: "executeObject",
              executeAtStart: true,
              preChange: function(){return true;},
              postChange: function(){return true;},
              tooltip: "Press button to create report!"
            };
            Dashboards.init([executeNewRegistrations]);
    I first thought the problem might be with my report, but I created a seperate Xaction with all the prompts and test it and it works.

    Could you please help me to find the error that I made?

    Thanks,
    Diddy

  2. #2
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    parameters: [["date1", null ], ["date2", null], ["outputType", null]], <- is this correct?
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  3. #3
    Join Date
    Aug 2008
    Posts
    563

    Default

    Hi,
    I cannot find the problem in the code ... can you please help me with this? Please find all the relevant code below:
    Code:
    <div id="example" class="flora">
                <ul>
    
                    <li><a href="#date_range"><span>Date Range</span></a></li>
                    <li><a href="#output_type"><span>Output Type</span></a></li>
                    <li><a href="#execute"><span>Execute</span></a></li>
                </ul>
                <div id="date_range">
                    <div id="dateRangeObject"></div>
                </div>
    
    
                <div id="output_type">
                        <div id="outputTypeObject"></div>
                </div>
    
                <div id="execute">
                        <button id="executeObject" >Execute Report</button>    
                </div>
    
    
    
                </div>
    
            </div>
        </div>
    
        <script language="javascript" type="text/javascript">
            
            // output type picker
            
            var outputType;
            var outputTypeSelector;
    
    
            outputTypeSelector = 
                        {
                            name: "outputTypeSelector",
                            type: "select",
                            parameters:[],
                            valuesArray:[["html","Web Page"],["xls","MS Excel"],["pdf","PDF"] ],
                            parameter:"outputType",
                            valueAsId: false,
                            htmlObject: "outputTypeObject",
                            executeAtStart: true,
                            //postChange: function(){alert("You chose: " + outputType);}
                        };
                        Dashboards.init([outputTypeSelector]);
    
    
            //date range picker
            var date1 = "2009-01-01";
            var date2 = "2009-03-01";
            var myInput;
            var tabs = $("#example").tabs();
            evaluateCode(false);
    
            $("#sampleObject").empty();
            myInput = 
            {
                name: "myInput",
                type: "dateRangeInputComponent",
                parameter: ["date1","date2"],
                singleInput: false,
                inputSeparator: "<br />",
                htmlObject: "dateRangeObject",
                executeAtStart: true,
                tooltip: "Click me to select a date",
                //postChange: function(date1, date2){alert("You chose from " + date1 + " to " + date2 );}
            };
    
            Dashboards.init([myInput]);
    
            // Execute Report
            var executeNewRegistrations = 
            {
              name: "executeNewRegistrations",
              type: "ExecuteXaction",
              solution: "Peoplesound",
              path: "NewRegistrations",
              action: "NewRegistrationsNoPar.xaction",
              listeners:["date1", "date2", "outputType" ],
              parameters: [["date1", null ], ["date2", null], ["outputType", null]],
              htmlObject: "executeObject",
              executeAtStart: true,
              preChange: function(){return true;},
              postChange: function(){return true;},
              tooltip: "Press button to create report!"
            };
            Dashboards.init([executeNewRegistrations]);
                    
        </script>
    The SQL query in the Xaction looks like this:
    Code:
    SELECT
    registrychannel,
    countryMsisdn as country,
    count(*) as new_registration
    FROM
    pentaho.sn_user
    WHERE
    `registrationDate` >= "{date1} 00:00:00" AND
    `registrationDate` <= "{date2} 23:59:59"
    GROUP BY 1,2
    Last edited by diddy; 04-22-2009 at 10:54 AM.

  4. #4
    Join Date
    Aug 2008
    Posts
    563

    Default

    I am still not sure what the second array value should be:

    parameters: [["date1", date1], ["date2",date2], ["outputType",outputType]]

    ... I tried this now but it doesn't work either. What do I have to do here exactly?
    The variable date1, date2 and outputType I get from the previous functions.

    Please see also my whole code below ... Thanks!

  5. #5
    Join Date
    Aug 2008
    Posts
    563

    Default

    Ok, I got the dates working now with this: parameters: [["date1", date1], ["date2",date2]], but if I add the outputType it is not working.

    Is there any special setting that I have to take into consideration when saving the reporting design to the server? Should I have "Promt for report output type" on or off?

  6. #6
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    I think it should be off, but those don't work differently from the others. You're very close, compare that with the examples and you should be fine
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  7. #7
    Join Date
    Aug 2008
    Posts
    563

    Default

    Thanks for your reply! The problem is, that in the xaction file I don't really know how to reference the output type.
    Normally, you have an input string called outputType ... I tried to set that value to {outputType} ... but that didn't work.
    Then I tried to set the report format in the report action to {outputType}, but that didn't work either ...
    Can you please let me know how to reference the outputType paramater within the xaction?

  8. #8
    Join Date
    Aug 2008
    Posts
    563

    Default

    Thanks for your reply! The problem is, that in the xaction file I don't really know how to reference the output type.
    Normally, you have an input string called outputType ... I tried to set that value to {outputType} ... but that didn't work.
    Then I tried to set the report format in the report action to {outputType}, but that didn't work either ...
    Can you please let me know how to reference the outputType paramater within the xaction?
    Also, I cannot really find any examples that have an outputType Selector.

  9. #9
    Join Date
    Dec 2008
    Posts
    13

    Default

    Can you please try this, I'm not sure if it can help you...

    Under your <inputs> tag :

    Code:
      <outputType type="string"> 
          <sources> 
            <request>outputType</request>  
            <request>type</request> 
          </sources>  
          <default-value><![CDATA[pdf]]></default-value> 
        </outputType>  
        <outputTypeList type="property-map-list"> 
          <sources> 
            <runtime>outputTypeList</runtime> 
          </sources>  
          <default-value type="property-map-list"> 
            <property-map> 
              <entry key="report-output-desc">PDF</entry>  
              <entry key="report-output-type-id">pdf</entry> 
            </property-map>  
            <property-map> 
              <entry key="report-output-desc">Excel</entry>  
              <entry key="report-output-type-id">xls</entry> 
            </property-map>  
            <property-map> 
              <entry key="report-output-desc">Word</entry>  
              <entry key="report-output-type-id">rtf</entry> 
            </property-map>  
            <property-map> 
              <entry key="report-output-desc">Web Page</entry>  
              <entry key="report-output-type-id">html</entry> 
            </property-map>  
            <property-map> 
              <entry key="report-output-desc">Comma Separated Value</entry>  
              <entry key="report-output-type-id">csv</entry> 
            </property-map> 
          </default-value> 
        </outputTypeList>
    Use also :
    Code:
     <actions> 
        <action-definition> 
          <component-name>SecureFilterComponent</component-name>
          <action-type>Secure Filter Description</action-type>
          <action-inputs> 
            <outputTypeList type="property-map-list"/>  
            <outputType type="string"/> 
          </action-inputs>
          <component-definition> 
            <selections> 
              <outputType style="list"> 
                <title>Choose Report Format</title>  
                <filter value-col-name="report-output-type-id" display-col-name="report-output-desc">outputTypeList</filter> 
              </outputType> 
            </selections> 
          </component-definition> 
        </action-definition>
    Under your "<action-definition>" tag add :
    Code:
      <action-inputs> 
            <output-type type="string" mapping="outputType"/>
     </action-inputs>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.