PDA

View Full Version : What am I going wrong here?



kettle_anonymous
04-21-2006, 08:12 AM
I originally posted this question:

http://forums.pentaho.org/showthread.php?t=48440

I tried to take the advice but I guess I am not understanding the answer. BTW, is there some documentation that can provide some real world examples on how to use the tools?

The script blow produces this error:

2006/04/21 10:56:40 - be.ibridge.kettle.trans.Trans - Transformation is in preview mode...
2006/04/21 10:56:40 - be.ibridge.kettle.trans.Trans - Dispatching started for filename [C:\ItemspecLoad.ktr]
2006/04/21 10:56:40 - be.ibridge.kettle.trans.Trans - Nr of arguments detected:10
2006/04/21 10:56:40 - be.ibridge.kettle.trans.Trans - This is not a replay transformation
2006/04/21 10:56:40 - be.ibridge.kettle.trans.Trans - This transformation can be replayed with replay date: 2006/04/21 10:56:40
2006/04/21 10:58:47 - Table output.0 - Connected to database [GOMDWMXD] (commit=0)
2006/04/21 10:58:47 - Itemspec Input File.0 - Starting to run...
2006/04/21 10:58:47 - Select values.0 - Starting to run...
2006/04/21 10:58:47 - Java Script Value.0 - Starting to run...
2006/04/21 10:58:47 - Table output.0 - Starting to run...
2006/04/21 10:58:51 - Java Script Value.0 - ERROR : Javascript error: org.mozilla.javascript.WrappedException: WrappedException of null
2006/04/21 10:58:51 - Java Script Value.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1
2006/04/21 10:58:51 - be.ibridge.kettle.trans.Trans - ERROR : Errors detected!
2006/04/21 10:58:51 - be.ibridge.kettle.trans.Trans - Looking at step: Itemspec Input File
2006/04/21 10:58:52 - Table output.0 - Finished processing (I=0, O=0, R=0, W=0, U=0, E=0
2006/04/21 10:58:52 - Itemspec Input File.0 - Finished processing (I=0, O=0, R=0, W=702, U=0, E=0
2006/04/21 10:58:52 - be.ibridge.kettle.trans.Trans - Looking at step: Select values
2006/04/21 10:58:52 - Select values.0 - Finished processing (I=0, O=0, R=352, W=351, U=0, E=0
2006/04/21 10:58:52 - be.ibridge.kettle.trans.Trans - Looking at step: Java Script Value
2006/04/21 10:58:52 - be.ibridge.kettle.trans.Trans - Looking at step: Table output
2006/04/21 10:58:52 - Spoon - Step: Itemspec Input File --> 10 rows
2006/04/21 10:58:52 - Spoon - Step: Select values --> 10 rows
2006/04/21 10:58:52 - Spoon - Step: Java Script Value --> 0 rows
2006/04/21 10:58:52 - Spoon - Step: Table output --> 0 rows
2006/04/21 11:01:38 - Spoon - The transformation has finished!!


*******Seperator not included in script********************
if ( ITEMNUM.length() > ITEMNUM.getLength() )
{
ITEMNUM.substr(0,ITEMNUM.getLength() );
}

if ( CLASSSTRUCTUREID.length() > CLASSSTRUCTUREID.getLength())
{
CLASSSTRUCTUREID.substr(0, CLASSSTRUCTUREID.getLength() );
}

if ( ATTRIBUTE1.length() > ATTRIBUTE1.getLength() )
{
ATTRIBUTE1.substr(0, ATTRIBUTE1.getLength() );
}

if ( ATTRIBUTE2.length() > ATTRIBUTE2.getLength() )
{
ATTRIBUTE2.substr(0, ATTRIBUTE2.getLength() );
}

if ( ATTRIBUTE3.length() > ATTRIBUTE3.getLength() )
{
ATTRIBUTE3.substr(0, ATTRIBUTE3.getLength() );
}

if ( ATTRIBUTE4.length() > ATTRIBUTE4.getLength() )
{
ATTRIBUTE4.substr(0, ATTRIBUTE4.getLength() );
}

if ( ATTRIBUTE5.length() > ATTRIBUTE5.getLength() )
{
ATTRIBUTE5.substr(0, ATTRIBUTE5.getLength() );
}

if ( ATTRIBUTE6.length() > ATTRIBUTE6.getLength() )
{
ATTRIBUTE6.substr(0, ATTRIBUTE6.getLength() );
}

if ( ATTRIBUTE7.length() > ATTRIBUTE7.getLength() )
{
ATTRIBUTE7.substr(0, ATTRIBUTE7.getLength() );
}

if ( ATTRIBUTE8.length() > ATTRIBUTE8.getLength() )
{
ATTRIBUTE8.substr(0, ATTRIBUTE8.getLength() );
}

if ( ATTRIBUTE9.length() > ATTRIBUTE9.getLength() )
{
ATTRIBUTE9.substr(0, ATTRIBUTE9.getLength() );
}

if ( ATTRIBUTE10.length() > ATTRIBUTE10.getLength() )
{
ATTRIBUTE10.substr(0, ATTRIBUTE10.getLength() );
}

if ( ATTRIBUTE11.length() > ATTRIBUTE11.getLength() )
{
ATTRIBUTE11.substr(0, ATTRIBUTE11.getLength() );
}

if ( ATTRIBUTE12.length() > ATTRIBUTE12.getLength() )
{
ATTRIBUTE12.substr(0, ATTRIBUTE12.getLength() );
}

if ( ATTRIBUTE13.length() > ATTRIBUTE13.getLength() )
{
ATTRIBUTE13.substr(0, ATTRIBUTE13.getLength() );
}

if ( ATTRIBUTE14.length() > ATTRIBUTE14.getLength() )
{
ATTRIBUTE14.substr(0, ATTRIBUTE14.getLength() );
}

if ( ATTRIBUTE15.length() > ATTRIBUTE15.getLength() )
{
ATTRIBUTE15.substr(0, ATTRIBUTE15.getLength() );
}

if ( ATTRIBUTE16.length() > ATTRIBUTE16.getLength() )
{
ATTRIBUTE16.substr(0, ATTRIBUTE16.getLength() );
}

if ( ATTRIBUTE17.length() > ATTRIBUTE17.getLength() )
{
ATTRIBUTE17.substr(0, ATTRIBUTE17.getLength() );
}

if ( ATTRIBUTE18.length() > ATTRIBUTE18.getLength() )
{
ATTRIBUTE18.substr(0, ATTRIBUTE18.getLength() );
}

if ( ATTRIBUTE19.length() > ATTRIBUTE19.getLength() )
{
ATTRIBUTE19.substr(0, ATTRIBUTE19.getLength() );
}

if ( ATTRIBUTE20.length() > ATTRIBUTE20.getLength() )
{
ATTRIBUTE20.substr(0, ATTRIBUTE20.getLength() );
}
*******Seperator not included in script********************

MattCasters
04-21-2006, 08:32 AM
Dear Mr/Mrs Anonymous,


We're getting close to 1000 messages on this Forum, I'm posting weekly tips, there IS documentation, there are plenty of examples so your remarks are not taken very well on this end of the line. Maybe I'm tired, it's Friday.



I'm not going to solve any and every simple javascript problem that you might have. If that is what you were expecting, then perhaps you can opt for a professional support contract. There is information on this on the Pentaho homepage (http://www.pentaho.org).



Please note, that although this remark might seem over the top, I did give you an alternative solution that you chose to ignore.



Thanks for your understanding,



Matt

jbleuel
04-21-2006, 08:47 AM
A similar case (searched for 'substr') that was working:

http://forums.pentaho.org/showthread.php?t=48330