Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
iDempiere JIRA
Scripts in AD_Rule are allowed to have 4000 chars but only upto 2000 it works
Description
When creating a rule script the script field allows upto 4000 characters but if there are more than 2000 characters an exception like "javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: no for class: Script80" is generated. This doesn't give a hint to the solution so this should be changed either limiting the field to 2000 characters or better to allow the full 4000 characters to be used for scripts.
Environment
None
Activity
Martin Schönbeck
March 14, 2021 at 11:19 AM
Seems to be a problem with a explicitly as int declared variable. It was declared inside an if block and obviously not visible outside this block. The next if statement tried to use the variable but obviously created it as script global this way. So after the first if block the log failed, after the second it worked.
Martin Schönbeck
March 14, 2021 at 11:09 AM
It' been a problem between keyboard and chair. I shortened a script to test it and it worked soon after it got below 2000. But that was not the reason. Something in a log statement (which I deleted) creates the problem, not the size. I have no idea what the reason is, but size is not.
Carlos Ruiz
March 14, 2021 at 11:03 AM
Hi @Martin Schönbeck - must be a problem specific from groovy?
I did the test with beanshell and it worked fine with a script of 3885 chars.
When creating a rule script the script field allows upto 4000 characters but if there are more than 2000 characters an exception like "javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: no for class: Script80" is generated. This doesn't give a hint to the solution so this should be changed either limiting the field to 2000 characters or better to allow the full 4000 characters to be used for scripts.