HistoricActivityInstance not created when starting a servicetask

Hi,

I’m wanting to provide feedback to the users of a Flowable-based system about which step a process instance is currently running. This is so that the users can easily track it the process.
I was thinking of using the HistoricActivityInstance records, however it does not seem to work as I expect. Can you please comment if this is expected behaviour or if there is a bug?

The process contains a number of ServiceTasks which are executed as async activities. (Most service tasks make a synchronous request to some other system, which can take some time).
When a servicetask has been created and the job is executing if I then make a Query for the HistoricActivityInstances then I get no results for the ongoing ServiceTask…
i.e
activityInstances = historyService.createHistoricActivityInstanceQuery().processInstanceId(processInstanceId).list()

does not have a result for the ongoing servicetask/job. This means that someone querying the API would not know that the serviceTask has been started. When the job is finished then the HistoricActivityInstance is created with a start and end date.
It is possible to retrieve some information by querying the executions, but I find this API harder to use.

Am I using the HistoricActivityInstance API incorrectly or does it sound like a bug? If needed I could probably create a unit test to demonstrate this…

Thanks,
Paul

Hi friend,

Got any solution for track the service tasks ?? am also facing same issue, i want to track the service task in workflow.