updateState

fun updateState(key: String, value: Any)

Records a state change in actions stateDelta (copy-on-write) so it appears in state and flushes on the next event. State.TEMP_PREFIX keys are never stored. Under a node's state schema, a key without a colon must be declared and its value must fit and have a JSON form with finite numbers, unless the value is State.REMOVED; the checked value is stored in the JSON form a reloaded session reads back, and a typed credential stays typed.

Throws

under a state schema, if key is not declared, or value does not fit, has no JSON form or holds a non-finite number.