cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a Java List variable to a process

jean-sébastien
Champ in-the-making
Champ in-the-making
Hello,

I'm trying to do a very basic thing : passing a java.util.List type to an Activi process. The process invokes a Java service task. So here is what I write :

Map<String, Object> variableMap = new HashMap<String, Object>();
variableMap.put("issuerIdList", new ArrayList<String>());
variableMap.put("dateFormat", new java.text.SimpleDateFormat());
      
// Start a process instance
String procId = runtimeService.startProcessInstanceByKey("ArchiveAndPurge", variableMap).getId();

I then get the following exception :

Incompatible type set on field declaration 'issuerIdList' for class net.atos.wlp.cardholderaccount.batches.archiveandpurge.InitializeBatch. Declared value has type org.activiti.engine.impl.el.JuelExpression, while expecting java.util.List

Anything wrong here I guess. What can I do ?

Many thanks.
3 REPLIES 3

trademak
Star Contributor
Star Contributor
Hi,

Can you also include the InitializeBatch class and the full process definition?

Best regards,

jean-sébastien
Champ in-the-making
Champ in-the-making
Sorry wait

jean-sébastien
Champ in-the-making
Champ in-the-making
Sorry here is the answer to my problem :

In the Java code I forgot to set all attributes to the following type :

org.activiti.engine.impl.el.Expression
Previously I set Java types and this does not work.

Thanks.