Joel
Joel

Reputation: 23140

In Corda, can you create more than one transaction in a single flow?

All the Corda flows I've seen have only involved the creation, signing and finalisation of a single transaction. Is it possible to create, sign and finalise multiple transactions in a single flow?

Upvotes: 1

Views: 147

Answers (1)

Joel
Joel

Reputation: 23140

Yes. A flow can create zero, one or multiple transactions.

You can even use looping constructs within a flow to create multiple transactions:

while (cash > 0) {
    createCashTransaction(5.DOLLARS)
    cash -= 5.DOLLARS
}

Or use conditional logic to decide whether or not to create a transaction:

if (cash > 0) {
    createCashTransaction(5.DOLLARS)
}

Upvotes: 1

Related Questions