problem evaluating script

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2012 10:07 AM
Hello everybody,
this is my second post here. :mrgreen:
I am pretty newbe in Activiti then I encountered soon some problems that I am not able to solve.
I hope you could help me.
I created an example process named Loan Process. In this, I have a script task with the following code
running this process I receive the following exception
In my understanding, groovy script should create automatically process variables if def keyword is not used, then also creditCheckOk .
I am quite confused, maybe you could help me.
you can download the project from here
https://www.dropbox.com/s/6q6hifz3rio0mms/LoanRequestFail.zip. The test to be runned is LoanRequestTest.
Thank you very much for your help. :ugeek:
this is my second post here. :mrgreen:
I am pretty newbe in Activiti then I encountered soon some problems that I am not able to solve.
I hope you could help me.
I created an example process named Loan Process. In this, I have a script task with the following code
creditCheckOk = false;if((income / 2) > loanAmount) { out:println "credit check is ok"; creditCheckOk = true;}else{ out:println "credit check is not ok";}out:println "Checked credit for " + name + " outcome is " + creditCheckOK;
running this process I receive the following exception
org.activiti.engine.ActivitiException: problem evaluating script: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: creditCheckOK for class: Script1…very long stacktrace…Caused by: javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: creditCheckOK for class: Script1 at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:117) at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:216) at org.activiti.engine.impl.scripting.ScriptingEngines.evaluate(ScriptingEngines.java:75) … 86 moreCaused by: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: creditCheckOK for class: Script1 at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:318) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:111) … 88 moreCaused by: groovy.lang.MissingPropertyException: No such property: creditCheckOK for class: Script1 at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:49) at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:239) at Script1.run(Script1.groovy:13) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:315) … 89 more
In my understanding, groovy script should create automatically process variables if def keyword is not used, then also creditCheckOk .
I am quite confused, maybe you could help me.
you can download the project from here
https://www.dropbox.com/s/6q6hifz3rio0mms/LoanRequestFail.zip. The test to be runned is LoanRequestTest.
Thank you very much for your help. :ugeek:
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2012 10:34 AM
You have a type on this line, "OK" instead of "Ok" you're using to set the value:
out
rintln "Checked credit for " + name + " outcome is " + creditCheckOK;

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2012 09:02 AM
Ouch!
sorry!
ops:
Thank you very much
ps. Is it planned to have script editors embedding in activiti plugin? It could help to check consistency of coding. Again, the variable created like this or by java code are not checked then you have data structure spread between bpmn, java code, scripting etc.. have some support by designer plugin to discover at compile time and not at runtime these issues, I think it would be a great help. Something to cover this need is planned or even only considered?
sorry!

Thank you very much
ps. Is it planned to have script editors embedding in activiti plugin? It could help to check consistency of coding. Again, the variable created like this or by java code are not checked then you have data structure spread between bpmn, java code, scripting etc.. have some support by designer plugin to discover at compile time and not at runtime these issues, I think it would be a great help. Something to cover this need is planned or even only considered?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2012 05:47 PM
No, nothing planned in that area. Also because script type is pluggable, and any scripting engine could be used. Furthermore it would require a massive amount of work … unless there exist packages that already can do it?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2012 04:43 AM
unless there exist packages that already can do it?Really I don't know. I know for example that there are a plugin for eclipse to do Groovy project, maybe we could integrate this with designer. Same think for other scripting. Anyway, If I may put my two cents in. it is true that it is a huge amount of work, but I am wondering if the functionality worth taking the effort required. Viceversa if there isn't this functionalities scripting tasks lost a bit of his potentialities.
Kind regards and thank you again :ugeek:
