Lambda Reference Problem?

Hello,

I’m trying to simplify my rules with use of a lambda expression:

val org.eclipse.xtext.xbase.lib.Functions$Function1 alarmInnenLogic = [
    org.openhab.core.library.items.ContactItem contactItem|

        logInfo("Homematic", "!!!!! Start EG_Buero_Fenster_1_State REACHABLE" ) // ok

        if (contactItem.state == OPEN){ // Error - "The name '<XFeatureCallImplCustom>.state' cannot be resolved to an item or type"
                logInfo("Homematic", "!!!!!!!!!!!! EG_Buero_Fenster_1_State OPEN" )
                sendCommand(Sirene_Innen_1_State, ON)
        } else {
                logInfo("Homematic", "!!!!!!!!!!!! EG_Buero_Fenster_1_State CLOSED" )
                sendCommand(Sirene_Innen_1_State, OFF)
        }

]

rule "Alarm einschalten per Logic"
when Item EG_Buero_Fenster_1_State received update
then
  logInfo("Homematic","!!!!" + EG_Buero_Fenster_1_State.state)
  alarmInnenLogic.apply(EG_Buero_Fenster_1_State)
end

Unfortunatly I always get the following error message:

2016-12-25 15:23:54.575 [INFO ] [pse.smarthome.model.script.Homematic] - !!!!CLOSED
2016-12-25 15:23:54.587 [INFO ] [pse.smarthome.model.script.Homematic] - !!!!! Start EG_Buero_Fenster_1_State REACHABLE
2016-12-25 15:23:54.603 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'Alarm einschalten per Logic': The name '<XFeatureCallImplCustom>.state' cannot be resolved to an item or type.

It seems to me that outside of the lambda expressin everything ist ok, but when the code reaches the lambda expression ‘state’ is somehow incorrect …

Any Ideas what am I doing wrong?

Thanks in advance and merry christmas!

Best Regards,

Muetze303

Ok, the Probelm was a wrong Package Name.

It has to be

org.eclipse.smarthome.core.library.items.ContactItem

instead of

org.openhab.core.library.items.ContactItem