AnsweredAssumed Answered

[Proposal] Linking process instances and users

Question asked by marcus1 on Feb 20, 2013
Latest reply on Feb 26, 2013 by marcus1
In Activiti users are linked to tasks through IdentityLink and can be queried using TaskQuery.candidateUser(…). Similarly, the ability to link users with process definitions has been added recently through ProcessDefinitionQuery.startableByUser(…).

However, unless I've missed something obvious, there seems to be no way to link users and process instances.

In our application we have the requirement for people to see a list of the running process instances they are involved in (i.e. they started it or own/have owned an associated task). We've implemented this with our table which stores user_id - instance_id - involvement_type, but this is obviously not ideal.

It would be great if it were possible to do this through the standard Activiti API.

I would suggest to do it as follows and am willing to implement it as such and contribute it through a Git Pull Request.

1. Add a column for process instance id to ACT_RU_IDENTITYLINK.
2. Where IdentityLinks for tasks are added also store the process instance id.
3. On process start add an IdentityLink to the instance id and the current users (obtained through IdentityService.authenticatedUser).
4. Add a filter method to ProcessInstanceQuery: involvedUser(String userId).

What do you think?

Outcomes