Bug 1264525

Summary: EventFactHandles are not deserialized correctly causing error "No enum constant org.drools.core.factmodel.traits.TraitTypeEnum.xxx"
Product: [Retired] JBoss BPMS Platform 6 Reporter: Gary Hu <ghu>
Component: jBPM CoreAssignee: Mario Fusco <mfusco>
Status: CLOSED EOL QA Contact: Marek Winkler <mwinkler>
Severity: high Docs Contact:
Priority: high    
Version: 6.1.0   
Target Milestone: ER4   
Target Release: 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1264541 (view as bug list) Environment:
Last Closed: 2020-03-27 19:07:41 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:
Bug Depends On:    
Bug Blocks: 1264541    

Description Gary Hu 2015-09-18 16:42:22 UTC
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 15:15:49 UTC
Also this commit is necessary https://github.com/droolsjbpm/drools/commit/dc52d8790

Comment 4 Marek Winkler 2015-10-24 08:31:09 UTC
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