Here is the beginning of my rules file:
import org.openhab.core.library.types.*
import org.openhab.model.script.actions.*
import org.joda.time.*
import java.util.regex.Matcher
import java.util.regex.Pattern
var DateTime lastDesarmTime = now.minusDays(1)
var boolean regulVeranda = false
var boolean lancementSonos = false
var boolean initMinimoteCourt = true
var boolean initMinimoteLong = true
val Pattern patternVoice1 = Pattern::compile("(donner|allumer|éteindre|passer en hors gel|passer en mode confort|passer en mode réduit|lecture|stop lecture|remettre le son|couper le son) (le |la |les |l'|du )(.*) (du |de la |de l'|dans le |dans la |dans l')(.*)")
val Pattern pattern2 = Pattern::compile("x-sonosapi-stream:s(\\d+?)\\?.+")
val Pattern pattern3 = Pattern::compile("x-rincon:.+")
When starting OH 2 (beta 2), here are the errors I get:
2016-02-04 23:42:59.240 [WARN ] [me.internal.engine.RuleContextHelper] - Variable 'lastDesarmTime' on rule file 'maisonOH2.rules' cannot be initialized with value '<XFeatureCallImplCustom>.minusDays(<XNumberLiteralImpl>)': An error occured during the script execution: The name '<XFeatureCallImplCustom>.minusDays(<XNumberLiteralImpl>)' cannot be resolved to an item or type.
2016-02-04 23:42:59.257 [WARN ] [me.internal.engine.RuleContextHelper] - Variable 'patternVoice1' on rule file 'maisonOH2.rules' cannot be initialized with value '<XFeatureCallImplCustom>::compile(<XStringLiteralImpl>)': An error occured during the script execution: The name 'Pattern' cannot be resolved to an item or type.
2016-02-04 23:42:59.262 [WARN ] [me.internal.engine.RuleContextHelper] - Variable 'pattern2' on rule file 'maisonOH2.rules' cannot be initialized with value '<XFeatureCallImplCustom>::compile(<XStringLiteralImpl>)': An error occured during the script execution: The name 'Pattern' cannot be resolved to an item or type.
2016-02-04 23:42:59.267 [WARN ] [me.internal.engine.RuleContextHelper] - Variable 'pattern3' on rule file 'maisonOH2.rules' cannot be initialized with value '<XFeatureCallImplCustom>::compile(<XStringLiteralImpl>)': An error occured during the script execution: The name 'Pattern' cannot be resolved to an item or type.
Any idea ?
Of course, it does not happen in OH 1.8.