Dear,
I'm trying to save the username of the user Entered in the "setup participants" as String attribute in the document.
Using the code below, it returns me the id of the user, for example wt.org.WTUser:58330. The document attribute i want to save is the "elab".
Can we help me find a way to turn this username in the User ID? The code below is embedded in the task transitions> complete.
wt.org.WTPrincipal wtprincipalelab=null;
wt.org.WTPrincipal wtprincipalverif=null;
final String roleElaborador= "ELABORADOR";
wt.workflow.engine.WfProcess wfprocess = ((wt.workflow.work.WfAssignedActivity)self.getObject()).getParentProcess();
java.util.Enumeration pinwf = wfprocess.getPrincipals(wt.project.Role.toRole(roleElaborador));
int count = 0;
while (pinwf.hasMoreElements()){
wtprincipalelab = ((wt.org.WTPrincipalReference)pinwf.nextElement()).getPrincipal();
elab=wt.fc.PersistenceHelper.getObjectIdentifier((wt.org.WTUser)wtprincipalelab).toString();
System.out.println("ELAB**************:"+ elab);
count = count+1;
}
//System.out.println("VALOR DO COUNT (ELABORADOR) ******************"+ count);
if(count==0){
throw new wt.util.WTException(new Throwable(new String("Informe o Elaborador!")));
}
Thanks,
Felipe Oliveira