cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning form field value to array

hheckel
Champ in-the-making
Champ in-the-making
Hello,

I initialized an array using a groovy script


def names = ["Miller", "Smith", "Jones"].toArray();
execution.setVariable("names", names);

Now, I am wondering if in Activiti Explorer I can assign/overwrite a value through assignment in a form field using the following configuration in a subsequent task:

Form property configuration:
Id: assignNewName
Name: Assign a new name
Variable: names[0]
Readable: True
Writeable: True
Required: True

Thanks for your input!
H.
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
Yes it can… Use the "expression" instead of variable field:


<activiti:formProperty id="newName" expression="${names[0]}" required="true" />

hheckel
Champ in-the-making
Champ in-the-making
Excellent! That solved the problem!
You guys are delivering outstanding work!

Thanks!
H.

imran_memon
Champ in-the-making
Champ in-the-making
how can i post form field value having expression, i am getting this error right now
{
  "message": "Internal server error",
  "exception": "Error while evaluating expression: ${IsMonitoredAlarm}"
}