Assign to group of users

Hi. New to Flowable. I’m trying to do a simple example using the Flowable all-in-one docker image that assigns a task to every user in a candidate group.
So I have a start process, a user task and an end. The user task is assigned to a candidate group with two people in it. I’m expecting that when I reach the task the system should produce two tasks one for each user in the group.
Two questions:-

  1. I can see that there is a ‘multi-instance type’ but when I set this I get an error ‘Either loopcardinality or loopDataInputRef/flowable: collection must been set’. This sort of makes sense - I presume I need to tell it that it needs to loop over the assigned users.
  2. Is it possible to assign tasks to groups so a tasks shows up in both users task list (I’m currently doing this with candidate groups which works ok, but isn’t exactly what I want).
    Thanks for reading.
    Stu

Stu,

Welcome to to your Flowable journey!

The purpose of the candidate group is to indicate a group of people that can claim and complete a task. Because of this only one task gets created. If you want multiple instances of the task, you’ll need to set it as multi-instance and give it a collection to execute over. I’m not sure we have an easy way to do what you want, you may have to pull the list of users from the group behind the scenes and put it into a collection to iterate over. Someone with a little more experience than I have might be able to speak to that.

Will

Thanks Will, I really appreciate you taking the time to respond :slight_smile:
Do you know if it is possible to using the Flowable Modeler to set what it should iterate over?
I presume from what you’ve said I need to put something in the "“Collection (Multi-instance)” field on the user task. Is there an in-built variable for the assigned users perhaps?
Many thanks,
Stu

No, there isn’t. Either you store them in a variable and use that as the collection of the multi-instance or you use a bean and get them at runtime, something like ${myService.getUsers()}

Thanks Joram…I’ll give that a go!