AnsweredAssumed Answered

Set form variable scope as local

Question asked by adityap174 on Jul 25, 2014
Latest reply on Jul 17, 2015 by anjan
My use case as following :
An array of objects enters the process. The process then goes through a loop task, with loopCardinality as the size of the array. Each execution instance of the loop is then assigned an object as a local variable. Now, each of these instances then go through an user task, which gets completed using form submission. What I want is the value received from the form to be set as a local variable. In the DefaultFormHandler of the activiti code base, I found out that the form submission code has the line

execution.setVariable(propertyId, propertiesCopy.get(propertyId))

which sets the incoming form variable as a global variable. The problem with that is that the new form submission overwrites the value of the form variables of the previous execution instance.  What I want is to store the form variables received in each loop as a local variable of that loop instance, without adding another script task to achieve this. I couldn't find any option to change the default behavior. Is there something I can do to achieve this ?

Outcomes