jstastny-cz commented on code in PR #4273:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4273#discussion_r3316154726
##########
kogito-codegen-modules/kogito-codegen-processes/src/main/resources/class-templates/usertask/RestResourceUserTaskSpringTemplate.java:
##########
@@ -92,15 +99,54 @@ public void init() {
}
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes =
MediaType.ALL_VALUE)
- public List<UserTaskView> list(
- @RequestParam(value = "user", required = false) String user,
- @RequestParam(value = "group", required = false) List<String>
groups) {
- return
userTaskService.list(identityProviderFactory.getOrImpersonateIdentity(user,
groups));
+ public Object list(
+ @RequestParam(value = "user", required = false) String user,
+ @RequestParam(value = "group", required = false) List<String>
groups,
+ @RequestParam(value = "format", required = false) String format,
+ @RequestParam(value = "processId", required = false) String
processId,
+ @RequestParam(value = "processInstanceId", required = false)
String processInstanceId,
+ @RequestParam(value = "status", required = false) List<String>
status,
+ @RequestParam(value = "taskName", required = false) String
taskName) {
Review Comment:
What is the rationale behind using task name (free form text) as the
filtering parameter for a task? Why not use user task id instead?
With this choice and allowing partial match, IMHO you're beating the
"selling" point calling this performance optimization.
When checking jbpm_user_tasks table I can see index only on id column and
user_task_id:
```
"jbpm_user_tasks_pkey" PRIMARY KEY, btree (id)
"idx_usertasks_tid" btree (user_task_id)
```
So those are IMHO the only ones to be queried in performant and optimized
way.
Even if the task name column was indexed - the partial match and concat SQL
functions might prevent the query from hitting the index at all.
Problem with user_task_id is that the KIE editor might allow only generated
values - but that's IMHO a room for improvement on that front, I don't think it
needs to be restricted to that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]