Skip to content

Executing .groovy files issue

mattyb149 edited this page Nov 5, 2012 · 2 revisions

Hi Matt while trying to execute DataGridTutorial.groovy Got the following error

groovy> import org.eclipse.swt.* groovy> import org.pentaho.di.ui.core.dialog.* groovy> def setFields = {dgm -> groovy> fieldName = ['field1'] as String[] groovy> type = ['String'] as String[] groovy> fieldFormat = [''] as String[] groovy> group = [''] as String[] groovy> decimal = [''] as String[] groovy> currency = [''] as String[] groovy> length = [-1] as int[] groovy> precision = [-1] as int[] groovy> dgm.setFieldName(fieldName); groovy> dgm.setFieldType(type); groovy> dgm.setFieldFormat(fieldFormat); groovy> dgm.setGroup(group); groovy> dgm.setDecimal(decimal); groovy> dgm.setCurrency(currency); groovy> dgm.setFieldLength(length); groovy> dgm.setFieldPrecision(precision); groovy> } groovy> def WAIT_TIME = 2500 // Interval between tutorial events groovy> sync{ thisConsole.frame.state = javax.swing.JFrame.ICONIFIED } // minimize this console groovy> // Create new transformation
groovy> def tm = new TransMeta() groovy> tm.setName('DataGrid Tutorial') groovy> tm.setFilename('') groovy> sync { spoon.addTransGraph(tm) } groovy> // Add Data Grid step groovy> WAIT_TIME.waitThenRun { groovy> plugins.'Data Grid'.addNew() groovy> spoon.refreshTree() groovy> activeTransGraph().redraw(); groovy> } groovy> WAIT_TIME.waitThenRun { groovy> def smi = step('Data Grid').stepMetaInterface groovy> def dlg = spoon.getStepEntryDialog(smi, activeTrans(), 'Data Grid') groovy> async {dlg.open()} groovy> WAIT_TIME.waitThenRun { groovy> def smd = new ShowMessageDialog(spoon.shell, SWT.CANCEL | SWT.ICON_WARNING,'Enter data', 'Enter field data') groovy> async{smd.open()} groovy> WAIT_TIME.waitThenRun { groovy> setFields(smi) groovy> makePublic(smd,'cancel') groovy> smd.cancel() groovy> dlg.getData() groovy> WAIT_TIME.waitThenRun { groovy> makePublic(dlg,'cancel') groovy> dlg.cancel() groovy> } groovy> } groovy> } groovy> }

1 compilation error:

**unable to resolve class TransMeta ** at line: 28, column: 10


NOTE (from matt):

This is a by-product of what happened when I tried to remove the ImportCustomizer in order to support 4.3.0 with the older groovy-1.5.6 JAR. This should be fixed when I back out the changes, as this plugin is only meant to support 4.4.0 and on.

Having said that, you may get resolve errors when writing your own scripts, the staging code imports common packages, but if you use a class that is not in the list, you will get a resolve error. If this happens you should add an import statement to your script for the desired class.

Clone this wiki locally