cancel
Showing results for 
Search instead for 
Did you mean: 

Process level notification

vinothkumar_j2e
Champ in-the-making
Champ in-the-making
hi ,
instance  can be in any activity in the given workflow . It can be a user task or in Receive task (waiting for a event to move forward). Is there any way i can notify USER TASK from a java api call and move the instance forward along the workflow ?

Assume i am able to use identityService for authenication as the user , how can i complete the user task via java api call ?

Thanks
5 REPLIES 5

jbarrez
Star Contributor
Star Contributor
taskService.complete() 😉

If you seet the current user through the identityService, you also save that user information in the historical tables.

vinothkumar_j2e
Champ in-the-making
Champ in-the-making
got it .  If i call taskService.complete() , i see the user task is getting completed and moves along the workflow. But i didn't use identity service or any kind of login to complete user task . As per the process definition , user task is assigned for candidate group , from api if i call complete , how does the activiti BPM ensures the actual member of candidate group has completed the task ?

frederikherema1
Star Contributor
Star Contributor
The Activiti API does not in force this. I you want this, this should be checked (using the queries) in the layer that is consuming Activit. We do this to keep the role/authentication as free as possible to support a wide array of use cases.

An alternative is to add (using BPMNParseHandler) task-complete listeners that check this kind of stuff and throw an Exception on the complete-event of a tasks, effectively NOT completing the task an throwing the "not allowed" exception to the calling thread.

vinothkumar_j2e
Champ in-the-making
Champ in-the-making
Thanks. Please provide the steps for implementing BPMNParseHandler .

jbarrez
Star Contributor
Star Contributor