Get all groups of a task ID's actor

Hey,

I'm trying to find a way in groovy through which, I can get all the groups that are allowed to execute a task. I am trying to write a script at the "connector in" of a station that gets me this data. Even the actor's API takes processDefinitionId as an argument, and not taskId/activityId. I want the actors with respect to that instance, could you help me out?

Thanks!

I think it's not possible with the default groovy API.
I do something like you want in my application, but i have made it in JAVA.
To do that, you need to request the bonita database like that:

SELECT actormember.groupid FROM flownode_instance as activity INNER JOIN actormember ON activity.actorid = actormember.actorid WHERE activity.id = {{taskId}} AND groupid != -2

This request give you all groups ids for you task.

@antoine.mottier any possibility?

Can I run queries on the bonita database through the groovy script in the connector in section?

I don't know, i'm using an old version (7.6), and it's not possible on it, maybe in the new version... But i don't think that they have add that things. I will search if we can.

Take a look at : http://grails.asia/groovy-sql-database-connection-example
It's possible, but i'm not an expert in groovy.

Thanks, also, groupid = -1 when that actor has no group assigned, when is a groupid -2 though?

.

It's a mistake, my finger slipped ^^'