WorkflowAction
An atomic operation that updates the state of a Workflow, and also optionally emits an output.
A WorkflowAction's apply method is executed in the context of an Updater, which provides access to the current props and state, along with a setOutput function. The state can be updated with a new StateT instance that will become the current one after the apply function finishes.
It is possible for one WorkflowAction to delegate to another, although the API is a bit opaque:
val actionA = action {
}
val actionB = action {
val (newState, outputApplied) = actionA.applyTo(props, state)
state = newState
outputApplied.output?.value?.let { setOutput(it) }
}
Content copied to clipboard
Types
Link copied to clipboard
The context for calls to WorkflowAction.apply. Allows the action to read and change the state, and to emit an output value.