PackageBuilderConfiguration conf=new PackageBuilderConfiguration();
conf.setCompiler(PackageBuilderConfiguration.JANINO);
//Building
package builder with defined configuration
final
PackageBuilder builder=new PackageBuilder(conf);
//Class ab=null;
try
{
//FileInputStream fs=new FileInputStream("C:\\jdevstudio10133\\jdev\\mywork\\ServletApplication\\Project1\\src\\project1\\Test.drl");
//ab=Class.forName("project1.RuleTest2");
//builder.addPackageFromDrl(new
InputStreamReader(ab.getResourceAsStream("Test.drl")));
builder.addPackageFromDrl(new
InputStreamReader(getClass().getResourceAsStream("/Test.drl")));
}
catch(Exception
e)
{
System.out.println("Error!"+e.getMessage());
}
//building rule
base
final RuleBase
ruleBase=RuleBaseFactory.newRuleBase();
ruleBase.addPackage(builder.getPackage());//adding package to the rule base
final
WorkingMemory workingMemory=ruleBase.newWorkingMemory();//creating new working
memory
final FactHandle
fa=workingMemory.assertObject(taskObj);//asserting received object from caller
workingMemory.fireAllRules();//firing rules
This is my code snippet.
It gives me Null value Exception every time I run the code.
Can any one help me.
Tushar
DISCLAIMER ========== This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.