Closed clinique closed 1 year ago
After further searches, I think that the problem comes from this import : import org.openhab.binding.telegram.internal.action.TelegramActions;
The binding may not be loaded when the script engine tries to compile this class.
That's exactly issue. The import is needed to use the actions and for compiling the class the actions class must be available (or at least it's method signatures).
The problem is that they can only be obtained at runtime, because I need to generate a wrapper class (action classes are in an internal package, so I need to access them via reflection). This is done as soon as the actions class is registered in the system.
I thought about delaying rule compilation until the system is fully initialized but the drawback is that rules that run at earlier start level could not be used.
I'm a bit astonished that you need to touch the file to get it compiling. On my systems (a plain Debian and MacOS) the rules are automatically re-compiled when the actions class becomes available. What system do you run on? And which openHAB version?
I'm on ubuntu 22.04 and OH latest milestone. I need to make a modification on the file so it recompiles once launch is finalized.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I created a class with a rule triggered when the status of a thing changes :
The rule runs fine in normal conditions but after a server restart I have a bunch of errors :
In order to make it work again, I need to touch the java file after the restart is done. I suspect a prerequisite sequence could be missing. Would you have any hint ?