call

Defines the next saga step with "then call 'name' with { ... }" syntax.

Example:

then call "capture-escrow" with { cart ->
cashManager.captureEscrow()
updateState { it.copy(escrowCaptured = true) }
result!!
} otherwise {
cashManager.dispenseCashRefund(state.paymentAmount)
}

infix inline fun <E : Enum<E>> call(step: E): StatefulSagaStepWithBuilder<C, R, S>

Defines the next saga step with enum-based name: "then call StepEnum.STEP with { ... }" syntax. The enum instance is preserved and can be retrieved via stepAs<E>() on events.

Example:

then call OrderSteps.PAYMENT with { cart ->
completes with processPayment(cart)
} otherwise {
refund(state.paymentId)
}