on 12-12-2008 9:47 AM
Hi All,
I m starting a process programmatically(using startProcess()).
Process initiation is working fine, but i need to assign a 'Group' to the role, and not a user. It is a portal group, available at portal end only. How can this be done?
Please guide.
Thanks and Regards,
Sakshi
Hi,
Using the UME API you have to fetch the group, iterate it and assign it user by user to the specific role.
Hope that helps.
Best regards,
George.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi George,
Yes, I am aware of this approach, but this is equivalent to hard coding the group (or knowing the group name in advance). In my case, user group names are not final and can be changed in future at portal end. Is there any way to handle this?
Also can you please provide some sample code, for the solution that you suggested?
Thanks and Reagrds,
Sakshi.
Hi Sakshi,
I don't that is possible. You have to get the group from the UME API somehow.
As far as I know this is done by Name.
You can try asking in some of the UME forums what be achieved with their API.
My best idea is to make a constant for each group name and use it in your GP API code.
Then if you change the group's name you just go and change the constant's value.
Best regards,
George.
you can use the following code
import com.sap.caf.eu.gp.process.api.GPProcessFactory;
import com.sap.caf.eu.gp.process.api.IGPProcess;
import com.sap.caf.eu.gp.process.rt.api.IGPProcessRoleInstanceList;
import com.sap.caf.eu.gp.process.rt.api.IGPRuntimeManager;
import com.sap.security.api.IUser;
public void startProcess( java.lang.String processId )
{
...
// retrieve the Runtime Manager
IGPRuntimeManager rtm = GPProcessFactory.getRuntimeManager();
// create an empty role assignment list
IGPProcessRoleInstanceList roles = rtm.createProcessRoleInstanceList();
// get the process role number
int rolenum = process.getRoleInfoCount();
// iterate over the required roles
for (int i = 0; i < rolenum; i++) {
// create a new role instance by specifying the role's unique name
IGPProcessRoleInstance roleInstance = roles. createProcessRoleInstance(process.getRoleInfo(i).getRoleName());
// add a user to the role instance
roleInstance.addUser(roleUser);
// add the new role to the assignment list
roles.addProcessRoleInstance(roleInstance);
}
Thanks and Regards
shanto aloor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.