Hi,
We have variable stored in ACT_HI_VARINST. we need to query the history based on our variable say example “calculator” and we need to apply pagination and date filter such as fromDate and toDate. Second, when there is no filter criteria such as date and pagination we need to fetch all the history for our variable, this data might be huge so we need this record within 30 seconds.
how do we achieve this?
@Adithyan you can refer this rest api docs for querying historic process variables with various filter options & including sorting.
https://docs.camunda.org/manual/7.9/reference/rest/history/variable-instance/post-variable-instance-query/
Optionally, you can add Query params like firstResult & maxResults for pagination.
Hi Thanks for replying.
i would like to fetch the history with date filter like fromDate and toDate.
how do i do that?
Thanks for replying.
great, even we have followed the same approach but the problem since we need to query taks instance for processInstanceId and then query the history based on processInstanceId is taking time if the record is more.
our scenario:- we have got 80K record when we query first we will get 80K processInstanceId and passing 80K processinstance to get 80K history is taking more time.
is there any way to get this result within 30seconds?
Thanks,
Adithyan
@Adithyan you can apply pagination logic for historic task instance only and get list of process instance ids and pass it to variable instance query. Pagination will take less than a second. Dont apply pagination for variable instance query since you have applied pagination for task instance
Hi,
we have two requirement below
- one with pagination and date - this is absolutely working fine
- get all history without pagination and then write it into excel - this is taking more time if the record count is more.
Any solution for #2 ?
If you query for entire data it will utilize maximum memory and sometimes you’ll face timeout exception too. So its better to try something like streaming logic which will pull chunks of data in every api call and keep writing to the excel.
1 Like
thank you so much, i will try to take a look.