]
Marco Rietveld resolved DROOLS-960.
-----------------------------------
Resolution: Out of Date
Create a kie-core-jaxb module for easier serialization
------------------------------------------------------
Key: DROOLS-960
URL:
https://issues.jboss.org/browse/DROOLS-960
Project: Drools
Issue Type: Bug
Components: core engine, kie server
Affects Versions: 6.3.0.Final
Reporter: Marco Rietveld
Assignee: Mario Fusco
Priority: Critical
Fix For: 7.0.0.Final
Attachments: CoreObject.java, ImplObject.java, JaxbInheritanceTest.java
At the moment, the cost of supporting serialization of our command pattern is way too
expensive.
The hacked-together solution that I'm doing is basically taking {{Command}}
implementation classes in the core engines, and then
1. converting those classes to an xsd schema
2. generating new classes from the xsd schema
However, this means that I'm constantly wrestling with the core command
implementations in order to make sure that they serialize correctly and convert nicely to
an xsd schema.
Instead, we should have a {{kie-core-jaxb}} module that contains 2 things:
1. The utilties (Java JAXB Adapters) that are used in multiple modules ({{drools-core}},
{{jbpm-human-task-core}}, {{kie-remote-jaxb}})
2. The Core command serialization implementations.
See the attached java files for an example of how we can use inheritance to do what we
want.
In short:
1. The {{CoreObject}} is the Command DTO class, that would be in {{kie-core-jaxb}}
2. The {{ImplObject}} is the Command implementation, that would be in a {{drools-core}},
{{jbpm-human-task-core}} or other core module. This class would extend the {{CoreObject}}
class, but also make sure to use the same {{@XmlRootElement}} name value.