Unfinished HistoricTaskInstance

Hi,
In a basic process like this:
image

If I use the below code in the implementation of Service Task 1
Code:

List historicTaskInstances = historyService.createHistoricTaskInstanceQuery()
.processInstanceId( execution.getProcessInstanceId() )
.unfinished()
.list();

I always get the details of User Task 1.
Does that mean User Task 1 is not finished until it reaches next wait state in process?

Hey @akki,

The query you are using is fetching data from the database. However, the data from the current transaction is not yet pushed to the database. Flowable will only send the data to the DB at the end of the transaction.

In order to achieve what you are looking for you will need to make your service task async.

Cheers,
Filip