Well, the error is it can’t find the script so either:
- you didn’t move your scripts over
- they are in the wrong folder
- the “right” folder may have moved
- there is a bug and openHAB is looking in the wrong location.
Someone experiencing this problem needs to file an issue.
// Run another rule
var FrameworkUtil = Java.type("org.osgi.framework.FrameworkUtil");
var _bundle = FrameworkUtil.getBundle(scriptExtension.class);
var bundle_context = _bundle.getBundleContext()
var classname = "org.openhab.core.automation.RuleManager"
var RuleManager_Ref = bundle_context.getServiceReference(classname);
var RuleManager = bundle_context.getService(RuleManager_Ref);
var map = new java.util.HashMap();
map.put("test_data", "Passed data to called function!")
RuleManager.runNow("tocall", true, map); // second argument is whether to consider the conditions, third is a Map<String, Object>
Notice how you can pass data to the other rule. Much of the stuff in the above code is done for you in the Helper Libraries.
Unfortunately you can’t do this from Rules DSL as far as I know.