I am a beginner in Bonita and working on a project . My requirement is to get groups and roles to be filled from organization structure to drop-down list in UI form how can I achieve this ? do I need a connector? please give a sample.
I am a beginner in Bonita and working on a project . My requirement is to get groups and roles to be filled from organization structure to drop-down list in UI form how can I achieve this ? do I need a connector? please give a sample.
Hello,
You have to use a REST API to collect all the users / Groups / Roles.
Have a look at these REST API
https://documentation.bonitasoft.com/bonita/7.11/identity-api
Best,
Hi Pierre
Thanks for the replay
I have checked with Identity API .
Is this the way of calling the Identity API or am I missing anything please guide?
Also tried with below code in operations as a next trial for getting list of groups but iam getting error .Please suggest is this the correct way wrong .I have got it from below URL
https://documentation.bonitasoft.com/bonita/7.10/manage-an-organization
import javax.naming.directory.SearchResult
import org.bonitasoft.engine.api.IdentityAPI
import org.bonitasoft.engine.api.TenantAPIAccessor
import org.bonitasoft.engine.identity.Group
import org.bonitasoft.engine.search.SearchOptionsBuilder
import org.bonitasoft.engine.session.APISession
import groovy.test.GroovyAssert
final IdentityAPI identityAPI=TenantAPIAccessor.getIdentityAPI(APISession);
final SearchOptionsBuilder builder=new SearchOptionsBuilder(0, 100);
final SearchResult groupResults =identityAPI().searchGroups(builder.done());
return groupResults;
Hello,
Open the browser debugger (F12) and goes to the panel "Network". Then, access your page. If the getRoles is empty, that's means the REST API Failed, and you should see in the panel Network what's happen.
I have the feeling your REST API is not correct : the correct one is something like
../API/identity/group?p=0&c=100
==> Did you place .. before /API? Did you set p=0&c=100 ?
For the JAVA, it's correct.
So you you return a SearchResult information. If you want to use that in a REST API Extension, you have to change that in a structure to return it as a JSON, then use a JSON Builder to generate the JSON to return it to your browser.