Table of Contents | ||
---|---|---|
|
Each ruleset installed in a pico can endow it with entity variables, which are specific to that pico and that ruleset. Together, the entity variables of all of the rulesets installed in a pico provide the pico with its persistent state.
Until a value is first assigned to an entity variable in a rule postlude, the value of the variable will be null
. There are various techniques which can be used to deal with this issue.
The defaultsTo
operator
The defaultsTo
operator can provide a default value when an entity variable is used in a read-only context. For example, suppose ent:owners
will be a map, but might not have been initialized. This code checks the map for a specific key.
...