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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

How to get users and groups of a organization level using API?

GenKie
7-Bedrock

How to get users and groups of a organization level using API?

I want to get users and grouops of a organization level in Workflow.

The organizaion is related to the primarybusinessobject.

Please teach me which API  I use and simple code.

1 REPLY 1
glv
12-Amethyst
12-Amethyst
(To:GenKie)

We can try to use query spec to query user and group from DB

For users you can refer

 QuerySpec querySpec = new QuerySpec(WTUser.class);
        SearchCondition searchCondition = new SearchCondition(WTUser.class, WTUser.NAME, SearchCondition.EQUAL, name, false);
        querySpec.appendSearchCondition(searchCondition);
        QueryResult queryResult = PersistenceHelper.manager.find(querySpec);

For groups you can refer:

QuerySpec querySpec = new QuerySpec(WTGroup.class);
        SearchCondition searchCondition = new SearchCondition(WTGroup.class, WTGroup.NAME, SearchCondition.EQUAL, groupName, false);
        querySpec.appendSearchCondition(searchCondition);
        QueryResult queryResult = PersistenceHelper.manager.find(querySpec);

 

 

 

 

Announcements

Top Tags