[SOLVED] Moving to openHab 2: Rules / After changing Unitialized to NULL / "Couldn't resolve reference to JvmIdentifiableElement 'NULL'."

Hi!

I try to move from openhab 1 to 2 and get a lot of errors in the new designer. After I changed Unitialized to NULL I get the following error: Couldn’t resolve reference to JvmIdentifiableElement ‘NULL’.

What should I do?

	if (Lodge_Temperature_Setpoint == NULL) {
	Lodge_Temperature_Setpoint.postUpdate(comfortTemperature)
}

Thanks in advance!
HFM

@m0wlheld: Yes, you are right. Thank you very much!

@Kai: I think you should change it here to clarify things: https://github.com/openhab/openhab-distro/blob/master/docs/sources/migration.md (see Rules)

No, having it upper case actually IS correct, because we do not talk about the Java “null” here, but about the defined state NULL - which should be available just like the other states defined here.

Anyhow I doubt that your rule ever worked as expected, because correctly it should be

if (Lodge_Temperature_Setpoint.state == NULL) {

Do you get the error within the Designer or when the runtime executes the rule?

Hey Kai,

you are right. NULL is the right way. And you right with this rule because the state was missing. I copied the only wrong rule. :slight_smile:

For showing a better example I attached a screenshot from the designer.

I have a lot of rules marked in the designer. But obviously they do not throw errors in the log file. So, I should ignore them?

I have two other topics related to errors in the designer:


I think this is the same problem. Only the designer shows errors. Should I delete them?

I assume you are using Designer version 0.7.0 - this was BEFORE Undefined has been renamed to NULL.
With a recent 0.8.0-SNAPSHOT build, NULL is correctly resolved and does not show any errors.

For other open/known issues please also check https://github.com/eclipse/smarthome/issues?q=is%3Aopen+is%3Aissue+label%3ADesigner.
Especially it is a known problem that actions are marked as an error - if all works smoothly at runtime, my suggestion is indeed to simply ignore those errors for the moment…

Yes, I did. I try the snapshot and will report soon. :slight_smile: