cancel
Showing results for 
Search instead for 
Did you mean: 

How to get taskentity id from service task?

kesavkolla
Champ in-the-making
Champ in-the-making
I've a service task class which implements JavaDelegate.  Inside the execute method I want to get the current running task entity id.  Is there any API to retrieve the current running task entity id?
13 REPLIES 13

vnama
Champ in-the-making
Champ in-the-making
Well when you make a rest call isn't the request: GET /task/{taskId}
and not the execution id?

If I can do what I want with the execution id, how can I get the execution id?

vnama
Champ in-the-making
Champ in-the-making
Can anyone help me with this? I think I should give some more information about what I'm doing. I have a process definition which includes a receive task. When I instantiate this definition I have code that tries to query the current excution id, but it returns null. If I try to query after the receive task has paused the process, then it returns the active running instances of my process, but I need to get the execution id, before the process pauses at the receive task. Which classes should I be looking at for this problem? Any advice at all on what I should try? Thank you so much.

davidk1
Champ in-the-making
Champ in-the-making
I don't know in general how to get the taskID? There are many methods that require the taskID as parameter, like createAttachment() - at least from version 5.11 there is an issue with it.

Usage of TaskQuery where the call starts inside a task itself, seems to me a little bit cumbersome.

Please, also see http://forums.activiti.org/en/viewtopic.php?f=6&t=5718

jbarrez
Star Contributor
Star Contributor
Yes, you will need to use a sort of query: see http://activiti.org/userguide/index.html#N12AC2