Bug 1252049
Summary: | REST API does not support Map / Set | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Retired] JBoss BPMS Platform 6 | Reporter: | Anton Giertli <agiertli> | ||||||
Component: | Business Central | Assignee: | Shelly McGowan <smcgowan> | ||||||
Status: | CLOSED EOL | QA Contact: | Lukáš Petrovický <lpetrovi> | ||||||
Severity: | high | Docs Contact: | |||||||
Priority: | high | ||||||||
Version: | 6.1.0 | CC: | kverlaen | ||||||
Target Milestone: | ER3 | ||||||||
Target Release: | 6.2.0 | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2020-03-27 19:40:48 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Anton Giertli
2015-08-10 14:39:12 UTC
Created attachment 1061118 [details]
[1] process which can be used for testing
Forgot to add - HashSet and HashMap were added into the kie-deployment-descriptor on the server side. Customer suggested that this may be solved by adding the support for the mentioned classes into org.kie.services.client.api.command.AbstractRemoteCommandObject Also, both Set<PrimitiveType> + Map<PrimitiveType><PrimitiveType> and Set<CustomDataType> + Map<CustomDataType><CustomDataType> should be supported once the implementation/fix is in place. I made a typo in the comment #3, this is what Customer originally suggested: === Bug fix changes: - Create the JAXB wrapper for the Set and Map. - Change the org.kie.remote.jaxb.gen.util.JaxbUnknownAdapter @Override public Object marshal(Object o) throws Exception { if ( o instanceof List ) { List v = ( List ) o; return new JaxbListWrapper( v.toArray( new Object[v.size()]) ); } else if (o instanceof Set) { // do magic } else if (o instanceof Map) { // do magic } else { return o; } } @Override public Object unmarshal(Object o) throws Exception { if ( o instanceof JaxbListWrapper ) { JaxbListWrapper v = ( JaxbListWrapper ) o; return Arrays.asList( v.getElements() ); } else if (o instanceof JaxbSetWrapper) { // do magic } else if (o instanceof JaxbMapWrapper) { // do magic } else { return o; } } === Fixed. Commits: master: https://github.com/droolsjbpm/drools/commit/c8fff9e69 https://github.com/droolsjbpm/droolsjbpm-integration/commit/7da9f9b4 6.3.x: https://github.com/droolsjbpm/drools/commit/d0a55b8e https://github.com/droolsjbpm/droolsjbpm-integration/commit/dbd8748b These commits also contain updates to the REST operation that allows users to retrieve process instance variables from the process instance itself: ../rest/{deploymentId}/process/instance/{procInstId}/variable/{varName} Deserialization of results from this operation for map, set, list and in particular, nested map or set or list variables (for example: Map<String, Map<String, Object>>) is non-trivial and should be approached with care. Support for java.util.Queue instances will *not* be provided, because there is support for java.util.List instances. Support for Queue instances would only place more emphasis on the script and non-BPM code, which is contrary to the vision behind jBPM. Verified on BPMS 6.2.0 ER5 Map and Set variables work well with REST and JMS client. However, it is not possible to use them with REST or SOAP APIs. Since this bug was reported just for REST client, I am closing it and I have created a new one (bug 1278844) targeting REST and SOAP APIs. |