Re: [rules-users] DRL to XML transformation

2012-05-31 Thread Michael Anstis
The XML format produced by XmlDumper is an XML representation of various
internal Descriptors used by Drools Expert and only supports features up to
4.0

It is unfortunately not the same as that stored internally in Guvnor (which
is simply a XStream representation of Guvnor's internal model).

Furthermore Guvnor's internal representation is private and subject to
change from release to release.

There is no easy way to convert from one to the other, other than writing
your own XSLT.

With kind regards,

Mike

On 29 May 2012 13:36, Anirban Bandyopadhyay 
anirban.bandyopadh...@monitisegroup.com wrote:

  Hi,

 ** **

 We have a set of rule files in DRL format.  We couldn’t find a way (tool)
 of importing them into Guvnor as BRL file so that we can edit using the
 designer.

 ** **

 We ended up using the DrlParser and XmlDumper to transform them from DRL
 to BRL.  It produces the XML and when we add it to the repository using
 WebDav, Guvnor lists the files under Business Rule which is perfect.  BUT
 when I try to open it, it throws the following error:

 ** **


 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$Unkno
 

 wnFieldException: No such field
 org.drools.ide.common.client.modeldriven.brl.Rul

 eModel.rule-attribute

  Debugging information 

 field   : rule-attribute

 class   :
 org.drools.ide.common.client.modeldriven.brl.RuleModel

 required-type   :
 org.drools.ide.common.client.modeldriven.brl.RuleModel

 converter-type  :
 com.thoughtworks.xstream.converters.reflection.ReflectionC

 onverter

 path: /rule/rule-attribute

 version : null

 ---

 at
 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConv

 erter.determineType(AbstractReflectionConverter.java:449)

 at
 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConv

 erter.doUnmarshal(AbstractReflectionConverter.java:290)

 at
 com.thoughtworks.xstream.converters.reflection.AbstractReflectionConv

 erter.unmarshal(AbstractReflectionConverter.java:230)

 at
 com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshall

 er.java:72)

 at
 com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(A

 bstractReferenceUnmarshaller.java:65)

 at
 com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm

 arshaller.java:66)

 at
 com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm

 arshaller.java:50)

 at
 com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller

 .java:134)

 at
 com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarsh

 al(AbstractTreeMarshallingStrategy.java:32)

 at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1035)**
 **

 at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1019)**
 **

 at com.thoughtworks.xstream.XStream.fromXML(XStream.java:895)

 at com.thoughtworks.xstream.XStream.fromXML(XStream.java:886)

 at
 org.drools.ide.common.server.util.BRXMLPersistence.unmarshal(BRXMLPer

 sistence.java:191)

 at
 org.drools.guvnor.server.contenthandler.drools.BRLContentHandler.retr

 ieveAssetContent(BRLContentHandler.java:41)

 at
 org.drools.guvnor.server.RepositoryAssetService.handlePackageItem(Rep

 ositoryAssetService.java:132)

 at
 org.drools.guvnor.server.RepositoryAssetService.loadRuleAsset(Reposit

 oryAssetService.java:118)

 at
 org.drools.guvnor.server.RepositoryAssetService$Proxy$_$$_WeldClientP

 roxy.loadRuleAsset(RepositoryAssetService$Proxy$_$$_WeldClientProxy.java)*
 ***

 at
 org.drools.guvnor.server.RepositoryServiceServlet.loadRuleAsset(Repos

 itoryServiceServlet.java:403)

 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

 java:39)

 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

 sorImpl.java:25)

 at java.lang.reflect.Method.invoke(Method.java:597)

 at
 com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:5

 69)

 at
 com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(Remot

 eServiceServlet.java:208)

 at
 com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(Remot

 eServiceServlet.java:248)

 at
 com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(Ab

 stractRemoteServiceServlet.java:62)

 at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)***
 *

 at 

[rules-users] DRL to XML transformation

2012-05-29 Thread Anirban Bandyopadhyay
Hi,

We have a set of rule files in DRL format.  We couldn't find a way (tool) of 
importing them into Guvnor as BRL file so that we can edit using the designer.

We ended up using the DrlParser and XmlDumper to transform them from DRL to 
BRL.  It produces the XML and when we add it to the repository using WebDav, 
Guvnor lists the files under Business Rule which is perfect.  BUT when I try to 
open it, it throws the following error:

com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$Unkno
wnFieldException: No such field org.drools.ide.common.client.modeldriven.brl.Rul
eModel.rule-attribute
 Debugging information 
field   : rule-attribute
class   : org.drools.ide.common.client.modeldriven.brl.RuleModel
required-type   : org.drools.ide.common.client.modeldriven.brl.RuleModel
converter-type  : com.thoughtworks.xstream.converters.reflection.ReflectionC
onverter
path: /rule/rule-attribute
version : null
---
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConv
erter.determineType(AbstractReflectionConverter.java:449)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConv
erter.doUnmarshal(AbstractReflectionConverter.java:290)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConv
erter.unmarshal(AbstractReflectionConverter.java:230)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshall
er.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(A
bstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm
arshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm
arshaller.java:50)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller
.java:134)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarsh
al(AbstractTreeMarshallingStrategy.java:32)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1035)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1019)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:895)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:886)
at org.drools.ide.common.server.util.BRXMLPersistence.unmarshal(BRXMLPer
sistence.java:191)
at org.drools.guvnor.server.contenthandler.drools.BRLContentHandler.retr
ieveAssetContent(BRLContentHandler.java:41)
at org.drools.guvnor.server.RepositoryAssetService.handlePackageItem(Rep
ositoryAssetService.java:132)
at org.drools.guvnor.server.RepositoryAssetService.loadRuleAsset(Reposit
oryAssetService.java:118)
at org.drools.guvnor.server.RepositoryAssetService$Proxy$_$$_WeldClientP
roxy.loadRuleAsset(RepositoryAssetService$Proxy$_$$_WeldClientProxy.java)
at org.drools.guvnor.server.RepositoryServiceServlet.loadRuleAsset(Repos
itoryServiceServlet.java:403)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:5
69)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(Remot
eServiceServlet.java:208)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(Remot
eServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(Ab
stractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:293)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcesso
r.java:877)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.pr
ocess(Http11AprProtocol.java:594)
at