Package org.openhab.core.automation
Interface Rule
- All Superinterfaces:
Identifiable<String>
- All Known Implementing Classes:
SimpleRule
An automation Rule is built from
Module
s and consists of three parts:
- Triggers: a list of
Trigger
modules. EachTrigger
from this list can start the evaluation of the Rule. A Rule with an empty list ofTrigger
s can only be triggered through theRuleManager.runNow(String, boolean, java.util.Map)
method, or directly executed with theRuleManager.runNow(String)
method. - Conditions: a list of
Condition
modules. When a Rule is triggered, the evaluation of the RuleCondition
s will determine if the Rule will be executed. A Rule will be executed only when all it'sCondition
s are satisfied. If theCondition
s list is empty, the Rule is considered satisfied. - Actions: a list of
Action
modules. These modules determine the actions that will be performed when a Rule is executed.
tags
- non-hierarchical keywords or terms for describing them.
They can help the user to classify or label the Rules, and to filter and search them.- Author:
- Kai Kreuzer - Initial contribution
-
Method Summary
Modifier and TypeMethodDescriptionThis method is used to get the actions participating inRule
.This method is used to get the conditions participating inRule
.This method is used to obtain theRule
'sConfiguration
.This method is used to obtain theList
withConfigDescriptionParameter
s defining meta info for configuration properties of theRule
.@Nullable String
This method is used to obtain the human-readable description of the purpose and consequences of theRule
's execution.default @Nullable Module
Obtains the modules of theRule
.@Nullable String
getName()
This method is used to obtain theRule
's human-readable name.getTags()
This method is used to obtain theRule
's assigned tags.@Nullable String
This method is used to obtain theRuleTemplate
identifier of the template theRule
was created from.This method is used to get the triggers participating inRule
.getUID()
This method is used to obtain the identifier of the Rule.This method is used to obtain theRule
'sVisibility
.
-
Method Details
-
getUID
String getUID()This method is used to obtain the identifier of the Rule. It can be specified by theRule
's creator, or randomly generated.- Specified by:
getUID
in interfaceIdentifiable<String>
- Returns:
- an identifier of this
Rule
. Can't benull
.
-
getTemplateUID
@Nullable String getTemplateUID()This method is used to obtain theRuleTemplate
identifier of the template theRule
was created from. It will be used by theRuleRegistry
to resolve theRule
: to validate theRule
's configuration, as well as to create and configure theRule
's modules. If aRule
has not been created from a template, or has been successfully resolved by theRuleRegistry
, this method will returnnull
.- Returns:
- the identifier of the
Rule
'sRuleTemplate
, ornull
if theRule
has not been created from a template, or has been successfully resolved by theRuleRegistry
.
-
getName
@Nullable String getName()This method is used to obtain theRule
's human-readable name.- Returns:
- the
Rule
's human-readable name, ornull
.
-
getTags
This method is used to obtain theRule
's assigned tags.- Returns:
- the
Rule
's assigned tags.
-
getDescription
@Nullable String getDescription()This method is used to obtain the human-readable description of the purpose and consequences of theRule
's execution.- Returns:
- the
Rule
's human-readable description, ornull
.
-
getVisibility
Visibility getVisibility()This method is used to obtain theRule
'sVisibility
.- Returns:
- the
Rule
'sVisibility
value.
-
getConfiguration
Configuration getConfiguration()This method is used to obtain theRule
'sConfiguration
.- Returns:
- current configuration values, or an empty
Configuration
.
-
getConfigurationDescriptions
List<ConfigDescriptionParameter> getConfigurationDescriptions()This method is used to obtain theList
withConfigDescriptionParameter
s defining meta info for configuration properties of theRule
.- Returns:
- a
List
ofConfigDescriptionParameter
s.
-
getConditions
This method is used to get the conditions participating inRule
.- Returns:
- a list with the conditions that belong to this
Rule
.
-
getActions
This method is used to get the actions participating inRule
.- Returns:
- a list with the actions that belong to this
Rule
.
-
getTriggers
This method is used to get the triggers participating inRule
.- Returns:
- a list with the triggers that belong to this
Rule
.
-
getModules
Obtains the modules of theRule
. -
getModule
-