Get process comments in Java Service Task

cancel
Showing results for 
Search instead for 
Did you mean: 
Partner

Get process comments in Java Service Task

Hi there,

Does anyone know how to retrieve comments added to a workflow process using REST in a Java-based Service Task ?

My situation is as follows:

I have a custom APS user interface that allows the user to add comments to the process using the POST /process-instances/<process-id>/comments REST API

During the workflow I can retrieve these comments and re-display them using the GET /process-instances/<process-id>/comments REST API

At the end of my workflow I want to write all the comments to a PDF document. I've created a Java service task that uses ApachePOI to generate a PDF document and had assumed I could use the TaskService method getProcessInstanceComments(processId) to return the comments.

It turns out that these comments are different to the comments created via the REST API.

Coments created via REST get saved to the COMMENTS table.

getProcessInstanceComments() returns comments from the ACT_HI_COMMENTS table so is obviously never going to find my comments.

I've no idea why there are 2 different implementations, but has anyone come across a Java method that will retrieve the user comments from the COMMENTS table ?

Thanks

Paul