Groovy Scripting

User 9aa4619393

16-03-2012 11:56:27


I am trying to learn how to use Groovy scripting.

I have found examples of scriplets on your site and I am having troubles running them...this one for example:

I created a new script in my schema, copy-pasted the code and it gives me this error:

groovy.lang.MissingPropertyException: No such property: dataTree for class: script1331898630366715701113
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(
    at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(
    at org.openide.util.RequestProcessor$
    at org.openide.util.RequestProcessor$

Same thing for the script to create a new entity.  Are these supposed to work as they are or do I need to adjust them?

Also, if I have two data trees (I have tried with either one or two) how do I specify which datatree and which entity?



ChemAxon 37bb34e128

16-03-2012 13:55:09

Hi Anna,

just briefly - you can create a script either for a schema or for a datatree. The examples you picked are the datatree scripts. You should copy-paste them into a script that resides under a datatree. Please read more in which describes what variables are injected into a script depending on where it resides.