flowable / flowable/flowable-engine
dueOn Parameter in GET task query not working as intended
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 9.5k
- Forks
- 2.9k
- Ø Merge
- 7 Std. 8 Min.
- Gemergte PRs (30 T.)
- 2
Beschreibung
Describe the bug
There are two issues with this parameter.
The first minor issue is that the parameter dueOn that is specified in https://github.com/flowable/flowable-engine/blob/d5f2d0384136092b66740e2d63a34c6f420536d1/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskCollectionResource.java#L88 is not being parsed and used, thus it gets ignored (all tasks are returned)
According to https://github.com/flowable/flowable-engine/blob/9e1b562a395d874dc608f5d28b6f1933e4554614/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskBaseResource.java#L231it should be dueDate.
The second issue is that after the correct parameter name is used, it is not possible to use it for the following reason:
- when calling GET task(s), the dueDate is specified in this format: "dueDate": "2021-12-12T10:12:28.586Z"
- when using the same format in query (for instance GET on /process-api/runtime/tasks?dueDate=2021-12-12T10%3A12%3A28.586Z) results in parse error, since parser does not parse the miliseconds
- if miliseconds are omitted, parser will pass the parameter further, but no task can be found, since later on in implementation of search it looks for exact match between parameter value and dueDate of task. Since dueDate of a task will usually have some miliseconds (in particular if process-definition is modeled to be relative to creation time of task), there will be no match.
Expected behavior
For the first issue (parameter name) - the same name shall be used in OpenAPI description and in code.
Not sure which one though :)
For the second issue, I cannot say what is intended behavior here.
Endpoint shall either return all tasks that have dueDate within the second that is passed as parameter (if parser only accepts whole seconds and no miliseconds),
or parser shall also parse miliseconds and pass it to search method.
Additional context
Observed in Flowable 6.6.0 (but as far as I can see, the same issue remains in repostiory for 6.7.1)
Postgres 12
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit TaskCollectionResource.java ungefähr bei Zeile 88 und TaskBaseResource.java ungefähr bei Zeile 231 und verfolge anschließend, wie die GET-Task-Abfrage Fälligkeitsdaten parst und durchsucht. Vergleiche den Namen des OpenAPI-Parameters mit dem Code und überprüfe das Verhalten für Zeitstempel mit und ohne Millisekunden. Done sollte die Namensabweichung beheben und eine konsistente Übereinstimmung bei Fälligkeitsdaten-Abfragen herstellen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java, openapi
- Bereich
- api, backend
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100