cancel
Showing results for 
Search instead for 
Did you mean: 

TaskQuery vs HistoricTaskInstanceQuery

jdev_hari
Champ in-the-making
Champ in-the-making
I was taking a look at both these classes and I was wondering if they should be a hierarchial relationship between them. i.e. HistoricTaskInstanceQuery must extend TaskQuery.

I have a scenario where I need to query process variables for a given task (which I wont know whether it is an active task or achived). Currently I have it code flow as follows

1. Create an instance of task query
2. Set the query params that I have (task id and few others)
3. Fire the query and get task instances
4. Create an Historic instance of task query
5. Set the query params that I have (task id and few others)
6. Fire the query and get historic task instances
7. club (3) & (6)

Whereas if we had this hierarchial relationship, I would have to construct the query object only once. Same concept applies for the result i.e Task and HistoricTaskInstance. Can someone explain why they are currently unrelated class hierachies?
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
We try to keep the history and runtime totally separately. Historic tasks are always available (even if the task is not finished) you could standardize on historicTask if you insist of using only one pojo/query…. Depending on the end-date, you can check if it's a completed task or a running one.

Keep in mind history will grow and history-queries will be slower than runtime-queries.