openhab-core icon indicating copy to clipboard operation
openhab-core copied to clipboard

[transformations] transformRaw() action gives validation errors.

Open Rossko57 opened this issue 3 years ago • 2 comments

openHAB 2.5.0 Use of var blah = transformRaw("xx","yy","zz") in DSL rules throws a validation error at load time in openhab.log

2020-09-13 22:47:41.089 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'doors.rules', using it anyway: The method transformRaw(String, String, String) from the type Transformation refers to the missing type Object

The function does seem to work as expected at runtime.

VSCode syntax highlighter doesn't like it either, but I expect that comes from the same root cause.

Rossko57 avatar Sep 13 '20 22:09 Rossko57

I have also found this validation error, in 3.1.0.M3. However, I also have the problem that, contrary to the docs, the exception isn't being thrown - I still get a warning in the logs and the catch block is never run.

microneer avatar Jun 21 '21 08:06 microneer

The reason is that transformRaw throws TransformationException and that is unavailable in rules. Because of that the try-catch is also not working if it catches TransformationException but works if it catches Exception.

That might be related to a name-clash between org.openhab.core.transform.TransformationException and org.eclipse.xtext.xtext.ecoreInference.TransformationException. Did this ever work?

J-N-K avatar May 12 '22 19:05 J-N-K