Startup Issue


I have a minor issue on startup of 2.2. I get some strange log messages from some rules…

2018-01-22 18:13:05.396 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Error during the execution of startup rule ‘Populate Functional Groups’: ‘endsWith’ is not a member of ‘java.lang.String’; line 20, column 31, length 30

The rule then get’s processed correctly later on. Here’s the whole rule

rule "Populate Functional Groups"
                System started or
		Item sRepopulate_Groups changed from OFF to ON
                logInfo("Rules","Populating functional groups")
                gRoot.allMembers.filter(s |"Battery")).forEach[ item | fgBatteries.addMember(item)]
		gRoot.allMembers.filter(s |"DOOR_Sensor")).forEach[ item | fgDoors.addMember(item)]
		gRoot.allMembers.filter(s |"WINDOW_Sensor")).forEach[ item | fgWindows.addMember(item)]		
		gRoot.allMembers.filter(s |"Network")).forEach[ item | fgNetDevices.addMember(item)]

Any reason why this would happen?

Yes, the rule is triggered before the system is initialized completely. You should add some timer to delay your rule.

You may have a look here, if you don’t need the complete stuff, this is at least an example to delay startup.