OK I’m a beginner and I have to fix this java expression language code to work in my system (Windchill), but looks like I am missing something in the syntax:
LWCNormalizedObject lwc = new LWCNormalizedObject(cr, null, null, null);
lwc.load(wt.change2.WTChangeRequest2.theCategory);
Object bUnit = lwc.get(wt.change2.WTChangeRequest2.theCategory);
If ((bUnit.toString()).equals("PRODUCT_IMPROVEMENT")) {
wt.team.Team team = (wt.team.Team) ( (wt.workflow.engine.WfProcess) self.getObject() ).getTeamId().getObject();
java.util.Enumeration principals = team.getPrincipalTarget(wt.project.Role.toRole("Product Manager"));
while(principals.hasMoreElements())
{
wt.org.WTPrincipal wtprincipal = ((wt.org.WTPrincipalReference)principals.nextElement()).getPrincipal();
System.out.println("principal = " + wtprincipal.getPrincipalDisplayIdentifier());
wt.team.TeamHelper.service.addRolePrincipalMap(wt.project.Role.toRole("Change Admin II "),wtprincipal, team );
}
}
I am having the error at the line 4:
If ((bUnit.toString()).equals("PRODUCT_IMPROVEMENT")) {
Any help will be highly appreciated =D
Ifshould be lowercase.if ((bUnit.toString()).equals("PRODUCT_IMPROVEMENT")) {