each
Registers a SagaInterceptor for before.each(step) { … } usage.
Usage
before.each(step) { phase ->
if (!phase.context.authorized) halt because "not authorized"
}The step argument is the step sentinel — it is not a step name. The trailing lambda is the interceptor block with HaltScope as receiver, receiving the StepPhase.Before phase as its argument.
Calling halt because "reason" inside the block throws InterceptorHalt, which the executor catches and converts to InterceptorOutcome.Veto. Falling off the end of the block implies InterceptorOutcome.Continue.
Registers a SagaInterceptor for after.each(step) { … } usage.
Usage
after.each(step) { result ->
auditLog.record(step.stringValue, result)
}The step argument is the step sentinel — it is not a step name. The trailing lambda receives the step result as its argument and has AfterEachScope as receiver, which exposes the step name (as a ca.acendas.kstate.saga.TypedValue) and a no-op halt for syntax compatibility.
halt because "…" inside an after-phase block is a no-op that emits a warning — the step has already completed and cannot be vetoed.