When i include date filtering to task history request - they dont apply and results stay the same:
Requests: /engine-rest/history/task?startedAfter=2019-02-05T18:18:32
OR /engine-rest/history/task?startedAfter=2019-02-23T14:42:45.000+0300.
And in results i see all tasks, including old:
{
“startTime”: “2018-12-14T18:50:50”,
“endTime”: “2018-12-14T18:51:29”
}
The problem was that in date 2019-02-23T14:42:45.000+0300 ‘+’ must be url-encoded.
May be it will be better to write about this detail in documentation.
Thanks Raliev for taking out time.
I tried this but It is throwing exception. Please find below logs.
Exception in thread “main” org.springframework.web.client.HttpClientErrorException$BadRequest: 400 400: [{“type”:“InvalidRequestException”,“message”:“Cannot set query parameter ‘startedAfter’ to value ‘2020-10-15T15:21:30.104 0900’: Cannot convert value “2020-10-15T15:21:30.104 0900” to java type java.util.Date”}]
@sanjay.chaurasia i’ve tested your code snippet - its working. So the only reason, i think, will be that your Camunda dateTime format is another.
The simplest way to test it - run /history/task without parameters. You will see list of tasks, and in the dateTime fields there will be real dateTime format on you server., e.g. "startTime": "2020-01-31T11:17:08.587+0300" or "startTime": "2020-01-31T11:17:08.587".
The ?startedAfter= parameter in your query must be in the same format.
About dateTime format you can read https://docs.camunda.org/manual/7.12/reference/rest/overview/date-format/
@raliev I checked and found that default date format is used.
“startTime”: “2019-01-07T10:22:15.845+0900”, This is the time I got from /history/task API.
Though It is completely working fine If I hit the same URL from browser and postman but it is not working with JAVA API.
Yes, I checked the URL in debug mode. Same url is passing in RestTemplate.getForEntity(url, class). I wonder why it is not working while the same URL is working with Postman. I am completely fed up with this.
Could you please share your code snippet that you have tested. May be I am missing something