pefernan commented on code in PR #4273:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4273#discussion_r3378895701
##########
kogito-codegen-modules/kogito-codegen-processes/src/main/resources/class-templates/usertask/RestResourceUserTaskQuarkusTemplate.java:
##########
@@ -87,8 +84,49 @@ public void init() {
@GET
@Produces(MediaType.APPLICATION_JSON)
- public List<UserTaskView> list(@QueryParam("user") String user,
@QueryParam("group") List<String> groups) {
- return
userTaskService.list(identityProviderFactory.getOrImpersonateIdentity(user,
groups));
+ public Object list(
Review Comment:
I understand the change, but I still think it should return a
List<UserTaskView> instead of object, why not using [jackson
views](https://www.baeldung.com/jackson-json-view-annotation) on top of
`UserTaskView` to somehow switch between both task presentations.
Maybe with this approach we can also simplify [this
fragment](https://github.com/apache/incubator-kie-kogito-runtimes/pull/4273/changes#diff-3efefca73563302797ac35ae81f359f53ab353d6a23b27d90670e23c60bb35b6R113-R129)
in both templates.
##########
kogito-codegen-modules/kogito-codegen-processes/src/main/resources/class-templates/usertask/RestResourceUserTaskQuarkusTemplate.java:
##########
@@ -87,8 +84,49 @@ public void init() {
@GET
@Produces(MediaType.APPLICATION_JSON)
- public List<UserTaskView> list(@QueryParam("user") String user,
@QueryParam("group") List<String> groups) {
- return
userTaskService.list(identityProviderFactory.getOrImpersonateIdentity(user,
groups));
+ public Object list(
+ @QueryParam("user") String user,
+ @QueryParam("group") List<String> groups,
+ @QueryParam("format") String format,
+ @QueryParam("processId") String processId,
+ @QueryParam("processInstanceId") String processInstanceId,
+ @QueryParam("status") List<String> status,
+ @QueryParam("taskName") String taskName) {
+
+ // Build filter from query parameters
+ UserTaskFilter.Builder filterBuilder = UserTaskFilter.builder()
+ .processId(processId)
+ .processInstanceId(processInstanceId)
+ .taskName(taskName);
+
+ // Handle multiple status values
+ if (status != null && !status.isEmpty()) {
Review Comment:
@GopikaReghunath Considering that you use the UserTaskState name to build
the query
[here](https://github.com/apache/incubator-kie-kogito-runtimes/pull/4273/changes#diff-f5872faada1b3bc1899550b79afbd939226b3c39e778fa51ccb370e54195251cR107)
I think this conversion is not necessary.
You can directly pass the states collection to the `filterBuilder`, so we
simplify this and both REST templates are simpler.
--
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]