Hi.
I’m running Bonita Studio 6.3.2 Performance
I’ve put some transient vars in my start pageflow (ie. not of a human task).
I update them using a Groovy script called when a field gets updated (ie. contingency)
import org.slf4j.Logger import org.slf4j.LoggerFactory Logger logger = LoggerFactory.getLogger("org.bonitasoft") // here I'm updating transient variables the_double = field_input_number * 2 the_square = field_input_number * field_input_number// then I log new values
logger.info(“Double after update = ${the_double}”) // in log I see that transient value is as expected
logger.info(“Square after update = ${the_square}”) // in log I see that transient value is as expected
return the_double
As form submit actions, I update two process variables: triple gets the output of a script that uses the_double value, and square gets the value of the_square transient var.
import org.slf4j.Logger import org.slf4j.LoggerFactory Logger logger = LoggerFactory.getLogger("org.bonitasoft") logger.info("Double when submitting form = ${the_double}") return the_double + field_input_numberWhen the last script is executed in log I see the_double is null and an exception is thrown because null cannot be added.
The other process var, square, is 0, i.e. square got the default value of the_square and not that updated by the script.
Is this the expected logic of transient variables? Do they live only inside scripts using them and then get reset when scripts terminates?
Thanks in advance,
Michael