I want to provide a rest endpoint that will expose data of a process.
Not all process data needs te be returned, only a few variables and a boolean indicating if the process is completed.
To achieve this I use the HistoryService and query the historic process instance and the required history variables.
The issue is that when a process is still being executed I can have an inconsistency between the data on the historic process instance (state) and the variables because they have to be queried separately.
For instance:
- the rest service queries the historic process instance and it’s state indicates that the process is still running
- the process completes it’s final step and a variable X is set
- the rest service queries the historic variable X and finds the value set in the final step
- the rest service will now say that the process is running and variable X has been set
Is it possible to query the historic process instance along with all the variables?
Or do you see a better solution for my use case?