You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: configuration/rules-dsl.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -955,6 +955,18 @@ then
955
955
end
956
956
```
957
957
958
+
### Run A Rule
959
+
960
+
A rule with UID `r2` can be executed with [RuleManager.runNow()](https://openhab.org/javadoc/latest/org/openhab/core/automation/rulemanager#runNow(java.lang.String)):
961
+
962
+
```java
963
+
val ruleManagerBundleContext =org.osgi.framework.FrameworkUtil.getBundle(org.openhab.core.automation.RuleManager).bundleContext
964
+
val ruleManagerServiceReference = ruleManagerBundleContext.getServiceReference(org.openhab.core.automation.RuleManager)
965
+
val ruleManager = ruleManagerBundleContext.getService(ruleManagerServiceReference)
0 commit comments