Bug 1264525 - EventFactHandles are not deserialized correctly causing error "No enum constant org.drools.core.factmodel.traits.TraitTypeEnum.xxx"
Summary: EventFactHandles are not deserialized correctly causing error "No enum consta...
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: jBPM Core
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER4
: 6.2.0
Assignee: Mario Fusco
QA Contact: Marek Winkler
URL:
Whiteboard:
Depends On:
Blocks: 1264541
TreeView+ depends on / blocked
 
Reported: 2015-09-18 16:42 UTC by Gary Hu
Modified: 2020-03-27 19:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1264541 (view as bug list)
Environment:
Last Closed: 2020-03-27 19:07:41 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker DROOLS-924 0 Major Resolved EventFactHandles are not deserialized correctly 2016-05-20 08:32:10 UTC

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


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