-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
[Feature Request] Add a condition decorator #47
Comments
Essentially, you are adding what the new rules engine calls a condition, ie the rule gets execute when the event happens and when certain conditions are met. I wonder if that could be added to the decorator? |
Conditions could be added, and I've thought about adding them several times, but I always decide against it. It would be a significant amount of coding, and they really aren't necessary for JSR223 scripting, since you can very easily just add them to the script... like in your example. But thank you for the suggestion. We can leave this open to see if anyone else would be interested in putting it together. It sounds like the issue you are trying to solve is the amount of logging. If your logs are getting flooded, you probably have it still set to DEBUG... change the logging level to WARN ( |
Thanks for your feedback. My logging is definitly set to WARN, so no chance with that approach :( Regarding the conditions: If the rule would still trigger (and place a log entry) but not be executed then it would really not be better than a simple if condition in the action block. |
Would you please paste in an example of the logs you're being flooded with? When logging level is set to WARN, there shouldn't be anything but errors, warnings, and log entries from your rules. |
It is not the flodding what you're thinking :) |
OK... so totally under your control 😉 |
Hello, for quite some time i thought about logical AND-links for triggering rules.
OR-links are already possible with successive @when decorators
but how about a corresponding @and decorator to a @when?
As one of many examples i have a rule that should notify me when a door or window was opened while i am on holiday. It triggers every time a door or window is opened:
But i would prefer it would only trigger when i am away, because this would not flood the log that much:
Whats your opinion? Thanks a lot :)
The text was updated successfully, but these errors were encountered: