Deserialization error in query method of QueryServicesClient class with advanced custom query in BPM Suite 6.4

Solution Verified - Updated -

Environment

Red Hat JBoss BPM Suite 6.4.6 and previous versions

Issue

  • An empty list is returned by using custom mapper and builder in an advanced query in kie-server. It works well by using QueryFilterSpec, therefore it seems to be related to the way as the result is deserialized.

  • Using the client library java of the kie server, running the following call to a custom query registered on the server returns a list of 0 elements:

    queryServices.query("getTaskAndPotExOwnerWithVars", "RawList7", "GroupOwnerFilter", parameters, 0, 10, List.class);

However, the query method which pass QueryFilterSpec as argument works properly. Then it seems to be related to the way as the result is handled for each method.

Resolution

It is an issue which has been fixed in Red Hat JBoss BPM Suite 6.4 Update 7+.

Root Cause

The issue has been reported in jira RHBPMS-4964 and indeed is related to the deserialization of the result.

See query(String queryName, String mapper, QueryFilterSpec filterSpec, Integer page, Integer pageSize, Class resultType) method, it does a Cast of the result to Wrapped type. While, query(String queryName, String mapper, String builder, Map<String, Object> parameters, Integer page, Integer pageSize, Class resultType) method only Cast to ItemList, therefore it returns a Collections.emptyList();.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments