You have to use full package names for anything outside of java.lang.
result = "ERROR";
try {
if (primaryBusinessObject instanceof wt.team.TeamManaged) {
wt.team.Team team = wt.team.TeamHelper.service.getTeam((wt.team.TeamManaged) primaryBusinessObject);
Role role = Role.toRole("APPROVER");
int count = 0;
Enumeration<?> principals = team.getPrincipalTarget(role);
while (principals.hasMoreElements()) {
wt.org.WTPrincipalReference next = (wt.org.WTPrincipalReference) principals.nextElement();
if (next != null) {
count++;
}
}
if (count > 1) {
result = "CONTINUE";
}
}
} catch (Exception e) {
e.printStackTrace();
}