Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1295529

Summary: REST Query API: startDate and endDate parameters do not work
Product: [Retired] JBoss BPMS Platform 6 Reporter: Alessandro Lazarotti <alazarot>
Component: Business CentralAssignee: Shelly McGowan <smcgowan>
Status: CLOSED EOL QA Contact: Lukáš Petrovický <lpetrovi>
Severity: high Docs Contact:
Priority: medium    
Version: 6.3.0CC: alazarot, kverlaen, lpetrovi, rsynek, smcgowan, tradej
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1260881 Environment:
Last Closed: 2020-03-27 19:41:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1260881    
Bug Blocks:    

Description Alessandro Lazarotti 2016-01-04 18:44:59 UTC
+++ This bug was initially created as a clone of Bug #1260881 +++

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.

--- Additional comment from Marco Rietveld on 2015-12-14 15:36:56 EST ---

PR submitted: https://github.com/droolsjbpm/droolsjbpm-integration/pull/255

--- Additional comment from Marco Rietveld on 2015-12-18 13:49:42 EST ---

Fixed. Commits: 

master: 
https://github.com/droolsjbpm/droolsjbpm-integration/commit/3c098ab7

Comment 1 Marco Rietveld 2016-01-25 15:18:04 UTC
See https://bugzilla.redhat.com/show_bug.cgi?id=1260881#c7

"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 2 Radovan Synek 2016-01-25 15:32:56 UTC
Marco,

maybe what I am going to write is unnecessary, but just to make it clear - the idea was it should work on every component of the datetime expression, e.g.:
"yy-MM-DD" => "I don't care about hours, minutes nor seconds"
"yy-MM" => "I don't care even about days, get me processes of the given month"
The same goes for hours, minutes, seconds.

Thanks!

Comment 3 Marco Rietveld 2016-01-25 16:57:09 UTC
Radovan, 

Your specification is incomplete: could you specify the feature more? 

Should users be able to submit only one number and have the REST service know which part of the date this specifies? 

For example, if the user does "startDate=14", is that by default the year? 

If you're going to specify a feature, please specify *exactly* what you want! Otherwise, this will become rather frustrating for both of us...

Comment 4 Radovan Synek 2016-01-26 13:51:06 UTC
After a discussion on IRC we agreed on the following behaviour:
"yy-MM-DD_HH_mm_ss.SSS" => returns all processes started exactly that time, including milliseconds
"yy-MM-DD" => returns all processes (or other entities) started that day, regardless of hours,minutes,etc.
"yy-MM-DD_HH_mm_ss" => returns all processes started that time, regardless of milliseconds, i.e. all instances started between ss.000 and ss.999
"HH_mm_ss" => all processes started that time today.

Comment 5 Marco Rietveld 2016-02-08 14:11:12 UTC
Unfortunately, this feature will not be included in product 6.3.