Transition

works.iterative.workflow.Transition
See theTransition companion object
final case class Transition[R, State, Entity, Command, Event](from: State, on: CommandMatch[Command], applicableWhen: Guard[R, Entity], requires: Guard[R, Entity], requiresPayload: (Entity, Command) => Guard[R, Entity] = ..., outcomes: List[Outcome[State, Entity, Command, Event]], classify: (Entity, Command) => Outcome[State, Entity, Command, Event])

One (from, command) group of a workflow's engine table.

Groups outcomes that share a from state and a CommandMatch. classify is total by construction, so its outcomes are disjoint, exhaustive, and order-free — the footgun-free alternative to N sibling guarded transitions with hopefully-disjoint applicableWhen. classify cannot reject — rejections live entirely in requires/requiresPayload.

Value parameters

applicableWhen

fail ⇒ try next transition ⇒ eventually Unhandled

classify

total selection of one of outcomes given the real (entity, command)

from

the source state

on

the command matcher this transition group applies to

outcomes

the declared, disjoint outcomes this transition group can classify to

requires

fail ⇒ Invalid(message)

requiresPayload

payload-aware requires, evaluated against (entity, command); defaults to always-pass. The one defaulted additive field landed in Phase 2 so Podání (MEDECA-382) never edits a shipped kernel type.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def key: (State, String)

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product