call

infix fun call(name: String): SagaStepWithBuilder<C, R>

Defines a saga step with "call 'name' with { ... }" syntax.

This is the preferred alternative to backtick-escaped do keyword.

Example:

first call "reserve-inventory" with { context ->
inventoryService.reserve(context.items)
} otherwise { result ->
inventoryService.release(result.id)
}

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

Defines a saga step with enum-based name: "call StepEnum.STEP with { ... }" syntax.

This provides type-safe step identification using enums instead of strings. The enum instance is preserved and can be retrieved via stepAs<E>() on events.

Example:

enum class OrderSteps { RESERVE, CHARGE, SHIP }

first call OrderSteps.RESERVE with { context ->
inventoryService.reserve(context.items)
}