An implementation of the W3C SCXML Recommended Spec from 2015-09-01.
Uses an imperative style (internally) to match the pseudocode in the standard for easier translation, verification, and avoidance of subtle differences in implementation.
An implementation of the W3C SCXML Recommended Spec from 2015-09-01. Uses an imperative style (internally) to match the pseudocode in the standard for easier translation, verification, and avoidance of subtle differences in implementation.
(add-ancestor-states-to-enter! {:com.fulcrologic.statecharts/keys [machine]
:as env}
state
ancestor
states-to-enter
states-for-default-entry
default-history-content)
(add-descendant-states-to-enter!
{:com.fulcrologic.statecharts/keys [machine vwmem] :as env}
state
states-to-enter
states-for-default-entry
default-history-content)
(before-event! {:com.fulcrologic.statecharts/keys [machine vwmem] :as env})
Steps that are run before processing the next event.
Steps that are run before processing the next event.
(cancel-active-invocations! {:com.fulcrologic.statecharts/keys [machine]
:as env}
state)
(compute-done-data! {:com.fulcrologic.statecharts/keys [machine vwmem data-model
execution-model]
:as env}
final-state)
(compute-entry-set! {:com.fulcrologic.statecharts/keys [vwmem machine] :as env})
Returns [states-to-enter states-for-default-entry default-history-content].
Returns [states-to-enter states-for-default-entry default-history-content].
(compute-exit-set {:com.fulcrologic.statecharts/keys [machine vwmem] :as env}
transitions)
(condition-match {:com.fulcrologic.statecharts/keys [machine execution-model]
:as env}
element-or-id)
(configuration-problems {:com.fulcrologic.statecharts/keys [machine vwmem]})
Returns a list of problems with the current machine's working-memory configuration (active states), if there are any.
Returns a list of problems with the current machine's working-memory configuration (active states), if there are any.
(enter-states! {:com.fulcrologic.statecharts/keys [machine vwmem] :as env})
Enters states, triggers actions, tracks long-running invocations, and returns updated working memory.
Enters states, triggers actions, tracks long-running invocations, and returns updated working memory.
(execute! {:com.fulcrologic.statecharts/keys [machine] :as env} s)
Run the executable content (immediate children) of s.
Run the executable content (immediate children) of s.
Multimethod. Extensible mechanism for running the content of elements on the state machine. Dispatch by :node-type of the element itself.
Multimethod. Extensible mechanism for running the content of elements on the state machine. Dispatch by :node-type of the element itself.
(execute-transition-content! {:com.fulcrologic.statecharts/keys [vwmem]
:as env})
(exit-interpreter! {:com.fulcrologic.statecharts/keys [machine vwmem] :as env})
(exit-states! {:com.fulcrologic.statecharts/keys [machine vwmem] :as env})
Does all of the processing for exiting states. Returns new working memory.
Does all of the processing for exiting states. Returns new working memory.
(finalize! {:com.fulcrologic.statecharts/keys [machine] :as env}
invocation
event)
Run the finalize executable content for an event from an external invocation.
Run the finalize executable content for an event from an external invocation.
(get-effective-target-states {:com.fulcrologic.statecharts/keys [machine vwmem]
:as env}
t)
(get-transition-domain {:com.fulcrologic.statecharts/keys [machine] :as env} t)
(handle-eventless-transitions!
{:com.fulcrologic.statecharts/keys [vwmem data-model] :as env})
Work through eventless transitions, returning the updated working memory
Work through eventless transitions, returning the updated working memory
(handle-external-invocations!
{:com.fulcrologic.statecharts/keys [machine vwmem event-queue] :as env}
{:keys [invokeid] :as external-event})
(in-final-state? {:com.fulcrologic.statecharts/keys [machine vwmem] :as env}
non-atomic-state)
Returns true if non-atomic-state
is completely done.
Returns true if `non-atomic-state` is completely done.
(in-state-context env-sym state-or-id & body)
Change the env
context to the given state element (you can supply id or element itself). Runs the body
with
the update env, and returns the last expression of the body. env
changes to context
are not visible outside of this block.
Change the `env` context to the given state element (you can supply id or element itself). Runs the `body` with the update env, and returns the last expression of the body. `env` changes to context are not visible outside of this block.
(initialize! {:com.fulcrologic.statecharts/keys [machine vwmem] :as env})
Initializes the state machine and creates an initial working memory for a new machine env. Auto-assigns a unique UUID for session ID.
This function processes the initial transition and returns the updated working memory from env
.
Initializes the state machine and creates an initial working memory for a new machine env. Auto-assigns a unique UUID for session ID. This function processes the initial transition and returns the updated working memory from `env`.
(initialize-data-model! {:com.fulcrologic.statecharts/keys [machine data-model
execution-model]
:as env}
state)
Initialize the data models in volatile working memory wmem
for the given states, if necessary.
Initialize the data models in volatile working memory `wmem` for the given states, if necessary.
(process-event! {:com.fulcrologic.statecharts/keys [data-model vwmem] :as env}
external-event)
Process the given external-event
given a state machine
with the working-memory
as its current status/state.
Returns the new version of working memory which you should save to pass into the next call. Typically this function
is called by an overall processing system instead of directly.
Process the given `external-event` given a state `machine` with the `working-memory` as its current status/state. Returns the new version of working memory which you should save to pass into the next call. Typically this function is called by an overall processing system instead of directly.
(remove-conflicting-transitions {:com.fulcrologic.statecharts/keys [machine]
:as env}
enabled-transitions)
Updates working-mem so that enabled-transitions no longer includes any conflicting ones.
Updates working-mem so that enabled-transitions no longer includes any conflicting ones.
(run-exit-handlers! {:com.fulcrologic.statecharts/keys [machine] :as env} state)
Run the exit handlers of state
.
Run the exit handlers of `state`.
(run-invocations! {:com.fulcrologic.statecharts/keys [machine vwmem] :as env})
(run-many! env nodes)
Run the code associated with the given nodes. Does NOT set context id of the nodes run.
Run the code associated with the given nodes. Does NOT set context id of the nodes run.
(runtime-env env base-wmem)
Set up env
to track live data that is needed during the algorithm.
Set up `env` to track live data that is needed during the algorithm.
(select-eventless-transitions!
{:com.fulcrologic.statecharts/keys [machine vwmem] :as env})
Returns a new version of working memory with ::sc/enabled-transitions populated.
Returns a new version of working memory with ::sc/enabled-transitions populated.
(select-transitions! {:com.fulcrologic.statecharts/keys [machine vwmem] :as env}
event)
Returns a new version of working memory with ::sc/enabled-transitions populated.
Returns a new version of working memory with ::sc/enabled-transitions populated.
(session-id {:com.fulcrologic.statecharts/keys [vwmem] :as env})
Returns the unique session id from an initialized env
.
Returns the unique session id from an initialized `env`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close