Criwran
Criwran

Reputation: 431

can i set a Activiti user task to multiple candidate groups?

Normally I set the Activiti user task to a assignee, candidate users or a candidate group. I'm wondering if I can set multiple candidate groups not just a candidate group like :

group1, group2

Upvotes: 1

Views: 242

Answers (1)

3omar
3omar

Reputation: 170

You can use DelegateTask to add multiple groups as candidate group, with method: addCandidateGroups

example:

    @Component("CustomTaskListener")
    public class CustomTaskListener implements TaskListener {
    
        @Override
        public void notify(DelegateTask task) {
            
            List<String> groups = new ArrayList<>();
            groups.add("group1");
            groups.add("group2");
            
            task.addCandidateGroups(groups);
        }
    }

Upvotes: 1

Related Questions