Red Hat Bugzilla – Bug 1260881
[QE](6.2.z)REST Query API: startDate and endDate parameters do not work
Last modified: 2016-09-20 01:14:08 EDT
Description of problem:
When you use a process query containing either startDate or endDate as a single parameter, no process instances will be found.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Deploy and run a process.
2. Try http://localhost:8080/business-central/rest/query/runtime/process?startDate_min=*ENTER_TODAY_HERE*
3. See that there is a single result.
4. Try http://localhost:8080/business-central/rest/query/runtime/process?startDate=*ENTER_TODAY_HERE*
There is no result.
The process instance started in step 1 should be returned.
Note that all date range parameters (startDate_min, startDate_max, endDate_min, endDate_max) seem to be working as expected.
PR submitted: https://github.com/droolsjbpm/droolsjbpm-integration/pull/255
PR Submitted: https://github.com/droolsjbpm/droolsjbpm-integration/pull/258
Unfortunately, the behaviour is still the same - parameters like startDate_min,startDate_max,endDate_min,endDate_max work and I am able to receive correct results. However, using parameters startDate or endDate results in an empty collection of process instances.
This could be caused by the fact that the startDate parameter has been specified in a format 'yy-MM-dd' - i.e. not providing exact time when the process started ('HH:mm:ss.SSS' part is missing), simple requesting all process instances that have been started in a single day.
Please see a PR with tests:
a format 'yy-MM-dd_HH:mm:ss' results in a bad request error, forcing user to provide also '.SSS' part. Usually, user doesn't care about milliseconds.
For 6.2 I'll add an additional fix so that "yy-MM-dd_HH:mm:ss" does not cause a bad result error, but results in the nanoseconds being set to ".000".
The reason for this is that changing the behavior of the feature is not something we do for established builds. The documentation states the following:
"Submitting only the date (yy-MM-dd) means that a time of 00:00:00 is used (the beginning of the day). "
For 6.3, which has not yet been released, I will try to change the behaviour to do hat Radovan suggests, which is a much more logical and user-friendly variant (submitting "yy-MM-DD" retrieves _all_ process instances retrieved that day, or in other words, is equivalent to startDate_min="yy-MM-DD"&&startDate_max="yy-MM-DD+1" ).
Pull request added:
Verified with BPMS-6.2.1.CR2.
However, the behaviour still differs from the expectations in the original description - see details in comment 7.