cancel
Showing results for 
Search instead for 
Did you mean: 

PotentialOwner based on previous actions

furgas
Champ in-the-making
Champ in-the-making
Hi,

I'm curious if it's possible in BPMN 2.0 (and if it will be supported by Activiti) to define potentialOwner(s) of userTask based on data provided in some previous task or to dynamically build potentialOwners list by calling some external method during process instance lifetime.

Example:
1. Process definition: order->processOrder->…
2. There is a form associated with order task where "buyer" must choose the country of his origin
3. ProcessOrder task can be claimed only by employers associated with country chosen by "buyer" in order task. This employer-country association should be dynamically fetched at some point after placing order (when we know the country).
4 REPLIES 4

tombaeyens
Champ in-the-making
Champ in-the-making
should already be possible. 
in the identity component, you can model the countries as groups.
the potentialOwner expression should then contain something like: group(${country})
where country is a process variable that contains the country that matches the country group name.

if the docs don't explain this properly, let us know which part we should revise.

activiti-admin
Champ in-the-making
Champ in-the-making
Thank you for your answer.

What about the dynamic part of my question? Let's say that I have some external datasource with mapping country->list of users. How do I utilize such datasource so only specific users can claim processOrder task.

Second example:
Let's extend your example of vacationRequest business process. Usually each employer have one particular manager who should handle his vacation request. Is it possible to modify handleRequest owner based on employer name entered in request form?

Since I'm planning to use REST API to build my own interface for handling processes, maybe the solution is to filter tasks available to users before I present them on interface. Then I can apply any logic I want. The only requirement for this solution is the ability to get the values entered in particular task form. Is there a REST method for this?
Also is/will there be REST methods for TaskService.addGroupInvolvement, TaskService.addUserInvolvement and TaskService.setAssignee ?

tombaeyens
Champ in-the-making
Champ in-the-making
Joram, what are the dynamic task assignment capabilities we have already?  Is there an assignment handler or something similar?

jbarrez
Star Contributor
Star Contributor
Currently we have direct assignments and expressions. No assignment handler yet.

Regarding the second question: yes, thats actually how it is done in the VacationProcess example: the name of the employee is stores as a process variable that then is used in an expression the task assignment.