Skip to Content
0
Dec 08, 2008 at 09:10 AM

Removing runtime added users from a Process Role

24 Views

Hi all,

In a GP, I am assigning set of users to action using following code :-

IUser user = UMFactory.getUserFactory().getUserByUniqueName("James007");

IGPUserContext userContext = GPContextFactory.getContextManager().createUserContext(user);

IGPProcessInstance prInstance = rtm.getProcessInstance(executionContext.getProcessId(),	userContext);

rtm.addRuntimeDefinedUserToRole(prInstance, ApproverAction1, user,userContext);

Now this ApproverAction is being called in loop, so I need to assign fresh set of users to this action at each iteration. So how do i remove existing users that are assigned?

There is a method in runtimeManager

 
rtm.removeTaskProcessor(String processInstanceID, String activityInstanceID, IGPUserContext currentUser) 

.

What is the processInstanceID and activityInstanceID here ? from where do i get it?

I saw one more method in :-

executionContext.getProcessRoleInstance().removeUser(IUser user) 

How does it work? Is it helpful?

Thanks and regards,

Amey Mogare

Edited by: Amey Mogare on Dec 8, 2008 10:11 AM