Given a Task placed on a particular swimlane, and that swimlane is configured to an actor of the Role of a Manager. How can we find out the role if a task is given to us. Does Bonita expose any API to do the same, or is there any workaround? Any help is highly appreciated!
Hello,
You can use the REST API to get the Actor ID of the task. For example:
http://localhost:8080/bonita/API/bpm/task/ Task ID
The response will include the actor id associated with the task in the JSON object. Use the actor id to call another REST API to show users, groups, roles, etc. associated with the actor. For example:
http://localhost:8080/bonita/API/bpm/actorMember?p=0&c=100&f=actor_id= Actor ID
Here is a sample output of the call, a -1 denotes an attribute that is not set. In this case this actor has been assigned to groups. For more information see the REST API documentation at https://documentation.bonitasoft.com/bonita/7.6
[{“user_id”:“-1”,“role_id”:“-1”,“group_id”:“1”,“id”:“4314”,“actor_id”:“2002”},{“user_id”:“-1”,“role_id”:“-1”,“group_id”:“2”,“id”:“4315”,“actor_id”:“2002”},{“user_id”:“-1”,“role_id”:“-1”,“group_id”:“3”,“id”:“4316”,“actor_id”:“2002”},{“user_id”:“-1”,“role_id”:“-1”,“group_id”:“4”,“id”:“4317”,“actor_id”:“2002”},{“user_id”:“-1”,“role_id”:“-1”,“group_id”:“5”,“id”:“4318”,“actor_id”:“2002”},{“user_id”:“-1”,“role_id”:“-1”,“group_id”:“6”,“id”:“4319”,“actor_id”:“2002”},{“user_id”:“-1”,“role_id”:“-1”,“group_id”:“12”,“id”:“4320”,“actor_id”:“2002”},{“user_id”:“-1”,“role_id”:“-1”,“group_id”:“13”,“id”:“4321”,“actor_id”:“2002”},{“user_id”:“-1”,“role_id”:“-1”,“group_id”:“7”,“id”:“4322”,“actor_id”:“2002”},{“user_id”:“-1”,“role_id”:“-1”,“group_id”:“8”,“id”:“4323”,“actor_id”:“2002”},{“user_id”:“-1”,“role_id”:“-1”,“group_id”:“9”,“id”:“4324”,“actor_id”:“2002”},{“user_id”:“-1”,“role_id”:“-1”,“group_id”:“10”,“id”:“4325”,“actor_id”:“2002”},{“user_id”:“-1”,“role_id”:“-1”,“group_id”:“11”,“id”:“4326”,“actor_id”:“2002”}]