Hi everyone.
In tasklist, I want to show details about snapshot of process start (using my ‘start-form.html’).
At ‘start-form.html’, It has a <select>
option variable, and it has value of A,B,C. (default show value is ‘A’)
After process starting, other variables show own correct value. But only <select>
option variable always shows ‘A’. (If I set default value=‘null’, It shows correct value.)
Look at this following code. (camunda-form.js / CamundaForm.prototype.mergeVariables)
for (var v in variables) { if (vars[v]) { for (var p in variables[v]) { vars[v][p] = vars[v][p] || variables[v][p]; } } else { vars[v] = variables[v]; } ... }
‘vars’ means script value and ‘variables’ means values from DB.
Because of following line, variable always shows ‘A’.
vars[v][p] = vars[v][p] || variables[v][p];
But I think
vars[v] = variables[v];
this line is enough to merge variables.
Or, this following line is more suitable. isn’t it?
vars[v][p] = variables[v][p] || vars[v][p];
how do you think?
thank you.