-
-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DSL] Cannot import org.openhab.core.util
namespace
#3743
Comments
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/oh4-hsbtype-is-deprecated-warning/148080/12 |
Did you try? |
Same error.
|
Sorry for my stupid suggestion. |
Maybe to be added here? Those defined here do not need any explicit import. |
I will do this change and then test if your rule example is working without the import. |
Or even rather add ColorUtil as implicitly imported class here |
Unfortunately, I do not succeed to make it work.
Even if the changed code is compiling, at runtime, org.openhab.core.model.script is not "seeing" org.openhab.core.util. |
Shouldn't the package |
Probably. I will try. |
Ok, it solved my exception. Unfortunately, my change has no impact, I still get: The name 'ColorUtil' cannot be resolved to an item or type |
By the way, I searched in my existing rules the syntax to call static methods and apparently the syntax would be
But it does not solve the issue ! |
Do you have another working example with a call to a static method provided by openHAB ? |
Is this relevant at this stage of the issue? I would expect an error at the method level once the |
If I had a working example, I could try to understand what is the difference. |
Apparently, it doesn't seem to matter how it is called. https://eclipse.dev/Xtext/xtend/documentation/203_xtend_expressions.html#static-access |
Maybe the only solution would be to add actions napping ColorUtil methods. https://github.com/openhab/openhab1-addons/wiki/Actions I think you can't with DSL rules import any Java package you like. That is certainly the root cause. |
I don't have enough knowledge to weigh in on your proposed solution. It seems a bit overkill though. The |
It should be definitively possible to make ColorUtil class implicitly imported. It is what I am trying to achieve. |
There are other classes in |
Ok, I am able to make it work but I need to define a class in org.openhab.core.model.script.actions mapping all static methods of ColorUtil. But then, we can take care to also expose the methods to UI. Edit: makes probably no sense to expose these utils directly as actions for the user in UI. But of course, they will be usable inside a UI script. |
Fix openhab#3743 Signed-off-by: Laurent Garnier <[email protected]>
Fix openhab#3743 Signed-off-by: Laurent Garnier <[email protected]>
Fix openhab#3743 Signed-off-by: Laurent Garnier <[email protected]>
Fix openhab#3743 Signed-off-by: Laurent Garnier <[email protected]>
Fix #3743 Signed-off-by: Laurent Garnier <[email protected]>
It is not possible to import the
org.openhab.core.util
namespace with the DSL rule engine.Each time this rule is called, the following error is generated:
The text was updated successfully, but these errors were encountered: