[rules-users] issue with .drl file to .brl file conversion

JigarP jigar.prajapati at gmail.com
Mon Jul 28 02:01:20 EDT 2008


Hi,

  I am using  below code to convert .brl to .drl. but i do not know that how
it will put import statement and package name in our new .drl file which we
define in rule.package file. which will be input for processing all rules.

Below is my code snippet. 

String fileName = "SampleTest.brl"; 
		File file = new File(fileName); 
		String fileAsString="";
			fileAsString = FileUtils.readFileToString(file);
		                        
		BRXMLPersistence read = (BRXMLPersistence) BRXMLPersistence.getInstance(); 
		BRDRLPersistence write = (BRDRLPersistence)
BRDRLPersistence.getInstance(); 
		              
		String outputDRL = write.marshal(read.unmarshal(fileAsString)); 

System.out.println(outputDRL);
String packagefile = resolvePackageFile(); 

final PackageBuilder builder = new PackageBuilder(); 
try {
	builder.addPackageFromDrl( new StringReader(packagefile),new
StringReader(fileName));
} catch (DroolsParserException e) {
	e.printStackTrace();
} catch (IOException e) {
	e.printStackTrace();
} 

I have below questions.

1) can we just write single rule using GUI Editor?(once it convert into .brl
file ) or we can write multiple rules in same file using brl.

2) How can we get actual .brl file from .drl file ( as it should have
import, package and lots of rules). what is the procedure to achieve this.

Please reply so we can get real usage of Drool GUI Rule plug-in.

Regards,
Jigar

-- 
View this message in context: http://www.nabble.com/issue-with-.drl-file-to-.brl-file-conversion-tp18684542p18684542.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list