call

suspend fun <C : Any> SagaContext.call(command: C, aggregateId: String? = null, block: CommandRequest.Builder<C>.() -> Unit = {}): CommandResult

Calls command on the aggregate aggregateId names (none for a creation), with the fields block sets: SagaContext.call of command's toCommandRequest, context.call(SubmitOrder(items)).


suspend fun <C : Any> SagaContext.call(command: C, to: AggregateRef, block: CommandRequest.Builder<C>.() -> Unit = {}): CommandResult

Calls command on the aggregate the ref to names, with the fields block sets: SagaContext.call of command's toCommandRequest of a ref, context.call(Restock(sku), to = rejected.source).