Hi,
We created a brl rule using guided editor in Eclipse 3.3
On trying to create a rule package we are getting a 'MissingPackageName'
exception.
As like a brl rule created in BRMS, on eclipse, the DRL source of the
created brl shows only the rule body `with the exception of the package
statement and imports. Our understanding is that packagebuilder in
drools-compiler should pick the package name and the imports defined in the
rules.package text file.
Things work fine for business rules created in guided editor in BRMS. Are we
missing something obvious here? or there isn't a way to compile and test the
brl files created in Eclipse. Any inputs are highly appreciated. Thanks.
Code snippet fyi
File file = new File(test_brl);
BRXMLPersistence read = (BRXMLPersistence)
BRXMLPersistence.getInstance();
BRDRLPersistence write =
(BRDRLPersistence)BRDRLPersistence.getInstance();
String brl = FileUtils.readFileToString(file);
String outputDRL = write.marshal(read.unmarshal(brl));
System.out.println("outputDRl"+outputDRL);
//Output DRL here doesn't show the import statements
and package name
PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl(new StringReader(outputDRL
)); //Missing package name for rule package exception occurs here
Package pkg = builder.getPackage();
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage( pkg );
WorkingMemory workingMemory = ruleBase.newStatefulSession();
workingMemory.insert(obj);
workingMemory.fireAllRules();
--
View this message in context:
http://www.nabble.com/MissingPackageName-Exception-%7C-Eclipse-%7C-brl-to...
Sent from the drools - user mailing list archive at
Nabble.com.