# Dynamic user assignment with dynamic subprocess creation

**URL:** <https://community.ofelia.com/t/dynamic-user-assignment-with-dynamic-subprocess-creation/4315>\
**Category:** Q&A\
**Created:** [28 March 2014 00:12 UTC](https://community.ofelia.com/t/dynamic-user-assignment-with-dynamic-subprocess-creation/4315 "2014-03-28T00:12:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhilesh.pathak](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@akhilesh.pathak](https://community.ofelia.com/u/akhilesh.pathak)\
**Post date:** [28 March 2014 00:12 UTC](https://community.ofelia.com/t/dynamic-user-assignment-with-dynamic-subprocess-creation/4315/1 "2014-03-28T00:12:53Z")

</div>

Hi All Bonita Users,

I am new to bonitasoft and may be I am having basic queries. I am working on 6.2 version.

Use Case  
 &nbsp;&nbsp; &nbsp;1. We have a Manager who is having list of all the Servers that needs to restored.  
 &nbsp;&nbsp; &nbsp;2. He is having list of all the technician who are going to perform this task.  
 &nbsp;&nbsp; &nbsp;3. There are 4 steps in which this restoration happens, say A,B,C,D.  
 &nbsp;&nbsp; &nbsp;4. Now let suppose manager has List of 3 server which he wants to restore.  
 &nbsp;&nbsp; &nbsp;5. He comes into the system and assigns all the 3 Servers to the 3 technicians.  
 &nbsp;&nbsp; &nbsp;6. Now each technician has to perform same set of task. And manager wants to keep track of each task.  
 &nbsp;&nbsp; &nbsp;7. And in between on any task if any issue occurs then he has to raise incident.  
 &nbsp;&nbsp; &nbsp;8. And once the incident is resolved he has to go back to the same task and mark it complete and continue to the next step.  
 &nbsp;&nbsp; &nbsp;  
 For this.  
 &nbsp;&nbsp; &nbsp;1. I have created call activity and linked it to sub process created for task A,B,C,D.  
 &nbsp;&nbsp; &nbsp;2. I have also created sub process for incident management which i calling if there is any issue on the task.  
 &nbsp;&nbsp; &nbsp;  
 Questions  
 &nbsp;&nbsp; &nbsp;1. I have created multinstance call activity with "Use Cardinality" option and set it to the number of users manager has selected (say 3 technician).  
 &nbsp;&nbsp; &nbsp;Then each technician will see 3 instance of task A. Now how can we configure the task so that he knows the first task is for server1, second for server2 and so on ?  
 &nbsp;&nbsp; &nbsp;My second question is, how we can maintain this for task B,C and D ?  
 &nbsp;&nbsp; &nbsp;My third Question is, If servers has some build order than how we can order the task on technician view ?  
 &nbsp;&nbsp; &nbsp;Is "Use Cardinality" is the correct option I have choosen  
 &nbsp;&nbsp; &nbsp;Please help me out i am not able to figure out how handle this.  
 &nbsp;&nbsp; &nbsp;  
 Thanks in advance  
 Akhilesh&nbsp;&nbsp; &nbsp;  
 &nbsp;&nbsp; &nbsp;  
 &nbsp;&nbsp; &nbsp;  
 &nbsp;&nbsp; &nbsp;  
 &nbsp;&nbsp; &nbsp;

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/community_bonitasoft/original/2X/6/6b7b18c0478f2645369e82e009b65e3b97f2cc12.svg) [@system](https://community.ofelia.com/u/system)\
**Post date:** [1 April 2014 08:55 UTC](https://community.ofelia.com/t/dynamic-user-assignment-with-dynamic-subprocess-creation/4315/2 "2014-04-01T08:55:32Z")

</div>

Hi Akhilesh,

Indeed, you should use a collection instead of a cardinality for the multi-instance configuration.

Add a pool java.util.List variable “servers” with default value [“serverA”,“serverB”,“serverC”].  
Configure this “servers” variable as the input collection of the multiinstance  
Add a task variable “server” on multi-instance task: it will bring a different value for each instance of the multi-instance.  
Configure this “server” variable as the “input data” of the multi-instance  
If you were to use output data, you would have a task level variable (i.e. “result”) to store this output for each instance of the multi-instance, and a pool level variable (i.e. “results”) to store the collection / List of outputs for further usage.

Now, lets consider your sub-process / child process. Create a pool level string variable called “sub\_server”. Go to the call activity and configure it to refer to this child process. In the mapping section, map the parent task level variable “server” to the child process pool level “sub\_server”. This way, for each instance of the multi-instance, a child process will be started with a different “server” value.

On the first task (or on the lane) of this child process, configure the actor.

If point 6 of your user case means “the user who made task A on server A should be the one who will make the other tasks (B, C, D) on server A”, then you ought to use a custom filter on each of those tasks which will search and return the user id of the one who did task A.

Lastly, I believe point 7 & 8 are related to your process design…

Hope this is clear enough 😉

Cheers,  
Renaud

---

<div class="post-metadata">

**Author:** ![akhilesh.pathak](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@akhilesh.pathak](https://community.ofelia.com/u/akhilesh.pathak)\
**Post date:** [2 April 2014 01:28 UTC](https://community.ofelia.com/t/dynamic-user-assignment-with-dynamic-subprocess-creation/4315/3 "2014-04-02T01:28:15Z")

</div>

Hi Renaud,

First once again thanks for you response.

I have followed steps mentioned by you and I was able to create different instance for ServerA, ServerB, ServerC.  
After that I tried to configure actor mapping but I was not able to get logged-in user id neither on lane nor on task, so that I can filter whom this task is assigned to.

1. It will be great if you can please let me know how I can configure actor on Lane or task level ?
2. This is in regards to point 7 & 8 . On any task when we click on submit button than that task is completed, so is their a way that we can move from one task to another without completing the task on which we have clicked submit button ?

Thanks in advance  
Akhilesh

---

<div class="post-metadata">

**Author:** ![akhilesh.pathak](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@akhilesh.pathak](https://community.ofelia.com/u/akhilesh.pathak)\
**Post date:** [1 April 2014 09:00 UTC](https://community.ofelia.com/t/dynamic-user-assignment-with-dynamic-subprocess-creation/4315/4 "2014-04-01T09:00:05Z")

</div>

Thanks a lot Renaud for your valuable comments. I will try this out.
