Rules evaluating facts not fired in OSGi environment
Issue
We are deploying a bundle which uses the KIE API to execute the Drools engine. This works for simple rules, but any rules which are based on a Fact class fail to fire.
This is our java code:
KieServices services = KieServices.Factory.get();
ReleaseId rid = services.newReleaseId("org.kie.example", "project1", "1.3.0");
KieContainer container = services.newKieContainer(rid);
KieSession ksession = container.newKieSession();
Person person=new Person();
ksession.insert(person);
int ruleFired=ksession.fireAllRules();
And this is the rule which should be fired:
rule "Person"
when
Person()
then
System.out.println("A person exists");
end
Environment
- Red Hat JBoss Fuse
- 6.3.0
- Red Hat JBoss BRMS
- 6.4.0
- Integration Package
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.