toTransactionValue

Wraps a value that is already known, so that it has the type an earlier step's result has.

That is the whole of what it is for: a function, or a variable, that takes either one. Typed as a TransactionValue<Int> rather than an Any?, a helper adding steps for an edict takes the id an insert in the same plan will generate and the id of an edict that is already there alike, and binds whichever it got. A parameter map needs nothing of the kind - anything that is not a TransactionValue is passed through as it is.

fun addSeal(plan: TransactionPlan, edictId: TransactionValue<Int>, sealedBy: String) {
plan.add(
db.insertInto("edict_seals").values(listOf("edict_id", "sealed_by"))
.asStep().executeUpdate("edict_id" to edictId, "sealed_by" to sealedBy)
)
}

addSeal(plan, newEdict.value(), "Augustus") // generated by an insert earlier in the plan
addSeal(plan, existingId.toTransactionValue(), "Tiberius") // already there

Return

The value, as a TransactionValue with nothing left to resolve.