Community Tip - You can change your system assigned username to something more personal in your community settings. X
Hi,
Is there an API through which I enumerate the list of all available groups in my Windchill. I'm able to do this through an Oracle Query from the Database but still would like to know if this can be achieved through any available API, rather than going through the process of having a read only account for Database and resolving the Database query from my code.
Thanks in advance!
Amarkarthi
Similar to SQL, you can use query spec to get this information.
qs = new QuerySpec(WTGroup.class);
SearchCondition sc1 = new SearchCondition(WTGroup.class,
WTGroup.INTERNAL, SearchCondition.IS_FALSE);
qs.appendWhere(sc1);
QueryResult qr = PersistenceHelper.manager.find(qs);
while (qr.hasMoreElements()) {
WTGroup group = (WTGroup) qr.nextElement();
if (group.getName().equals("ORG ADMIN")){
continue;
}
if (!group.isDisabled()) {
getMembers(group.getDn(), group);
}
}
} catch (WTException ex) {
ex.printStackTrace();
}
generateReport();
}