cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Conditional connector

rserhan
1-Visitor

Conditional connector

I am trying to setup a conditional connector in a workflow to determine if the initiator belongs to a Role or Group, return true else false. Has anyone attempted this and willing to share the java code.


Thanks in advance

1 REPLY 1
dwilliams
12-Amethyst
(To:rserhan)

The following expressions may be helpful. These was used in the
promotion workflow to determine if the creator was part of the
"Configuration Manager" group. You can probably clean this up somewhat
but it should get your started.



Expression Robot



wt.org.WTOrganization wtorg =
wt.org.WTOrganization.newWTOrganization("MyOrganization");
wt.org.DirectoryContextProvider directoryContextProvider =
(wt.org.DirectoryContextProvider) wtorg;
wt.maturity.PromotionNotice pn =
(wt.maturity.PromotionNotice)primaryBusinessObject;
String creatorUser = pn.getCreatorName().toString();

java.util.Enumeration windchillGroups =
wt.org.OrganizationServicesHelper.manager.findLikeGroups("Configuration
Managers", directoryContextProvider);
while (windchillGroups.hasMoreElements()) {
wt.org.WTGroup wtgroup = (wt.org.WTGroup)
windchillGroups.nextElement();
java.util.Enumeration usersEnum =wtgroup.members();
while(usersEnum.hasMoreElements()){
wt.org.WTUser user = (wt.org.WTUser)usersEnum.nextElement();
String groupUser = user.getName();
if (groupUser == creatorUser)
{
isAdmin = "True";
}
}
}



Conditional Expression



if (isAdmin.equals("True"))
{
result = "isAdmin";
}
else
{
result = "notAdmin";
}



Hope this helps,

Dax


Announcements


Top Tags