Multi-Instantiation

I want to implement the following scenario and would like to know if this is supported by Bonita: A project idea is submitted. The project management office receives the idea. Based on the idea PMO needs to ensure that all relevant department coordinators review and approve the idea. The PMO needs to be able to select from the organization hierarchy a department and send them the idea for review. PMO does that for all relevant departments. The number of departments that need to review is therefore dynamic. When a department is selected, the review task is send to the coordinator of that department for review. A coordinator of a department can only review tasks assigned to him and not to coordinators of other departments. The review is comprised of two fields that they submit: interested/not interested dropdown and a comment text field. All responses from the coordinators need to be send back to the PMO for final review.

How would a process like this be implemented in bonita?

See above

I downloaded the example found here: https://github.com/Bonitasoft-Community/Multi-Instantiated-Task-Example

There is a variable called votersList which is used to instantiate the task. Does anyone know where the votersList variable in the process is populated?

As it’s an example it is probably populated either as part of the variable definition (i.e. hardcoded) or in a preceding step to where it is being used. It is there but I can’t remember where, though I do remember seeing it.

What you want to do is very possible and this thread might help…or at least point you in the right direction. Hint: you might want to use a checkbox list to select all recipients rather than a DDL, this way you will be able to select all recipient departments in one go and the instantiation will be easy…

regards

http://community.bonitasoft.com/answers/parallel-multi-instantion-i-cant-put-different-actors-each-instance

Ok. I found it. The drop down field that the user selects with the list of all groups in the organization cmbGroup is used to populate votersList with the users:

import org.bonitasoft.engine.identity.Group;
import org.bonitasoft.engine.identity.User;
import org.bonitasoft.engine.identity.UserCriterion;

List usersInGroup=apiAccessor.getIdentityAPI().getUsersInGroup(Long.parseLong(field_cmbGroup), 0, 200, UserCriterion.FIRST_NAME_ASC);
List idVoters=new ArrayList();
for (User user:usersInGroup){
idVoters.add(user.getId());
}
return idVoters;