Skip to Content
0
Former Member
Sep 09, 2009 at 03:10 PM

Error filling role?

19 Views

I'm trying to programatically instantiate a process, and I'm getting this exception:

Error filling role Edit_Object of role type 4 during instantiation
com.sap.caf.eu.gp.exception.api.GPEngineException: Error filling role Edit_PPRP0 of role type 4 during instantiation
	at com.sap.caf.eu.gp.process.rt.impl.GPRuntimeManager.checkRoleList(GPRuntimeManager.java:311)
	at com.sap.caf.eu.gp.process.rt.impl.GPRuntimeManager.startProcess(GPRuntimeManager.java:125)

The Administrator and Overseer roles are Initiator Defined, and mapped to a specific user in the GP Design Time. The Owner is set to Initiator, and the only role left 'Edit_Object', is assigned at runtime via the following code:

for (int i = 0; i < process.getRoleInfoCount(); i++) {
  IGPProcessRoleInstance roleInstance = roles.createProcessRoleInstance(process.getRoleInfo(i).getRoleName());				
  if (roleInstance.getProcessRoleTechName().equals("Edit_Object0")) {
    IUser manager = UMFactory.getUserFactory().getUserByLogonID(wdContext.currentContextElement().getUserid());		
    roleInstance.addUser(manager);
    roles.addProcessRoleInstance(roleInstance);
    }
}

I have verified that the 'manager' user is correctly fetched from the UME.

What am I doing wrong?

On a related note, how am I supposed to map from the role names in the GP Design Time, vs at runtime using the API? The only way I could determine which role I needed to assign a user to was to traverse the roles and inspect the role names until I came upon 'Edit_Object0' - this name (which I've changed to avoid exposing and private corporate information) does not bear any relation to the line item in the design time....and I was unable to find the technical name anywhere. Suggestions?