Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Traffic Component

  1. #1
    Join Date
    Jun 2013
    Posts
    17

    Default Traffic Component

    Hi,

    I have problems using the Traffic Component. It shows always the red light. The 'Intervals Array' is defined and I'm using a datasource which gives me one integer back.

    What am I doing wrong? I hope someone can help.
    Thanks in advance...

  2. #2
    Join Date
    Nov 2011
    Posts
    1,229

    Default

    is there anything in the javascript console log?
    Pedro Vale
    --
    CTools Product Development
    http://www.webdetails.pt

  3. #3
    Join Date
    Jun 2013
    Posts
    17

    Default

    Hi Pedro,

    There was a message "ERROR [SolutionEngine] 76d7d926-da67-11e2-8aa7-935ca2e401fc:SOLUTION-ENGINE:traffic.xaction: SolutionEngine.ERROR_0007". Now I modified the traffic.xaction to use a JNDI query:

    Name:  JNDI.jpg
Views: 133
Size:  10.7 KB

    For testing I have defined the JNDI string and the Query as default values. When I run the xaction from design studio it works. When I start the dashboard (designed with CDE) I can see the correct value in the traffic component now. But with the wrong color. It should be yellow but it's green:

    Name:  wrong_traffic.jpg
Views: 138
Size:  7.3 KB

    The xaction is only working when I let the field 'Datasource' in the traffic component (CDE) empty. So the xaction is only working with the defined default values. If I'm connect the component to a datasource (JNDI query) I will get the error as described above. I have teted my JNDI query with CDA and it works fine.

    So, I hope you can help me. at the moment I have no ideas any more.
    Thanks in advance...

  4. #4
    Join Date
    Nov 2011
    Posts
    1,229

    Default

    I think you should try and figure out why that xaction is failing. Can you post the stack traces, please?
    Pedro Vale
    --
    CTools Product Development
    http://www.webdetails.pt

  5. #5
    Join Date
    Jun 2013
    Posts
    17

    Default

    Hi Pedro,

    The problem appears only if I define a datasource for the traffic component in CDE. It seams that he cannot get the parameters. The following two screenshots are showing my settings in CDE:

    Name:  Components.jpg
Views: 132
Size:  13.6 KB

    Name:  DataSource.jpg
Views: 127
Size:  13.6 KB

    In the console I have the following message:

    Code:
    09:00:01,420 ERROR [SolutionEngine] 2fc39053-def7-11e2-8cb5-c772db504188:SOLUTION-ENGINE:traffic.xaction: SolutionEngine.ERROR_0007 - Fehler beim Ausführen der Actionsequenz
    If I'm removing the datasource entry in CDE, the system prints out my defaut value for "JNDI" and "QUERY".

    Code:
    JNDI: Dummy1
    QUERY: Dummy2
    VALUE: 8
    In this case I can see the value "8" also in traffic component but with the wrong color. The traffic component shows green instead of yellow. The Intervals Array is defind as ["1","10"].
    Regarding the color there is no information in the trace.

    Here is the modified traffic.xaction: For testing I defined "JNDI" and "QUERY" with fix values.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <action-sequence> 
      <title>KPI-Quality</title>
      <version>1</version>
      <logging-level>DEBUG</logging-level>
      <documentation> 
        <author/>  
        <description/>  
        <help/>  
        <result-type/> 
      </documentation>
    
    
      <inputs> 
        <JNDI type="string"> 
          <sources> 
            <request>Jndi</request> 
          </sources>  
          <default-value><![CDATA[Dummy1]]></default-value> 
        </JNDI>  
        <QUERY type="string"> 
          <sources> 
            <request>Query</request> 
          </sources>  
          <default-value><![CDATA[Dummy2]]></default-value>
        </QUERY> 
      </inputs>
    
    
      <outputs> 
        <VALUE type="string"> 
          <destinations> 
            <response>content</response> 
          </destinations> 
        </VALUE> 
      </outputs>
      
      <actions> 
        <action-definition> 
          <component-name>SQLLookupRule</component-name>
          <action-type>HSQL-JNDI</action-type>
          <action-inputs/>
          <action-outputs> 
            <query-result type="result-set" mapping="query_result"/> 
          </action-outputs>
          <component-definition> 
            <live><![CDATA[true]]></live>  
            <jndi><![CDATA[SQS_HSQL_META]]></jndi>  
            <query><![CDATA[SELECT COUNT(TESTEXECTASK.QUALITYSTATUS_STRING) AS VALUE FROM LASTIMPORT INNER JOIN TESTEXECTASK ON LASTIMPORT.EXPORTOID = TESTEXECTASK.EXPORTOID WHERE TESTEXECTASK.QUALITYSTATUS_STRING='OK']]></query>
          </component-definition> 
        </action-definition>
      
        <action-definition> 
          <component-name>JavascriptRule</component-name>
          <action-type>Format Query Results</action-type>
          <action-inputs> 
            <query_result type="result-set"/>  
            <JNDI type="string"/>
            <QUERY type="string"/>
          </action-inputs>
          <action-outputs> 
            <newResults type="result-set"/>  
            <maxValue type="string"/>  
            <firstInterval type="string"/>  
            <secondInterval type="string"/>  
            <thirdInterval type="string"/>  
            <lastInterval type="string"/>  
            <VALUE type="string"/> 
          </action-outputs>
          <component-definition> 
            <script><![CDATA[var p1;
    var p2;
    p1=JNDI;
    p2=QUERY;
    out.println("JNDI: " + p1);
    out.println("QUERY: " + p2);
    var VALUE;
    var newResults = new JavaScriptResultSet();
    newResults.setColumnHeaders('Value');
    if (query_result != null)
    {
    var rsmd = query_result.getMetaData();
    var a = new Array();
    a[0] = Math.round(query_result.getValueAt(0,0));
    VALUE = a[0];
    out.println("VALUE: " + VALUE);
    newResults.addRow(a);
    };
    newResults;]]></script> 
          </component-definition> 
        </action-definition>
     
      </actions> 
    </action-sequence>

    Any idea?
    Thanks in advance...

  6. #6
    Join Date
    Nov 2011
    Posts
    1,229

    Default

    Yeah, there seems to be a bug here when trying to use CDA. Can you file it at redmine.webdetails.org, please.

    As for the 8 being yellow, that's what it's supposed to show. If your interval is 1-10, then the traffic light will be red if the value is < 1, green for values > 10 and yellow for anything between 1 and 10.

    cheers,
    Pedro Vale
    --
    CTools Product Development
    http://www.webdetails.pt

  7. #7
    Join Date
    Jun 2013
    Posts
    17

    Default

    I will do this.

    >> As for the 8 being yellow, that's what it's supposed to show. If your interval is 1-10, then the traffic light will be red if the value is < 1, green for values > 10 and yellow for anything between 1 and 10.

    It shows green and should be yellow. Please check the screenshot below in the post. There I tested with value 4.

    Thanks in advance...

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.