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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

How to get list of groups from Site level

aarasan-3
7-Bedrock

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
Top Tags