You are using a class called KnowledgeBuilder. With Drools 6,
it is KieBuilder. Here is some simple code, good for testing (as I used it),
although more sophisticated build procedures are recommended
using maven and what not. - Both DRL versions (getAbxDef and abcDef) appear to
work with 6.0.0 Final.
KieServices kieServices = KieServices.Factory.get();
KieFileSystem kfs = kieServices.newKieFileSystem();
FileInputStream fis = new FileInputStream( "lostrule/lostrule.drl" );
kfs.write( "src/main/resources/lostrule.drl",
kieServices.getResources().newInputStreamResource( fis ) );
KieBuilder kieBuilder = kieServices.newKieBuilder( kfs ).buildAll();
Results results = kieBuilder.getResults();
if( results.hasMessages( Message.Level.ERROR ) ){
System.out.println( results.getMessages() );
throw new IllegalStateException( "### errors ###" );
}
KieContainer kieContainer =
kieServices.newKieContainer(
kieServices.getRepository().getDefaultReleaseId() );
KieBaseConfiguration config = kieServices.newKieBaseConfiguration();
config.setOption(EventProcessingOption.STREAM);
KieBase kieBase = kieContainer.newKieBase( config );
kieSession = kieContainer.newKieSession();
On 09/05/2014, jlprat <jlprat(a)gmail.com> wrote:
Hi,
I added the AnEvent class in the gist. You can check it out now:
https://gist.github.com/jlprat/f20e6dbe976cff163d2c
Best,
Josep
--
View this message in context:
http://drools.46999.n3.nabble.com/Rules-don-t-execute-using-MVEL-syntax-i...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users