[Bug ?] Iterate on empty list : IndexOutOfBoundsException : "Index: 0, Size: 0"



I have a process where I multi-instanciate a task for each value of a list. Yesterday I note that when the list is empty, the process crash with this error :

  1. 2015-01-23 10:36:13 org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork
  2. AVERTISSEMENT: THREAD_ID=67 | HOSTNAME=W28323 | TENANT_ID=1 | The work [ExecuteFlowNodeWork: processInstanceId:1, flowNodeInstanceId: 3] failed. The failure will be handled.
  3. 2015-01-23 10:36:13 org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork
  4. AVERTISSEMENT: THREAD_ID=67 | HOSTNAME=W28323 | TENANT_ID=1 | java.lang.IndexOutOfBoundsException : "Index: 0, Size: 0"

I expected that if the list on which I iterate is empty, the task is skipped.

Is it normal to have this error ?

I use Bonita 6.3.7 with java 1.7.

PS : This bug appears only if I check the "Sequential" box in the Iterate tab.

1 answer

This one is the BEST answer!

Hi Yannick,

I reproduce your issue and report it on the bug tracker: https://bonita.atlassian.net/browse/BBPMC-242

A possible workaround is to use exclusive gateway to avoid step execution if list is empty.


Submitted by yannick.lombardi on Tue, 01/27/2015 - 14:16

Hi. This is exactly what I'm doing to avoid the problem. If the list is empty, I skip the task with a gateway.