cancel
Showing results for 
Search instead for 
Did you mean: 

Multi instance user task with empty collection

felipe1
Champ in-the-making
Champ in-the-making
Hi!

I have a user task with multi instance characteristics,


                <userTask
         id="my-task"
         activiti:assignee="#{assignee}"
         activiti:formKey="form.xhtml"
         name="My Task">

         <multiInstanceLoopCharacteristics
            id="MultiInstanceLoopCharacteristics_1"
            activiti:collection="#{myBean.getListOfApprovers}"
            activiti:elementVariable="assignee">
            <completionCondition
               xsi:type="tFormalExpression"
               id="FormalExpression_1">
               ${approved == false}
            </completionCondition>
         </multiInstanceLoopCharacteristics>
      </userTask>


It works great if <b>myBean.getListOfApprovers</b> returns 1 or more elements, however if the list is empty I get a "Invalid number of instances: must be positive integer value, but was 0".

I would like to skip that user task if the list returns 0, what is the best way to achieve that?

Thanks!
5 REPLIES 5

martin_grofcik
Confirmed Champ
Confirmed Champ

felipe1
Champ in-the-making
Champ in-the-making
Awesome Martin!!!

Now, can you please help me understand in which release is this change available (or will it be available)?

Cheers!

jbarrez
Star Contributor
Star Contributor
It'll be the next one - which will be 5.17 or 5.16.3 (dependening of how big changes are).
Probably this won't be released until the second week of Octorber (at minimum)

felipe1
Champ in-the-making
Champ in-the-making
Great! Thanks Joram!

jbarrez
Star Contributor
Star Contributor
Well - spoke to soon. 5.16.3 was just released Smiley Tongue

(this is a bugfix release with no db changes)