cancel
Showing results for 
Search instead for 
Did you mean: 

Groovy script task to store boolean data.

swamy2156
Champ on-the-rise
Champ on-the-rise
I am facing a typical problem with Groovy Script task. While trying to store boolean value with following code,
<scriptTask id="scripttask1" name="SCRIPT Task" scriptFormat="groovy" activiti:autoStoreVariables="false">
      <script>execution.setVariable("abc", Boolean.TRUE);
execution.setVariable("bbc", false);
</script>

in variable table its storing as follows. Type storing properly but, text_ not storing.
mysql> select name_, text_, type_ from act_ru_variable where proc_inst_id_ = '297505';
+——-+——-+———+
| name_ | text_ | type_                  |
+——-+——-+———+
| abc   | NULL  | boolean                |
| bbc   | NULL  | boolean                |
+——-+——-+———+
2 rows in set (0.00 sec)

How to persist boolean variables in execution using groovy script?
I am using Activiti 5.17 and mySQL database.      Any help will be appreciated.

Thanks,
Swamy.
2 REPLIES 2

jbarrez
Star Contributor
Star Contributor
I will respond here the same as I did on my blog: boolean values are stored in the long_ column, not the text_ column.

swamy2156
Champ on-the-rise
Champ on-the-rise
Got it.. Thank you J. Sorry for the dumb question (After knowing the answer, I feel like I am dumb Smiley Happy ).