Red Hat Bugzilla – Bug 1264525
EventFactHandles are not deserialized correctly causing error "No enum constant org.drools.core.factmodel.traits.TraitTypeEnum.xxx"
Last modified: 2015-10-24 04:31:09 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."
Fixed by https://github.com/droolsjbpm/drools/commit/59d791076204d28ed370bf83b7f21e9864b0a701 and https://github.com/droolsjbpm/jbpm/commit/c6fd866c5
Also this commit is necessary https://github.com/droolsjbpm/drools/commit/dc52d8790
Verified in BRMS 6.2.0 ER4.
I have added more assertions to the original test, please see .