Bonitasoft 6.2.6 how to assign specific user to next task
Hello Terry, you could use Actor filter - Single user that will allow you to do it by specifying its ID. So, you can allow one user to select a username for the next task, and then you can put a filter on the next task that will use this username to get its ID and assign the task to him/her. You can check more information in our documentation here . You can also do it using APIs, there is a method assignUserTask that allows to assign a given human task to a certain user. Hope this helps, Haris
Hello may be this help you , i can explain how to give user to choice next task assign to which user pl do following
Detail Process :
- create simple process with 2 tasks : start -> task1 -> tast2 -> end
- create data variable : uId with type: Long
- step 1 -> application -> page-flow -> add Page-flow (form)
- in page flow - > take one select box -> select-box's data tab -> available value -> paste following script
List<User> users = apiAccessor.getIdentityAPI().getUsers(0, 200, UserCriterion.FIRST_NAME_ASC);
Map<String,Long> combo = new HashMap<String,Long>();
for(User u:users)
{
combo.put(u.getFirstName(),u.getId());
}
return combo
- in output operation : first filed - select that variable (uid) takes value of field - click on pencil (script) paste following
- task 2 -> actor --> set actor filter -> add Uid variable
now run process .
(in task 1 user can see list of users , after it select any specific user , selected user's id store into UID variable task 2 use actor filter and get that UID and assigned that task to that specific user . )
Thanks Kandarp
Comments
Hi Kandarp,
I followed your suggestion. But i got "Error while getting the form page list" while loading the first task with the select box. My codes in the first task, select box, groovy script as such.
Is my return type correct?
Regards, Terry
On the screenshot attached, you should use Map as return type (click on browse and search for Map, choose java.util.Map)
hellow.
I have the same error. How did you fix?
Hello
no it should be : java.util.map
thanks kandarp
Comments
Hi, I've succeeded in running the example. I'd like to know why, if I press the Evaluate button, the system asks a value for the process variable apiAccessor. If I write anything in the box I get an ExpressionEvaluationException error
thaks, Mirco
When using any system variable there is nothing there to evaluate, so it will ask you to give it a number.
To be honest except for the most basic stuff the Evaluate button is next to useless. You will be prompted for everything you need to make the code work. When you don't have a running process there is nothing to grab on to, hence the *ExpressionEvaluationException * error.
for example, in script code
will ask you to provide values for x and y;
if you have a hand coded DB access with parameters (as below) for everything and a select statement you will be asked for (example only)
*Select userid, userfirstname,userlastname from ${tablename} where userid = '${userid}' *
port
username
password
database
driver
tablename
userid
Hope that helps to complete your understanding, regards Seán
Comments
Sorry for bothering ,but i don't know how to use APIs ,could please help me ?