Actor filter single user not working

1
0
-1

Dear Sir/Mdm,

How do i use actor filter? Tried but not working.

Terry

3 answers

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

Whoever is interested,

I found the solution. I have a process variable "uid" datatype "long'. Its passed to actor filter. So to grab the email details of userid and passed to system task email connector, just placed the codes below in groovy script.

import org.bonitasoft.engine.identity.User; import org.bonitasoft.engine.identity.ContactData; import org.bonitasoft.engine.bpm.actor.ActorCriterion;

// Get the users attached to the actor member of the human task BonitaUsers.getUserProfessionalContactInfo(apiAccessor,uid).email

Regards, Terry

1
+2
-1

Hello , My be this help you

create one data variable:uid with datatype : long (that will store single user's id)

now, in first task's form take one select box , in available value paste following code . that will give list of all available user

import org.bonitasoft.engine.identity.*;

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

now, in output operation : first filed - select that variable (uid) takes value of field - click on pencil (script) paste following

def long l = Long.parseLong(field_Select1);

task 2 -> actor --> set actor filter -> add Uid variable

Run process , thanks kandarp

return type : should be : java.util.map

thanks kandarp

Comments

Submitted by terrytan1979 on Wed, 05/14/2014 - 09:58

Hi Kandarp,

I followed your suggestion. However, when i run the process in the portal, I get an error "Error while getting the form page list."

pic1

The screenshot for first task's form take one select box , in available value paste following code as follow

pic

Is the return type correct?

Regards, Terry

Submitted by terrytan1979 on Wed, 05/14/2014 - 13:37

Hi Kandarp,

Tks. It works for actor filter. However, I have a email connector. How do i grab the email address of the selected userid ?

Terry

Submitted by terrytan1979 on Wed, 05/14/2014 - 13:37

Hi Kandarp,

Tks. It works for actor filter. However, I have a email connector. How do i grab the email address of the selected userid ?

Terry

Submitted by terrytan1979 on Thu, 05/15/2014 - 07:43

I have tried to grab email address of the userid with the following code but still doesnt work.

import org.bonitasoft.engine.identity.* UserWithContactData proUser = getIdentityAPI().getUserWithProfessionalDetails(user.getId()); proUser.getContactData().getEmail();

Any advise.

Terry

1
0
-1

import org.bonitasoft.engine.identity.User; User user =apiAccessor.getIdentityAPI().getUserByUserName("username"); return user.getId();

Put above code in single user actor filter and you would be able to assign single user for given task.

  • Akhilesh

Comments

Submitted by terrytan1979 on Wed, 05/14/2014 - 08:24

Hi Akhilesh,

I have a process variable called "usernames" as a list with default values (user1, user2).

import org.bonitasoft.engine.identity.User; List users = apiAccessor.getIdentityAPI().getUsers(0,200, usernames); Map<String,Long> list = new HashMap<String,Long>();

for(User u:users) { list.put(u.usernames(),u.getId()); } return list

I have inserted this to actor filter, single user, groovy script but still doesnt work.

Terry

Notifications