AnsweredAssumed Answered

script task/javascript, How to add elements to ArrayList?

Question asked by jinwang2000 on Mar 5, 2015
Latest reply on Mar 5, 2015 by yvoswillens
I'm trying to use ArrayList in a script task:
<scriptTask id="scripttask1" name="script task" scriptFormat="javascript" activiti:autoStoreVariables="false">
      myList =
      myList.add("test value 1");
      execution.setVariable("myList", myList);
Keeps getting error while running the flow:
[error] application - problem evaluating script: Java class "java.util.ArrayList" has no public instance field or method named "add". (<Unknown source>#2) in <Unknown source> at line number 2
[error] application - org.activiti.engine.impl.scripting.ScriptingEngines.evaluate(

Can anyone help with this, please?