Hi guys, this one is giving me trouble. I have some legacy code I'm trying to update and bring forward. Basically the code checks to ensure one of many people are included as Approvers. If they are included directly (user added directly) it works fine. If they are included via a group, it does not work. Used to work in 9.1. Any ideas? I hope I'm missing something simple here. Thanks!
The Problem:
* In the 9.1 system, the system was capable of checking the group to see if one of the users was in the group.
* In the 10.1 system, the system is no longer recognizing that there is one of these "approved" users if they are in a group and not individually selected during the promotion creation request.
o So these are the scenarios:
1. User is member of approver role = Working
2. User is selected individually on promotion request creation wizard = Working
3. User is a member of a group on the approvers role = Not Working
4. Uses is a member of a group selected on the promotion request creation wizard = Not Working
The Setup:
* The Conditional block has code which is meant to determine is one of a few users was selected by the person creating the promotion request.
* If One of the users was not selected, the creator would get a task to assign on of the users
* There is a managers group associated to the approvers role and one of the listed users is a member of the group
[cid:image001.png@01CF684C.E81EF5A0]
boolean provider = false;
java.lang.String userName;
wt.workflow.engine.WfProcess wfprocess = ((wt.workflow.engine.WfProcess)(self.getObject()));
java.util.Enumeration roles = wfprocess.getRoles();
while (roles.hasMoreElements())
{
wt.project.Role role = (wt.project.Role)roles.nextElement();
if (role.getDisplay().equalsIgnoreCase("Approver"))
{
java.util.Enumeration principals= wfprocess.getPrincipals(role);
while (principals.hasMoreElements())
{
System.out.println ("get the first principal");
wt.org.WTPrincipalReference principalref = (wt.org.WTPrincipalReference)principals.nextElement();
System.out.println ("principalref = "+principalref);
userName=principalref.getFullName( );
if (userName.equals("John Doe") || userName.equals("Jane Smith") || userName.equals("John Smith") || userName.equals("Jane Doe")|| userName.equals("Jannet Doe") || userName.equals("Dan Doe") || userName.equals("Matt Smith") || userName.equals("Michael Smith")) \\This<file: \\this="> is the list of approved users, one of these users needs to be selected as an approver for the workflow to continue
{
provider=true;
}
} // end while
} // end if role "approver"
} // end while roles have more elements
if (provider) result="continue";
else
{
result="assignChangeAdmin";
}