Lambda for functions expressions in Openhab 2

I am using functions implemented via lambda expression as explained under https://github.com/openhab/openhab/wiki/Reusable-Rules-via-Functions

In OPENHAB 2 I am receiving the following error

2015-10-11 05:28:48.530 [ERROR] [.e.s.c.s.ScriptExecutionThread] - Error during the execution of rule ‘absolute Feuchte Keller 1’: The name ‘.state’ cannot be resolved to an item or type.

Questions: Is this language ability supported by OPENHAB 2?

Did you pass in the item as a parameter or are you trying to access it directly by name as you would in a rule?

Hi Daniel

the lambda looks like this
val org.eclipse.xtext.xbase.lib.Functions$Function6 Feuchte = [
org.openhab.core.library.items.NumberItem Temp_room,
org.openhab.core.library.items.NumberItem Humidity_absolute_room,
org.openhab.core.library.items.NumberItem DEWpoint_absolute_room,
org.openhab.core.library.items.StringItem Luft_warn_txt_room,
org.openhab.core.library.items.SwitchItem Luft_warn_room,
Boolean Window_room
|

if (Delayed_Start.state == ON) {
var Number afau = Humidity_absolute.state as DecimalType
var Number tin = Temp_room.state as DecimalType
var Number afin = Humidity_absolute_room.state as DecimalType
var Number dewpoint = DEWpoint_absolute_room.state as DecimalType
val Number mintin = 16 // Minimal Raumtemperatur
var Number wtin = 0 //
val Number tol_dif = 2 // Min Abstand vom Taupunkt

	// Näherungsformel für Wandtemperatur aus Innentemperatur
	wtin = tin - 2
	
	if ((wtin-tol_dif) < dewpoint){
		if (afau <= (afin - 0.8)){
			   Luft_warn_txt_room.sendCommand("L&uuml;ften")
	    	   Luft_warn_room.sendCommand(ON)
		}
		else {
			Luft_warn_txt_room.sendCommand("L&uuml;ften oder Trocknen")
			Luft_warn_room.sendCommand(ON)
		}
	}
	else {
	        Luft_warn_room.sendCommand(OFF)
	        
	        if (Window_room) {
	        	if ((afau < (afin - 2)) && (tin > mintin))
		        		Luft_warn_txt_room.sendCommand("L&uuml;ften&nbsp;gut")
		        else
		        		Luft_warn_txt_room.sendCommand("OK")
	        }
	        else
		        if ((afau >= (afin - 0.8)) || (tin < mintin))
		        		Luft_warn_txt_room.sendCommand("Fenster&nbsp;schlie&szlig;en")
		        else
		        		Luft_warn_txt_room.sendCommand("weiter&nbsp;L&uuml;ften&nbsp;ok")	
		   }
}

]

calling the function is done by
Feuchte.apply(Temp_cel1,Humidity_absolute_cel1,DEWpoint_absolute_cel1,Luft_warn_cel1_txt,Luft_warn_cel1,(Window_C_1.state==CLOSED))

So I guess I am doing both.
I pass values(items, variables) which are variable as parameter but also use some items with their global name.

Looks like Delayed_Start isn’t being passed in (and lambda functions have no knowledge of anything outside of what is passed in as a parameter unfortunately)

Ok. This seems to be an incompatibility in comparison to openhab 1.
I could pass these parameters but I have read that there is a limit in the numbers of parameters one can pass.

I have changed the function and have everything pass via parameter.
this did not change the error.

How i can use group as parametr?