flowable / flowable/flowable-engine

dueOn Parameter in GET task query not working as intended

Aperta
#3,104 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
9.5k
Fork
2.9k
Merge medio
7h 8m
PR unite (30g)
2

Descrizione

**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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start with TaskCollectionResource.java around line 88 and TaskBaseResource.java around line 231, then trace how the GET task query parses and searches due dates. Compare the OpenAPI parameter name with the code and verify behavior for timestamps with and without milliseconds. Done should resolve the naming mismatch and establish consistent due-date query matching.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java, openapi
Ambito
api, backend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.