OH2 lambda rule item state problem

Dear all,

I’m currently trying to check Contact item states in a lambda rule for updating my window and door status. However, when evaluating the state of an item, I always get the error:
14:48:05.565 [ERROR] [.script.engine.ScriptExecutionThread] - Error during the execution of rule ‘FensterKellerTiefgarage Status’: The name ‘.state’ cannot be resolved to an item or type.

My lambda rule:

val org.eclipse.xtext.xbase.lib.Functions$Function4 fTuerFensterStatus = [
	org.openhab.core.library.items.NumberItem status,
	org.openhab.core.library.items.ContactItem gekippt,
	org.openhab.core.library.items.ContactItem geoeffnet,
	org.openhab.core.library.items.ContactItem abgeschlossen |

	var value = 99;

	if (gekippt.state ==  NULL)
	{
/*
		if (geoeffnet.state==NULL)
		{
			// keine Kontakte
			if (abgeschlossen.state==NULL)
			{
			}
			// nur Riegelkontakt
			else
			{
				if (abgeschlossen.state==CLOSED) {value=0}
				else if (abgeschlossen.state==OPEN) {value=4}
			}
		}
		else
		{
			// nur Öffnungskontakt
			if (abgeschlossen.state==NULL)
			{
				if (geoeffnet.state==CLOSED) {value=0}
				else if (geoeffnet.state==OPEN) {value=2}
			}
			// Öffnungskontakt + Riegelkontakt
			else
			{
				if (geoeffnet.state==CLOSED && abgeschlossen.state==CLOSED) {value=0}
				else if (geoeffnet.state==OPEN && abgeschlossen.state==CLOSED) {value=2}
				else if (geoeffnet.state==CLOSED && abgeschlossen.state==OPEN) {value=4}
			}
		}
	else
	{
		if (geoeffnet.state==NULL)
		{
			// nur Kippkontakt
			if (abgeschlossen.state==NULL)
			{
				if (gekippt.state==CLOSED) {value=0}
				else if (gekippt.state==OPEN) {value=1}
			}
			// Kippkontakt und Riegelkontakt
			else
			{
				if (gekippt.state==CLOSED && abgeschlossen.state==CLOSED) {value=0}
				else if (gekippt.state==OPEN && abgeschlossen.state==CLOSED) {value=1}
				else if (gekippt.state==CLOSED && abgeschlossen.state==OPEN) {value=4}
			}
		}
		else
		{
			// Kippkontakt + Öffnungskontakt
			if (abgeschlossen.state==NULL)
			{
				if (gekippt.state==CLOSED && geoeffnet.state==CLOSED) {value=0}
				else if (gekippt.state==OPEN && geoeffnet.state==CLOSED) {value=1}
				else if (gekippt.state==OPEN && geoeffnet.state==OPEN) {value=2}
			}
			// Kippkontakt + Öffnungskontakt + Riegelkontakt
			else
			{
				if (gekippt.state==CLOSED && geoeffnet.state==CLOSED && abgeschlossen.state==CLOSED) {value=0}
				else if (gekippt.state==OPEN && geoeffnet.state==CLOSED && abgeschlossen.state==CLOSED) {value=1}
				else if (gekippt.state==OPEN && geoeffnet.state==OPEN && abgeschlossen.state==CLOSED) {value=2}
				else if (gekippt.state==CLOSED && geoeffnet.state==CLOSED && abgeschlossen.state==OPEN) {value=4}
			}
		}
*/
	}
	postUpdate(status,value)
]

The error already pops up with the first IF statement (the rest is commented for this purpose). Checking the state for OPEN or CLOSE instead of NULL leads to the same error.

The lambda rule is called by passing the items (first is type Number, others are Contact):

fTuerFensterStatus.apply(FensterKellerTiefgarage,FensterKellerTiefgarageGekippt,FensterKellerTiefgarageGeoeffnet,NULL)

Evaluating the state in a standard rule works without any issues.

I’m running OpenHAB 2.0 beta3. Searching the web for this specific issue was not successful up to now. I would be very glad for any useful hint.

EDIT: I already tried explicit casts to NumberType and OpenClosedType as suggested in https://github.com/openhab/openhab2-addons/issues/422 , but without success (same error).

Thanks a lot in advance!
Christian