-
Notifications
You must be signed in to change notification settings - Fork 15
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
Dynamic rule builder #195
Dynamic rule builder #195
Conversation
…allows to call an anonymous function instead of a predefined method. - Rule execution refactored, so that it is based on a new JRuleInvocationCallback instead of JRule and method. - Contexts, JRuleModuleEntry, etc. now use the callback instead of JRule and method. - Annotation processing in JRuleEngine internally uses JRuleBuilder as well. Method-call is wrapped inside a callback.
Thank you for the PR, I'll have a look shortly work with the previous PR:s, but more or less done |
src/main/java/org/openhab/automation/jrule/internal/engine/JRuleBuilder.java
Outdated
Show resolved
Hide resolved
logInfo("Adding Dynamic Rule Name: {} item: {}", ruleName, itemName); | ||
} | ||
ruleLoadingStatistics.addRuleClass(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did the addRuleClass go? It is removed here and not in JRuleBuilder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are totally right. that call somehow got lost. I added it again in the last commit.
I have a comment there on the JRuleLoadingStatistics.addRuleClass which is missing? Quite a big PR, I'm running this in my prod env now to test things out. |
@rsopp Sorry stupid question, but what's the usecase of this PR? |
@querdenker2k I use the following setup for the dynamic rules:
|
Another example is: seaside1/jrule-sonos@389b985#diff-2cfb4f9fc917e919de336c63834832acefb3c3cfe03c5f6401201edbb7b9b56e Using The JRuleInvocationCallback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Support for dynamic rules using a newly created JRuleBuilder