I have a Java object added as variable:
private Collection<BatchPayment> batchPayments = new ArrayList<BatchPayment>();
public Collection<BatchPayment> getBatchPayments() {
return batchPayments;
}
public void setBatchPayments(Collection<BatchPayment> batchPayments) {
this.batchPayments = batchPayments;
}
I’m trying to generate a MultiInstance task with the following configuration on the collection:
state.batchPayments
I’m getting this error:
13-Oct-2016 12:52:58.368 SEVERE [http-nio-8080-exec-13] org.camunda.commons.logging.BaseLogger.logError ENGINE-16004 Exception while closing command context: ENGINE-02025 Variable ‘state.batchPayments’ is not from type ‘Collection’.
org.camunda.bpm.engine.ProcessEngineException: ENGINE-02025 Variable ‘state.batchPayments’ is not from type ‘Collection’.
at org.camunda.bpm.engine.impl.bpmn.behavior.BpmnBehaviorLogger.invalidVariableTypeException(BpmnBehaviorLogger.java:155)
If I create the collection in a direct variable, it does work:
ArrayList<BatchPayment> lst = new ArrayList<BatchPayment>();
lst.add(new BatchPayment());
execution.setVariable("lst", lst);
Any ideas?