Hi all,

Is it possible to determine the Pattern that ‘produced’ a given Fact? For
example, assuming we have the following rule and event handler:

rule r1
        when 
                p1:Person(...)
                p2:Person(...)
        then
        ...
end

protected class MyAgendaEventHandler extends
            DefaultAgendaEventListener {

        @Override
        public void
afterActivationFired(org.drools.event.rule.AfterActivationFiredEvent event)
{
                String ruleName = event.getActivation().getRule().getName();
                KnowledgeRuntime knowledgeRuntime = event.getKnowledgeRuntime();
                for (FactHandle factHandle : 
event.getActivation().getFactHandles()) {
                        Object fact = knowledgeRuntime.getObject(factHandle);
                        Pattern pattern= ?;
                }
        }
}

Is it possible to determine the Pattern that originate a Person object? If
yes, how the pattern is identified?

Thanks, David
-- 
View this message in context: 
http://www.nabble.com/Events---Determining-the-Fact-Pattern-tp22397570p22397570.html
Sent from the drools - user mailing list archive at Nabble.com.


_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to