I create one form with select field ,
and add initial value is list of user in that select field .
import org.bonitasoft.engine.identity.*;
List 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
now when user select any one user task will assign to that user , for that i have to fatch userId of selected user into variable for use into ActorFilter
how can i fetch that selected user’s UserId ???
pl provide groovy script for that
thanks kandarp
Hello,
In your widget, you have an “output operation”. So, for your widget, set the result of the field to a variable.
Set in the left part your variable name
Set in the rigth part the field_select.
You don’t need any groovy script to do that (except if you want to change the type).
See a simple example here:
https://www.dropbox.com/s/tet35fpxch3s085/RetrieveUserid-1.0.bos
Note that the field return a String type (even your map contains String and Id). The String contains the User id.
In the next step, then you can based your actor filter on the content of this variable.
Excuse me please.
I think I was not very clear, I need to capture the user logging in form.
As I can do?.
Thank you,
Please note that it returns string (userid) - you will have to convert string type to long in order to assign the next step to that user.
Estimated please if you can help me because I also need to capture the user form, as in this example page to import fails because this created another version.
Thanks
what do you mean exactly ? What’s mean “capture the user form” ? What’s mean “created another version” ?
Please open a different question.