Hi,

If you want to simply use rules created in Guvnor in your application there are (at least) 2 ways:-

(1) Use a KnowledgeAgent to download the binary rules from Guvnor. See the guvnor-examples for an example.

(2) Use REST to download the rules' source DRL and add this to a KnowledgeBuilder. See the Guvnor documentation about REST.

If you really want to import the asset from Guvnor into Eclipse (using, I presume WEBDAV?) you will need to dig a bit.

org.drools.ide.common.server.util.BRXMLPersistence.unmarshal(String xml) will allow you you to create a org.drools.ide.common.client.modeldriven.brl.RuleModel from the XML.

You can then use org.drools.guvnor.server.util.BRDRTPersistence.marshal(RuleModel model) to get to the DRL.

With kind regards,

Mike

On 5 November 2012 21:42, dme1 <mehtad@hotmail.com> wrote:
Hi,

I have created a template in Guvnor and exported to Eclipse. The file is in
the <org.drools.guvnor.client.modeldriven.dt.TemplateModel> format when
exported to guvnor. I want to use this within a Java application, for which
I believe I will have to convert to ".drl". How do I convert this file to
".drl" for use within a java app.

Thanks,
dme



--
View this message in context: http://drools.46999.n3.nabble.com/How-to-use-a-Template-File-created-in-Guvnor-in-java-code-tp4020713.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users