TaskQuery vs HistoricTaskInstanceQuery

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2013 12:34 PM
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?
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?
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2013 04:59 AM
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.
Keep in mind history will grow and history-queries will be slower than runtime-queries.
