Integrating other rule engines

Hey, I really like this project and I want to try and get involved. I saw that years ago drools was and option but it’s not any longer. I haven’t really started looking around the source yet but I thought I’d ask here to see how complex it might be to integrate a different engine.

If there is some good documentation of where to look at doing this I’ll check that out too. One option seems like I could create a binding but I want to see if I can more closely integrate drools. I think fusion (cep) would be a great addition!

A while ago drools was quite problematic to run under OSGi, but couple major releases ago project started to provide osgi metadata. It’s questionable if its still valid cause majority of drools users run their software under JBoss AS/Tomcat.

Well it’s something I want to investigate. I think openHAB looks like an excellent bus to capture events and change device states. I just think I’d like to see about integrating a more powerful engine. Drools does support OSGi now but running it separately could still be a better option.

As someone new to the platform do you think that one approach is better than the other or even matters? I just think it would be cool to be integrated 8)

ServiceMix team have been providing bundle with reduced dependency set for Drools before: http://repo1.maven.org/maven2/org/apache/servicemix/bundles/org.apache.servicemix.bundles.drools/
(I was involved in making one of these)

There is no bundle for 6.x, so it’s possible that Drools is working alone. If you would like to start from smalles footprint you can try to make a OH2 dependency free bundle which uses drools engine to execute some simple rule just to see if there any classloading issues. If you use Karaf public dependencies available in Maven central can be installed pretty quickly:

install -s mvn:org.drools/drools-osgi-integration/6.4.0.Beta1
(-s switch tries to start bundle after it’s installed, most likely it will fail due to drools dependencies)

Thanks Lukasz! We’ll see where this goes. 8)

FTR, this is the PR, where I removed drools support from openHAB: https://github.com/openhab/openhab/pull/2119

I used Drools actually as the very first rule engine for openHAB. But it turned out to be quite heavy and complex, so I came up with the Xtext/Xbase solution as something simpler (and with proper IDE support with code completion, syntax checks etc., which I never managed to get working with drools in the openHAB Designer).
I nonetheless kept drools as an alternative rule engine for many releases, but in the end, it didn’t seem to work anymore and needed some attention and maintenance. Since no user/developer could be found at that time who was at all interested in getting it working again, I decided to discontinue it.

Feel free to bring it back again though, but please note that this should happen in the context of Eclipse SmartHome. I have just introduced a new modular rule engine framework there. It would probably make sense to check, how drools could fit in there as well (and not build something completely aside of it).

Regards,
Kai

Thanks Kai. I don’t know if I’d call Drools particularly complex from a rules authoring standpoint. I do think based on the needs of the end user, Drools could very well be overkill. The current rules can do quite a bit of automation I would imagine but Drools does bring CEP and a very efficient rule evaluation algorithm.

I’m glad you pointed out the Eclipse SmartHome since I didn’t realize what that project actually was (I’m still getting up to speed! 8) ) so I’ll focus my efforts on the rules engine integration over there. I hope, based one what I see there, that this could help the platform move beyond just smart home and into larger automation applications. And options are always a good thing.