apache/incubator-kie-drools

Get Attributes from AfterMatchFiredEvent

Closed this issue · 3 comments

Can I get the attributes for a rule which was fired?
E.g. by using the Sink (RuleTerminalNode) from the AfterMatchFiredEvent.

For questions, please use google group (https://groups.google.com/g/drools-usage , https://groups.google.com/g/drools-setup) and zulip chat (https://kie.zulipchat.com/#narrow/stream/232677-drools).

You can get org.drools.base.definitions.rule.impl.RuleImpl from AfterMatchFiredEvent. RuleImpl ruleImpl = (RuleImpl) event.getMatch().getRule();, then you can access attributes in the RuleImpl. e.g. ruleImpl.getSalience().

@tkobayas thanks for the response. I was thinking about the attributes which were the reason for the match, e.g. id (in the image).

image

Is this possible? I will also ask this question in the google group :-)

@wake-0 Thanks. I replied to the drools-usage ML. So closing this issue.