Liking cljdoc? Tell your friends :D

com.fulcrologic.statecharts.chart

Main mechanism to define and navigate a statechart definition. The processing algorithm for such a statechart is protocol-based. The v20150901 implementation is the default.

::sc/k in the docstrings of this namespace assumes the alias [com.fulcrologic.statecharts :as sc], which can be generated as only an alias, though an empty namespace of that name does exist.

Main mechanism to define and navigate a statechart definition. The processing algorithm for such
a statechart is protocol-based. The v20150901 implementation is the default.

::sc/k in the docstrings of this namespace assumes the alias `[com.fulcrologic.statecharts :as sc]`, which
can be generated as only an alias, though an empty namespace of that name does exist.
raw docstring

all-descendantsclj/s

(all-descendants chart s)

Returns a set of IDs of the (recursive) descendants (children) of s

Returns a set of IDs of the (recursive) descendants (children) of s
sourceraw docstring

assign-parentsclj/s

(assign-parents {parent-id :id initial :initial :as parent} nodes)
source

atomic-state?clj/s

(atomic-state? chart element-or-id)
source

child-statesclj/s

(child-states chart element-or-id)

Find all of the immediate children (IDs) of element-or-id that are states (final, element-or-id, or parallel)

Find all of the immediate children (IDs) of `element-or-id` that are states
(final, element-or-id, or parallel)
sourceraw docstring

compound-state?clj/s

(compound-state? chart element-or-id)

Returns true if the given state contains other states.

Returns true if the given state contains other states.
sourceraw docstring

condition-node?clj/s

(condition-node? chart element-or-id)

Returns true if the given element is ALL of:

  • An atomic state
  • Has more than one transition
  • NONE of the transitions require an event
Returns true if the given element is ALL of:

* An atomic state
* Has more than one transition
* NONE of the transitions require an event
sourceraw docstring

descendant?clj/s

(descendant? chart s1 s2)
source

elementclj/s

(element chart element-or-id)

Find the node in the chart that has the given ID (of any type)

Find the node in the chart that has the given ID (of any type)
sourceraw docstring

element-idclj/s

(element-id chart element-or-id)
source

entry-handlersclj/s

(entry-handlers chart element-or-id)
source

exit-handlersclj/s

(exit-handlers chart element-or-id)

Returns the immediate child elements that are on-exit.

Returns the immediate child elements that are on-exit.
sourceraw docstring

final-state?clj/s

(final-state? chart element-or-id)
source

find-least-common-compound-ancestorclj/s

(find-least-common-compound-ancestor chart states)

Returns the ELEMENT that is the common compound ancestor of all the states. NOTE: This may be the state chart itself. The compound state returned will be the one closest to all of the states.

Returns the ELEMENT that is the common compound ancestor of all the `states`. NOTE: This may be
the state chart itself. The compound state returned will be the one closest to all of the states.
sourceraw docstring

get-childrenclj/s

(get-children chart element-or-id type)

Returns the ID of the child nodes of the given element-or-id which have the given type.

Returns the ID of the child nodes of the given `element-or-id` which
have the given type.
sourceraw docstring

get-parentclj/s

(get-parent chart element-or-id)

Get the immediate parent (id) of the given element-or-id. Returns :ROOT if the parent is the root, and nil if the element queried is already the root.

Get the immediate parent (id) of the given element-or-id. Returns :ROOT if the parent is the root,
and nil if the element queried is already the root.
sourceraw docstring

get-parent-stateclj/s

[chart element-or-id]

Alias for nearest-ancestor-state.

[chart element-or-id]

Alias for `nearest-ancestor-state`.
sourceraw docstring

get-proper-ancestorsclj/s

(get-proper-ancestors chart element-or-id)
(get-proper-ancestors chart element-or-id stopping-element-or-id)

Returns the node ids from chart that are proper ancestors of element-or-id (an id or actual element-or-id). If stopping-element-or-id-or-id is included, then that will stop the retrieval (not including the stopping element-or-id). The results are in the ancestry order (i.e. deepest element-or-id first).

Returns the node ids from `chart` that are proper ancestors of `element-or-id` (an id or actual element-or-id). If `stopping-element-or-id-or-id`
is included, then that will stop the retrieval (not including the stopping element-or-id). The results are
in the ancestry order (i.e. deepest element-or-id first).
sourceraw docstring

history-element?clj/s

(history-element? chart element-or-id)
source

history-elementsclj/s

(history-elements chart element-or-id)
source

ids-in-document-orderclj/s

(ids-in-document-order chart)
(ids-in-document-order
  {desired-order :com.fulcrologic.statecharts/document-order :as chart}
  {:keys [id] :as node})

Returns the IDs of the states in the given node, in document order (not including the node itself). You can specify ::sc/document-order :breadth-first on the top-level chart definition to get a depth-first interpretation vs. breadth.

Returns the IDs of the states in the given node, in document order (not including the node itself).
You can specify `::sc/document-order :breadth-first` on the top-level chart definition to get a
depth-first interpretation vs. breadth.
sourceraw docstring

in-document-orderclj/s

(in-document-order chart nodes-or-ids)

Given a set/sequence of actual nodes-or-ids (as maps), returns a vector of those nodes-or-ids, but in document order.

Given a set/sequence of actual nodes-or-ids (as maps), returns a vector of those nodes-or-ids, but in document order.
sourceraw docstring

in-entry-orderclj/s

[chart nodes]

Same as in-document-order.

[chart nodes]

Same as in-document-order.
sourceraw docstring

in-exit-orderclj/s

(in-exit-order chart nodes)

The reverse of in-document-order.

The reverse of in-document-order.
sourceraw docstring

initial-elementclj/s

(initial-element chart element-or-id)

Returns the element that represents the <initial> element of a compound state element-or-id. Returns nil if the element isn't a compound state.

Returns the element that represents the <initial> element of a compound state element-or-id.
Returns nil if the element isn't a compound state.
sourceraw docstring

initial?clj/s

(initial? chart element-or-id)
source

invalid-history-elementsclj/s

(invalid-history-elements chart)

Returns a sequence of history elements from chart that have errors. Each node will contain a :msgs key with the problem descriptions. This is a static check.

Returns a sequence of history elements from `chart` that have errors. Each node will contain a `:msgs` key
with the problem descriptions. This is a static check.
sourceraw docstring

invocationsclj/s

(invocations chart element-or-id)

Returns the IDs of the nodes that are invocations within element-or-id

Returns the IDs of the nodes that are invocations within `element-or-id`
sourceraw docstring

nearest-ancestor-stateclj/s

(nearest-ancestor-state chart element-or-id)

Returns the ID of the state (if any) that encloses the given element-or-id, or nil if there is no ancestor state.

Returns the ID of the state (if any) that encloses the given element-or-id, or nil if there is no
ancestor state.
sourceraw docstring

parallel-state?clj/s

(parallel-state? chart element-or-id)
source

scxmlclj/s

See chart. SCXML-compliant name for top-level element.

See `chart`. SCXML-compliant name for top-level element.
sourceraw docstring

sourceclj/s

[chart element-or-id] Returns the source (nearest ancestor that is a state element) of an element (meant to be used for transitions).

[chart element-or-id]
Returns the source (nearest ancestor that is a state element) of an element (meant to be used for transitions).
sourceraw docstring

state?clj/s

(state? chart element-or-id)
source

statechartclj/s

(statechart {:keys [initial name binding] :as attrs} & children)

Create a new state chart definition that mimics the structure and semantics of SCXML.

Attributes:

::sc/document-order - :breadth-first or :depth-first (default). See Conformance.adoc. :initial - ID(s) of initial state(s) of the chart. Default is the top-most initial element, or the first element in document order. :name - Optional name :binding - :late or :early (default is :early)

Create a new state chart definition that mimics the structure and semantics of SCXML.

Attributes:

::sc/document-order - :breadth-first or :depth-first (default). See Conformance.adoc.
:initial - ID(s) of initial state(s) of the chart. Default is the top-most `initial` element,
           or the first element in document order.
:name - Optional name
:binding - :late or :early (default is :early)
sourceraw docstring

transition-elementclj/s

(transition-element chart element-or-id)

Returns the element that represents the first transition of element-or-id. This should only be used on nodes that have a single required transition, such as <initial> and <history> nodes.

Returns the element that represents the first transition of element-or-id.
This should only be used on nodes that have a single required transition, such as
<initial> and <history> nodes.
sourceraw docstring

transitionsclj/s

(transitions chart element-or-id)
source

with-default-initial-stateclj/s

(with-default-initial-state {:keys [id initial] :as parent} children)

Scans children for an initial state. If no such state is found then it creates one and sets the target to the first child that is a state.

Scans children for an initial state. If no such state is found then it creates one and sets the target to the
first child that is a state.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close