Get all groups of a task ID's actor

1
0
-1

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!

Comments

Submitted by abizer.lokhandw... on Sun, 12/29/2019 - 09:46

@antoine.mottier any possibility?

1 answer

1
+2
-1
This one is the BEST answer!

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.

Comments

Submitted by abizer.lokhandw... on Tue, 12/31/2019 - 15:37

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

Submitted by bastien.laurent... on Tue, 12/31/2019 - 15:46

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.

Submitted by abizer.lokhandw... on Thu, 01/02/2020 - 11:10

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

Submitted by abizer.lokhandw... on Thu, 01/02/2020 - 11:11
Submitted by bastien.laurent... on Fri, 01/03/2020 - 15:08

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

Notifications