Bug 1260881 - [QE](6.2.z)REST Query API: startDate and endDate parameters do not work
[QE](6.2.z)REST Query API: startDate and endDate parameters do not work
Product: JBoss BPMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
Unspecified Unspecified
medium Severity high
: CR2
: 6.2.1
Assigned To: Shelly McGowan
Radovan Synek
Depends On:
Blocks: 1288023 1295529
  Show dependency treegraph
Reported: 2015-09-08 03:09 EDT by Tomas Livora
Modified: 2016-09-20 01:14 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
When using the REST API to send a query about a process, using the parameters startDate or endDate yields no results even if there are processes matching the criteria. The workaround is to use the parameter startDate_min in conjunction with startDate_max, or endDate_min and endDate_max, so that they intersect only on the intended date.
Story Points: ---
Clone Of:
: 1295529 (view as bug list)
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Tomas Livora 2015-09-08 03:09:54 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):
6.2.0 ER1

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*

Actual results:
There is no result.

Expected results:
The process instance started in step 1 should be returned.

Additional info:
Note that all date range parameters (startDate_min, startDate_max, endDate_min, endDate_max) seem to be working as expected.
Comment 1 Marco Rietveld 2015-12-14 15:36:56 EST
PR submitted: https://github.com/droolsjbpm/droolsjbpm-integration/pull/255
Comment 2 Marco Rietveld 2015-12-18 13:49:42 EST
Fixed. Commits: 

Comment 4 Marco Rietveld 2016-01-05 08:28:15 EST
PR Submitted: https://github.com/droolsjbpm/droolsjbpm-integration/pull/258
Comment 5 Marco Rietveld 2016-01-07 08:53:01 EST
Fixed. Commits: 

Comment 6 Radovan Synek 2016-01-19 12:02:39 EST
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:

Additional info:
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.
Comment 7 Marco Rietveld 2016-01-25 07:03:04 EST
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). "

(See https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_BPM_Suite/6.2/html/Development_Guide/chap-Remote_API.html#idp14908488) 

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" ).
Comment 8 Marco Rietveld 2016-01-25 10:17:31 EST
Pull request added: 

Comment 9 Marco Rietveld 2016-01-25 12:08:03 EST
Fixed. Commits: 

Comment 10 Radovan Synek 2016-02-03 04:48:19 EST
Verified with BPMS-6.2.1.CR2.

However, the behaviour still differs from the expectations in the original description - see details in comment 7.

Note You need to log in before you can comment on or make changes to this bug.