Skip to Main Content

SQL Developer Data Modeler

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Question about scripting in Data Modeler using Groovy instead of Rhino

bpederso-OracleMar 12 2011 — edited Mar 14 2011
Hi,

Sometime back I asked a question about using Groovy as an alternative to Javascript Rhino (or JRuby) for scripting in Data Modeler.

There was a helpful response at the time which I've copied here:

quote

For scripting engines - you can start here - https://scripting.dev.java.net/
I see groovy is supported - http://groovy.codehaus.org/JSR+223+Scripting+with+Groovy
How to install it - you can follow instruction in first link above, it's much simpler just to copy related jar in "ext" directory - for groovy I copied "groovy-1.7.5.jar" (I downloaded 1.7.5 version)
into directory "D:\jdk1.6.0_20\jre\lib\ext" on my computer. You need restart of Data Modeler - I got groovy scripting engine as choice in engines combo box.

You need to test how Groovy will return true/false to Data Modeler - in plain rule (no library) it's little bit odd as you see in example. If library is used then standard return is used.

unquote

At the time I did not follow up on this other than to load the jar into the ext directory and confirm that Groovy was available as a choice in the Data Modeler engine combo box.
So I thought everything was fine.

However some time later I went back and actually tried to write a little script in Groovy as an alternative to Javascript Rhino.
It didn't work for me. Any script I wrote did not execute - there was no response from DM when I hit the Apply button.
There are no errors or exceptions - nothing happens.

Has anyone been able to get a Groovy script working at all? Any simple test would suffice.

This is not a big deal or show stopper for me since I'm using Javascript Rhino well enough. But it seems like Groovy might be
a good alternative. There are some things that are tricky about using Javascript as the scripting engine. For instance
you can get some 'interesting' effects while writing DM scripts when you have a mixture of Javascript String objects and Java
String objects interacting within the body of the script. It would be nice to avoid that strangeness if possible and that might
be possible with Groovy since it seems to be a closer relative of Java than Javascript is.

Rgds, BP
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 11 2011
Added on Mar 12 2011
2 comments
430 views