cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a related content in a java service using execution object

pbhat
Champ in-the-making
Champ in-the-making
I am using Activit 5.14 & activiti explorer.
I have a java service defined. I would like to generate a html table and add it as a related content.
I spent some time looking at in the debugger execution object. It has lot of members such as tasks etc. But not clear to me how to get taskservice instance and task id from execution object. 

In the following example I see that given taskservice instance and task id, I can create the related content.
https://docs.google.com/spreadsheet/ccc?key=0Ahh6WozhxGl9dFlMbVRxSWNFODhSWWlXXy1XcEl5SEE&usp=drive_w...

Pleas let me know how to get taskservice instance and task id from execution object. 
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
If you are in a Service-task, you can call

execution.getEngineServices().getTaskService().createTaskQuery().executionId(execution.getId()).list();