Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: 3.0.0.GA: problem with GetVariable()

  1. #1
    Join Date
    Nov 2007
    Posts
    29

    Default 3.0.0.GA: problem with GetVariable()

    Ciao,
    in a job with the kettle version 2.5, I use the job entry "Evaluation script" with che following javascript:
    _ _ _
    var HRM = Packages.be.ibridge.kettle.core.util.StringUtil.getVariable("HRM", "");

    HRM == 1;
    _ _ _

    With the porting to the version 3.0 the "Evaluation script" is trasformed in "JavaScript".
    I change the javascript in:
    _ _ _
    var HRM = getVariable("HRM", "");

    HRM == 1;
    _ _ _

    but will no longer work. This work only in "Modified Java Script Value", but I need to use it in a job, not in a trasformation.

    In the documentation there is nothing for the "Javascript" for the job.

    Can someone help me?

    Thanks,
    Luca

  2. #2
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    Luca,

    The 3.0 migration guide is linked from your Welcome page.
    In it you will find the solution to your problem.

    Matt

  3. #3
    Join Date
    Nov 2007
    Posts
    29

    Default

    Sorry, but I don't understand where I wrong. Because the code don't work only in the "Javascript" block, but is correct if it used in "Modify java script" block.

    Can you help me?


    Thanks,
    Luca

  4. #4
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    Luca,

    You are correct, I'm just overworked and I start to overlook things.

    Can you download these jar files and place them in the lib/ directory?

    http://kettle3.s3.amazonaws.com/kettle-ui-swt-3.0.jar
    http://kettle3.s3.amazonaws.com/kettle-engine-3.0.jar

    A solution to your problem was implemented recently as part of this bug report: http://jira.pentaho.org/browse/PDI-508
    The sample referenced there is:

    Code:
    parent_job.getVariable("NR_OF_ROWS") == 1000000
    HTH,

    Matt

  5. #5

    Default connection error

    it's work

    but when i define a connection this error is displayed :

    Error connecting to database [connection] : java.lang.ClassCastException: org.pentaho.di.core.database.DatabaseFactory cannot be cast to org.pentaho.di.core.database.DatabaseFactoryInterface
    java.lang.ClassCastException: org.pentaho.di.core.database.DatabaseFactory cannot be cast to org.pentaho.di.core.database.DatabaseFactoryInterface
    at org.pentaho.di.core.database.DatabaseMeta.getDatabaseFactory(DatabaseMeta.java:2491)
    at org.pentaho.di.core.database.DatabaseMeta.testConnection(DatabaseMeta.java:2473)
    at org.pentaho.di.ui.core.database.dialog.DatabaseDialog.test(DatabaseDialog.java:1919)
    at org.pentaho.di.ui.core.database.dialog.DatabaseDialog.test(DatabaseDialog.java:1901)
    at org.pentaho.di.ui.core.database.dialog.DatabaseDialog$4.handleEvent(DatabaseDialog.java:311)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at org.pentaho.di.ui.core.database.dialog.DatabaseDialog.open(DatabaseDialog.java:386)
    at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.newConnection(SpoonDBDelegate.java:501)
    at org.pentaho.di.ui.spoon.Spoon.newConnection(Spoon.java:6388)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.pentaho.xul.EventHandler.handleMenuEvent(EventHandler.java:42)
    at org.pentaho.xul.swt.menu.PopupMenu.handleMenuEvent(PopupMenu.java:40)
    at org.pentaho.xul.swt.menu.MenuChoice.handleMenuEvent(MenuChoice.java:77)
    at org.pentaho.xul.swt.menu.MenuChoice.handleEvent(MenuChoice.java:73)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:841)
    at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:5580)
    at org.pentaho.di.ui.spoon.Spoon.run(Spoon.java:5675)
    at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:371)

  6. #6
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    It's just the test button. It's an integration test I'm doing (with PALO).
    All should work fine. Use the explore button for the time being.

    Matt

  7. #7

    Default Connection error

    ok, it's work

    tks

  8. #8

    Default set value ?

    how can set a value ?

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.