An entity is a part of the model living in the state
with its lifecycle managed.
An entity is a part of the model living in the `state` with its lifecycle managed. * ![entity](archi/entity/entity.png) * ![entity state](archi/entity/entity_state.png) * ![lifestatus](archi/entity/lifestatus.png)
(create state date entity-name entity-data)
Creates an entity called :entity-name
with entity-data
. The lifecycle of this entity starts at date
.
An error is documented if the entity is created already.
Creates an entity called `:entity-name` with `entity-data`. The lifecycle of this entity starts at `date`. An error is documented if the entity is created already.
(dispose state date entity-name)
Disposing an entity by its entity-name
is removing its data, its lifecycle will mark ::disposed
at the current date
.
Disposing an entity by its `entity-name` is removing its data, its lifecycle will mark `::disposed` at the current `date`.
(error? {:automaton-simulation-de.entity/keys [entities] :as _state})
Detects an eror in the entities.
Detects an eror in the entities.
(errors state)
(errors state entity-name)
Returns entity errors if exists with a map associating a collection of errors to an entity-name
Returns entity errors if exists with a map associating a collection of errors to an `entity-name`
(is-created? state entity-name)
Is the entity called :entity-name
living?
Is the entity called `:entity-name` living?
(is-disposed? state entity-name)
Is the entity called :entity-name
disposed?
Is the entity called `:entity-name` disposed?
(is-living? state entity-name)
Is the entity called :entity-name
living?
Is the entity called `:entity-name` living?
(lifecycle-corrupted {:automaton-simulation-de.simulation-engine/keys [state]
:as _snapshot}
_params)
Detects if one entity has a lifecycle error.
Detects if one entity has a lifecycle error.
(lifecycle-status state entity-name)
The lifecycle has three possible fields ::created
, ::living
or :disposed
depending on the position of the entity in its lifecycle.
The lifecycle has three possible fields `::created`, `::living` or `:disposed` depending on the position of the entity in its lifecycle.
(state state entity-name)
Returns the state value of the entity called entity-name
.
Returns the state value of the entity called `entity-name`.
(stopping-definition)
(update state date entity-name f & args)
Update the entity called :entity-name
with f
applied to the existing value together with arguments args
.
The update of the entity is mark in the living
lifecycle field.
Update the entity called `:entity-name` with `f` applied to the existing value together with arguments `args`. The update of the entity is mark in the `living` lifecycle field.
(wrap-model model)
Wraps a model to add necessary behavior to model an entity.
Wraps a model to add necessary behavior to model an entity.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close