[rules-users] Working with BRL format

wilsonywx wei.yuan at baml.com
Wed Jul 21 23:15:54 EDT 2010


I've been trying to make a custom GUI to edit rules and store them in a
format that is easily exchangeable between the GUI and the rule engine. It
seems that the BRL format (which from what I understand is just an xml
representation of the rules that belong in a package) is a good file format
to use (although I am not too clear on how the .package file works with the
.brl files). In the meanwhile I've been looking at the source code of
Guvnor, in hope that I could find some classes that can convert between brl
and drl, as well as between the class model of rules and brl. 

I found snippets of code that uses BRXMLPersistence to read from brl (I
think) into a RuleModel object, which is then converted into a DRL string
using BRDRLPersistence, something like:

RuleModel model =
BRXMLPersistence.getInstance().unmarshal(asset.getContent()); // how to get
asset?
model.name = asset.getName();
model.parentName = this.parentNameFromCategory(asset, model.parentName);  
String drl = BRDRLPersistence.getInstance().marshal(model); // is this the
entire rule text? 
      
I am not sure how to interface RuleModel with the GUI, though, so I would
like some pointer in that direction. Also, what is the class to read from a
.package file so that I can generate a drl file with the correct package
attribute and imports? 
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Working-with-BRL-format-tp985993p985993.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list