flowable / flowable/flowable-engine

dueOn Parameter in GET task query not working as intended

Open
#3,104 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
7h 8m
Merged PRs (30d)
2

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.