cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti Task Script - Trying to execute a SQL query (Javascript)?

chrisx_212
Champ in-the-making
Champ in-the-making
Hello. I'd like to ask about how to execute a query which will be used in the Task Script. The format shall be Javascript.

Because when I do it in my computer, it never works, it gives out a Reference Error that the command is not recognized. This is what I used for the import commands:



importPackage(java.sql);
importPackage(java.lang);
importPackage(org.activiti.explorer.reporting);



They give out this message usually: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "java" is not defined.

So how do I do it? Thanks.
4 REPLIES 4

chrisx_212
Champ in-the-making
Champ in-the-making
Also this is a double post because I cannot edit the first post of the topic.

When it's executed the first time, it will give out an ProcessDefinitionDetailPanel error, and the next time I try that, it's the above Ecma Error.

The weird thing is that this doesn't happen if I change computer. Only in this laptop that it gives out that error. What went wrong?

Thanks.

jbarrez
Star Contributor
Star Contributor
Are you using the same version of Java between those computers? javascript implementations vary between JDK versions.

Also, would be good if you can show the whole script.

chrisx_212
Champ in-the-making
Champ in-the-making
Where shall I find the differences? Is it the Environment Variables or the Java installed? Both using JRE7 and JDK1.7.

jbarrez
Star Contributor
Star Contributor
No, typically there's nothing in release notes or whatever. Now, if you stick to JDK 7 than the differences shouldn't be that great (i think i only saw one breaking version wrt scripting).