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

How to get list of groups from Site level

aarasan-3
5-Regular Member

How to get list of groups from Site level

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

1 REPLY 1

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();

   } 

Announcements