rule "Initialize on System start"
when
System started
then
HashMap<String,String> myMap = new HashMap
end
the Log Message “Error during the execution of startup rule ‘Initialize on System start’ : null” comes after saving the rule. But why? Can’t I initialize a Map on System start?
I’m surprised you are not selling syntax errors. You are missing the val. Also, defining it is a System started rule doesn’t do much for you as any variable defined in a Rule goes away as soon as the Rule exits.
You need to define it as a global if you want to use it across multiple Rules.