03-14-2017 04:34 PM
Declaring variables in Script Task through execution.setVariable and using them in the User Task.
I have declared a variable in Script Task using execution.setVariable in the activiti Designer, but when i use the same variable through the ${expression} in the usertask and i click on the submit button when the process is run it says unable to evaluate expression.
This is what i have done.
Script Task:
message = "Hello"
execution.setVariable("msg", message)
User Task
Form Properities (String):
Expression:
${msg}
Format of the script is groovy.
Please Advice
03-15-2017 10:47 AM
Thankyou so much Jonathan, i will look in to the variable section. Further more i figured out another way, there is a field where you can name a variable in the form properties right under the expression field, so i gave a name over there and it worked like a charm.
03-14-2017 06:51 PM
Asheer,
I believe when you use: execution.setVariable("msg", message), that's meant to set a Process Variables. From my understanding Activiti will not define a new variable for you if it doesn't already exist in the process, for example that "msg" value in your script. You would need to have a Process Variable named msg in order to store that information there.
Below is a GUI method for declaring a process variable:
Feel free to look into the Variables section of the User Guide for more specifics on utilization and declarations.
Hope this helps,
-JEarles
03-15-2017 10:47 AM
Thankyou so much Jonathan, i will look in to the variable section. Further more i figured out another way, there is a field where you can name a variable in the form properties right under the expression field, so i gave a name over there and it worked like a charm.
03-15-2017 10:50 AM
Hi Jonathan,
I looked out for the Variable in the GUI shown above in your screenshot, but my designer doesn't show that option.
I'm currently using Activiti Explorer 5.22.
Thanks.
03-15-2017 01:07 PM
03-16-2017 12:58 PM
Thank you for help
Explore our Alfresco products with the links below. Use labels to filter content by product module.