Alfresco Process Services Dynamic Multi Instance Task

cancel
Showing results for 
Search instead for 
Did you mean: 
signjoy
Active Member II

Alfresco Process Services Dynamic Multi Instance Task

Jump to solution

Hi,

We have task form where user will see a drop down called lead groups. This drop down will show all the lead groups (lead admin, lead office, lead employee, etc).

Below that we have 10 check boxes that are also a individual groups. User can choose 1 lead group from the dropdown and choose as many as the other groups by ticking the check boxes below.  

My question is, how can I create a process model that can assign the tasks dynamically to the groups selected by the user via checkboxes. Because one time he/she can choose only 3 groups and next time he/she can choose 7 groups.

All these groups will be displayed the same task form (for now). Only the drop down group will be displayed different form.

Any help will be appreciated 

1 Solution

Accepted Solutions
abbask01
Senior Member

Re: Alfresco Process Services Dynamic Multi Instance Task

Jump to solution

If number of groups will always remain static then: you can fork the process with an inclusive gateway, for each group selected the  respective task will be executed.

Iff the number of groups may vary in future:

The Multi-instance for a task also works with list as an argument.

After your group selection task, create a list of selected participant groups, pass this list (e.g. group_participants) to the Collection (Multi-instance) property of the userTask. add an element variable of desired name (e.g. participant). In the Task Assignment select Candidate groups and add the element variable as an expression ${participant}

Note: The list of Participants must be list of string containing group ids (as selected by the user).

Regards,
Abbas

View solution in original post

7 Replies
abbask01
Senior Member

Re: Alfresco Process Services Dynamic Multi Instance Task

Jump to solution

If number of groups will always remain static then: you can fork the process with an inclusive gateway, for each group selected the  respective task will be executed.

Iff the number of groups may vary in future:

The Multi-instance for a task also works with list as an argument.

After your group selection task, create a list of selected participant groups, pass this list (e.g. group_participants) to the Collection (Multi-instance) property of the userTask. add an element variable of desired name (e.g. participant). In the Task Assignment select Candidate groups and add the element variable as an expression ${participant}

Note: The list of Participants must be list of string containing group ids (as selected by the user).

Regards,
Abbas
signjoy
Active Member II

Re: Alfresco Process Services Dynamic Multi Instance Task

Jump to solution

Thanks Abbas Kararawala‌ for your reply. You mean to say I need to write a java TaskListner where I will create the list of use Ids and set them in the next multi user tasks?

abbask01
Senior Member

Re: Alfresco Process Services Dynamic Multi Instance Task

Jump to solution

Yes, a java-based taskListener will do the work. You'll have to add this on completion of the userTask where the groups are being selected.

Regards,
Abbas
signjoy
Active Member II

Re: Alfresco Process Services Dynamic Multi Instance Task

Jump to solution

How can I get the group IDs from the group names? As I have check boxes with group name, in Task listener I will get their names and then need to find the group Id from the name. Do you have any idea. Thank you

abbask01
Senior Member

Re: Alfresco Process Services Dynamic Multi Instance Task

Jump to solution

You can query the groups based on group name.

If you've created a custom field for fetching groups, why not bring the group ids as well.

Regards,
Abbas
signjoy
Active Member II

Re: Alfresco Process Services Dynamic Multi Instance Task

Jump to solution

Hey Abbas Kararawala‌ can you put the simple example for getting group ids from group name. I am trying it but without success...

jose_leon_coupa
Active Member II

Re: Alfresco Process Services Dynamic Multi Instance Task

Jump to solution

Hi,

Have you got any solution to this? I'm facing the same problem, i.e. How to get the groupId from the group names. Thank you.