-
Bug Report
-
Resolution: Fixed
-
L3 - Default
-
7.7.0
Steps to reproduce:
1. Create a task filter using the REST API with a task query which contains sorting parameters like:
POST /engine-rest/filter/create
{ "name": "Filter With Sorting", "owner": "demo", "query": { "active": "true", "caseInstanceVariables": [], "processVariables": [], "sorting": [ { "sortBy": "processVariable", "sortOrder": "desc", "parameters": { "variable": "invoiceNumber", "type": "String" } } ], "taskVariables": [] }, "resourceType": "Task" }
2. Open Tasklist
Failure message in Tasklist:
"Loading the list of tasks finished with failures. Try to refresh the page to try again."
Failure message in server log:
org.camunda.bpm.engine.rest.exception.RestException: Unknown query property for task query QueryProperty[name=TEXT_, function=LOWER] at org.camunda.bpm.engine.rest.dto.task.TaskQueryDto.sortByValueForQueryProperty(TaskQueryDto.java:1582) at org.camunda.bpm.engine.rest.dto.task.TaskQueryDto.convertQueryOrderingPropertyToSortingDto(TaskQueryDto.java:1533) at org.camunda.bpm.engine.rest.dto.task.TaskQueryDto.convertQueryOrderingPropertiesToSortingDtos(TaskQueryDto.java:1516) at org.camunda.bpm.engine.rest.dto.task.TaskQueryDto.fromQuery(TaskQueryDto.java:1448) at org.camunda.bpm.engine.rest.dto.runtime.FilterDto.fromFilter(FilterDto.java:112) at org.camunda.bpm.engine.rest.impl.FilterRestServiceImpl.getFilters(FilterRestServiceImpl.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167) at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:159) at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:92) at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.camunda.bpm.engine.rest.filter.CacheControlFilter.doFilter(CacheControlFilter.java:41) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.camunda.bpm.webapp.impl.security.filter.SecurityFilter.doFilterSecure(SecurityFilter.java:67) at org.camunda.bpm.webapp.impl.security.filter.SecurityFilter.doFilter(SecurityFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter$1.execute(AuthenticationFilter.java:59) at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter$1.execute(AuthenticationFilter.java:56) at org.camunda.bpm.webapp.impl.security.SecurityActions.runWithAuthentications(SecurityActions.java:38) at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:56) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1527) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1484) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)
Expected Behavior:
Tasklist handles the sorting parameters without failure.
Hint:
In [1] a QueryOrderingProperty is initialized, so that [2] will not become true.
[1]: https://github.com/camunda/camunda-bpm-platform/blob/2a85d5b360f33a92397141d089a2551ada9d62e4/engine/src/main/java/org/camunda/bpm/engine/impl/json/JsonQueryOrderingPropertyConverter.java#L73
[2]: https://github.com/camunda/camunda-bpm-platform/blob/2a85d5b360f33a92397141d089a2551ada9d62e4/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/task/TaskQueryDto.java#L1576