Bug 1264525 - EventFactHandles are not deserialized correctly causing error "No enum constant org.drools.core.factmodel.traits.TraitTypeEnum.xxx"
EventFactHandles are not deserialized correctly causing error "No enum consta...
Status: VERIFIED
Product: JBoss BPMS Platform 6
Classification: JBoss
Component: jBPM Core (Show other bugs)
6.1.0
Unspecified Unspecified
high Severity high
: ER4
: 6.2.0
Assigned To: Mario Fusco
Marek Winkler
:
Depends On:
Blocks: 1264541
  Show dependency treegraph
 
Reported: 2015-09-18 12:42 EDT by Gary Hu
Modified: 2015-10-24 04:31 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1264541 (view as bug list)
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker DROOLS-924 Major Resolved EventFactHandles are not deserialized correctly 2016-05-20 04:32 EDT

  None (edit)
Description Gary Hu 2015-09-18 12:42:22 EDT
The following code causes errors "No enum constant org.drools.core.factmodel.traits.TraitTypeEnum.xxx" 

 XStream xstream = BatchExecutionHelper.newXStreamMarshaller();
 ...
 ExecutionResults results = (ExecutionResults) xstream.fromXML(responseXml);

The root cause is explained in the jira https://issues.jboss.org/browse/DROOLS-924
"EventFactHandle overrides DefaultFactHandle's toExternalForm(), but it is not happening the same for the createFromExternalFormat() method. Moreover no code takes care of the 1st argument (the format version) of the serialized format so when deserializing it always instance a DefaultFactHandle even when it was serialized an event."
Comment 3 Mario Fusco 2015-09-24 11:15:49 EDT
Also this commit is necessary https://github.com/droolsjbpm/drools/commit/dc52d8790
Comment 4 Marek Winkler 2015-10-24 04:31:09 EDT
Verified in BRMS 6.2.0 ER4.

I have added more assertions to the original test, please see [1].

[1] https://github.com/droolsjbpm/drools/pull/528

Note You need to log in before you can comment on or make changes to this bug.