Multi-Instantiated 6.x

1
+1
-1

I'm tring to understand how can distribute one task per user in BOS 6.x.

at sometime in my process i have to get the aproval from some actores id difined in a List(java.util.List) listOfUsers(global variable)

so i create a step multi-instance:

1º-General->Iterration-> i select "is Multi-Instantiated"

2º-I select "Use a Collection" and i use the listOfUsers to this field

-"input Data"- i don't now what to put in this field

-"Output Data"-i ceate a local variable a_user(java.util.Map) that recive the variables that a instance porduces in values and the key have de id of the actor that execute the task.

-"List of Output results"- i create a global variable all_users(java.util.List) that store all the maps a_user

3º- i create a group with the ids involved, and in General->Actors->"Use the actor below"->in the field "Select an actor" i put this group

the number os instances are the size of listOfUsers<- this is ok

i can store the variables of the form and associate to the user/actor that perform the task<- this is ok

one user can do all the instances of the task<- this is bad :( one user/actor should only make one instance of the task, i have read something about the use of custom actor filter but i cant produce a working filter, i hoping that in the field "input data" i can in a simple way pu the user id or the user name to solve this problem.

i realy need guidance and i hope someone can help me.

my thanks in advance

julio.rodrigues

Comments

Submitted by box on Tue, 03/11/2014 - 12:26

Hi, where can I find an example?

I have the same need of julio.

Thanks in advance

Alessandro

Submitted by box on Thu, 03/13/2014 - 18:52

-"Output Data"-i ceate a local variable a_user(java.util.Map) that recive the variables that a instance porduces in values and the key have de id of the actor that execute the task.

-"List of Output results"- i create a global variable all_users(java.util.List) that store all the maps a_use

How do it? An example please.

Imagine I have a variable decision. The "approver" assume value of selected field of list as said by domenico.giordano (Input Data).

How can I set the Output Data (I think like [["Approver", "Alex"], ["decision“,true]], etc. each for one element of collection) and List of Output results? Script Groovy (connector on finish of the multi-instantiated task)?

Thanks

Submitted by domenico.giordano on Fri, 03/14/2014 - 17:24

Hi.

I'll share with you an example asap.

Hope that it could clarify your doubts.

Domenico

Submitted by box on Fri, 03/14/2014 - 22:09

Domenico saint now (alive of course)

Grazie mille ;-)

Ciao

Submitted by domenico.giordano on Sat, 03/15/2014 - 12:24

:-) Thanks!!

2 answers

1
+2
-1
This one is the BEST answer!

Hi Julio

First of all let me explain what is the meaning of "Input data" field. You can define different enviroment (meant different couple variable/value) for each instance of the multi-instantiated task.

Let me switch to your case. You have a list of user that are approvers of your task. This list is process scope variable. Let me say that it contains the IDs of user (it is just to simplify). You can create a local variable on multi-instastiated task named approver. Set it as Input Data. It means that the engine will create different instance one for each id in listOfUser and will assign each value of the list to the local variable approver.

Let me explain with an example:

  • listOfUser: [100,102,300]
  • The engine will create 3 instance of the task
    • instance 1 -> approver=100
    • instance2 -> approver=102
    • instance3 -> approver=300

Now you can assign to the multi-instantiated task a user filter. You can use single user filter and you can use approver as parameter. It means that engine will assign each task instance at each value of approver.

Hope it can help you. If you have other doubts let me know, I coul share with you some examples.

Ciao

Domenico

Comments

Submitted by ttoine on Wed, 02/26/2014 - 16:38

Maybe it would be good to make a howto about actor filters !

Submitted by julio.rodrigues on Wed, 02/26/2014 - 17:42

Thank you so much,

your post instantaneously solve my problem!

grazie mille ;)

julio.rodrigues

Submitted by domenico.giordano on Wed, 02/26/2014 - 17:45

I am so glad that this solve your problem!!

Ciao

1
+1
-1

For those are interested on an example about multi-instatiated task, please give a look on that project and feel free to add any comments.


http://community.bonitasoft.com/projects/multi-instatiated-example

Ciao,

Comments

Submitted by goh.anthony23 on Thu, 03/26/2015 - 21:37

Hi guys,

I saw the example posted by domenico.girodano which used a select widget to select a group. I would like to know if it is possible to select several groups (and not juste one). I am trying to use a checkboxlist but the return type of a checkboxlist is of course a List whereas the return type of the select widget is a map.

I am trying all day to fix and see how I can arrange that but i didn't manage.

Do you guys have an idea of how I can do that ?

Thanks =)

Notifications