Rules evaluating facts not fired in OSGi environment

Solution In Progress - Updated -

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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.