-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic rules files importing #7
Comments
This would only work locally, but not if the reasoner and the bundle containing the rule are on different nodes. |
Yes that is a limitation, there is no intention of hiding that, it is just a "more friendly" way of incorporating code. |
If we have a generic ontology for rules (which was already proposed), then we could create a "helper" bundle that would be installed on all nodes with those apps (maybe with the app having a direct dependency on it), collect the rules, and send a service request to add the rule to the appropriate reasoner. But maybe it's better not to be too automatic in this case. What if an app has several rules and they can be activated separately? However:
|
Concretely fro Drools the rules are files (very similar to java source files). The drools reasoner wrapper has a service profile which allows to send the string source which then is sent to the reasoner (which just parses it and add it for execution); along with other services to unload the servie (it assigns an ID when loading the source). So initially, yes the helper can be executed in any node in uSpace then the file is serialized in the service call. But I find it that in some cases this might be difficoult to maintain (say for example the issuing node disconnects before sending the "release" call, the code will be kept by the reasoner for ever). This is reason why I propose to embed the helper with in the reasoner itself, so that the source rules are in the same node and such cases are then managed by developer. About the security it is also tricky, initially Drools can call methods with in thier scope (OSGi shares), but this call is within the drools source code, so maybe there is some issue with the plugin. This is the other reason why the modules need to be on the same node as the reasoner. BTW this brings me to conclude the wraper must expose to the rules a generic publisher and a service caller. so this idea of rule-only modules to properly work. |
The Drools reasoner must have a generic service Caller, and Context Publisher (aside from the "all" context event subscriber), that can be refferenced uniformly from the drools source files, in order to perform call and publishing operantions. This is just a reminder to include it and add it to the documentation. |
Add a SynchronousBundleListener to the Drools (or any Rule engine), which searches installed bundles for rule files, in the public packages of the bundle, and automatically adds them to the rule base of the engine.
The reverse process: automatically remove all rule files from the rule base when the bundle is being uninstalled; should also be managed.
use uAALBundleExtender as example of how to use this OSGi feature.
Advantages:
The text was updated successfully, but these errors were encountered: