Malli schemas for declarative workflow state machines.
A workflow defines:
A workflow instance tracks:
Malli schemas for declarative workflow state machines. A workflow defines: - A set of named states - Transitions between states, with optional guards and permissions - Side effects triggered on transition A workflow instance tracks: - Which entity (type + id) is being managed - The current state of that entity - Metadata for guard / context evaluation
An immutable record of a single workflow transition.
An immutable record of a single workflow transition.
(explain-workflow-definition def)Returns human-readable validation errors for a WorkflowDefinition.
Returns human-readable validation errors for a WorkflowDefinition.
Optional display metadata for a workflow state.
Optional display metadata for a workflow state.
A single transition within a workflow definition.
A single transition within a workflow definition.
Request to perform a workflow transition.
Request to perform a workflow transition.
Result after performing a transition.
Result after performing a transition.
(valid-audit-entry? entry)Returns true when the given map is a valid AuditEntry.
Returns true when the given map is a valid AuditEntry.
(valid-workflow-definition? def)Returns true when the given map is a valid WorkflowDefinition.
Returns true when the given map is a valid WorkflowDefinition.
(valid-workflow-instance? instance)Returns true when the given map is a valid WorkflowInstance.
Returns true when the given map is a valid WorkflowInstance.
A complete workflow definition.
Example: {:id :order-workflow :initial-state :pending :states #{:pending :paid :shipped :delivered :cancelled} :state-config {:pending {:label "Pending" :color :yellow} :paid {:label "Paid" :color :green}} :transitions [{:from :pending :to :paid :label "Mark as Paid" :required-permissions [:finance :admin]} {:from :paid :to :shipped} {:from :shipped :to :delivered :auto? true :guard :tracking-delivered?} {:from :pending :to :cancelled}] :hooks {:on-enter-paid [create-invoice-fn] :on-any-transition [log-audit-fn]}}
A complete workflow definition.
Example:
{:id :order-workflow
:initial-state :pending
:states #{:pending :paid :shipped :delivered :cancelled}
:state-config {:pending {:label "Pending" :color :yellow}
:paid {:label "Paid" :color :green}}
:transitions [{:from :pending :to :paid :label "Mark as Paid"
:required-permissions [:finance :admin]}
{:from :paid :to :shipped}
{:from :shipped :to :delivered :auto? true :guard :tracking-delivered?}
{:from :pending :to :cancelled}]
:hooks {:on-enter-paid [create-invoice-fn]
:on-any-transition [log-audit-fn]}}A running instance of a workflow, associated with a domain entity.
A running instance of a workflow, associated with a domain entity.
Input to create a new workflow instance.
Input to create a new workflow instance.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |