cancel
Showing results for 
Search instead for 
Did you mean: 

Multi instance

yz250
Champ in-the-making
Champ in-the-making
Hi, I am new to Activiti and I have just start learning how to design workflows.
I have a question, in a workflow there is an user task where there is a candidate group ("admin"), the problem is that I want assigne the task to all users in this group, I don' t want just candidate the whole group, how can I do it? Should I use the multi instance option? If yes how can I use it?
I' ve tryed to create a collection of usernames but it doesn' t work.

Thanks all, Ivan.
13 REPLIES 13

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
afaik, you cannot 'auto-expand' a group and use that as a list of all assignees. You have to 'expand' the group in your own code and pass that as a list. Can probably be done in an expression kind of way, something like '${myUserManagement.expandMyGroup(groupname)}"

yz250
Champ in-the-making
Champ in-the-making
Thanks for the reply but I don' t understand what you mean, what "myUserManagement" and "expandMyGroup" stands for? Are they a java class and a method?
Anyway how can I call a java class and a method inside the workflow?

Ivan.

nitroin
Champ in-the-making
Champ in-the-making
Hi, I'm having the same kind of problem here too.

In fact in my case the Activiti engine is not embedded in any kind of internal java test application, I'm using it as it come out-of-the-box.
For using the multi-instance I have to define a collection containing all the candidate/assignee users. Where can I define it?

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
@nitroin: in a process variable

@yz250: see the usage of EL expresions in te docs and in general

nitroin
Champ in-the-making
Champ in-the-making
Thanks ronald but I was already assuming that I process variable must be defined, but…where? In what java/package?

This is my workspace, for reference:

[img]http://img7.imagebanana.com/img/ujfyllf1/workspace.JPG[/img]

yz250
Champ in-the-making
Champ in-the-making
I' ve tryed to create a multi instance user task but when i start it it generate an exception "Variable nameList is not a collection".
How can i fix it? What is wrong in my process?
I' ve created a java class then I' ve set up a listener on the user task that point the class on create event, in the class I' ve wrote in the main function:
List<String> nameList = new ArrayList<String>();
nameList.add("user1");
nameList.add("user2");

Ivan

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
What if you do

ArrayList<String> nameList = new ArrayList<String>();

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
@Nitroin: Just read about provessvariables in the docs… They do not need to be anywhere if they are simple java types

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
I' ve created a java class then I' ve set up a listener on the user task that point the class on create event,

Is the class actually called?