Ok, i now replaced all core files with the files from “js-rewrite”-branch. Now my rule at least stops throwing errors:
2021-02-24 16:48:11.678 [INFO ] [org.openhab.ui.internal.UIService ] - Started UI on port 8080
2021-02-24 16:48:12.046 [INFO ] [ab.ui.habpanel.internal.HABPanelTile] - Started HABPanel at /habpanel
2021-02-24 16:48:12.902 [INFO ] [ab.core.service.AbstractWatchService] - Loading script '/C:/OH310_~1/conf/automation/jsr223/javascript/personal/HelloWorld.js'
2021-02-24 16:48:13.515 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language 'js' with identifier: file:/C:/OH310_~1/conf/automation/jsr223/javascript/personal/HelloWorld.js
2021-02-24 16:48:17.947 [INFO ] [e.automation.internal.RuleEngineImpl] - Rule engine started.
So far, so good. However the rule is not working, there are no log entries produced by the rule. Here is my modified rule source code:
'use strict';
var OPENHAB_CONF = Java.type("java.lang.System").getenv("OPENHAB_CONF");
load(OPENHAB_CONF+'/automation/lib/javascript/core/rules.js');
load(OPENHAB_CONF+'/automation/lib/javascript/core/triggers.js');
load(OPENHAB_CONF+'/automation/lib/javascript/core/log.js');
var me = "HelloWorld.js";
rule({
name: "Javascript Hello World (GenericCronTrigger raw API with JS helper libraries)",
description: "This is an example Jython cron rule using the raw API",
triggers: [
CronTrigger("0/10 * * * * ?")
],
execute: function( module, inputs){
logInfo("Hello World!");
}
});
Thank you for any help or guidance!