corda / net.corda.core.flows / FinalityFlow

FinalityFlow

@InitiatingFlow class FinalityFlow : FlowLogic<SignedTransaction>

Verifies the given transaction, then sends it to the named notary. If the notary agrees that the transaction is acceptable then it is from that point onwards committed to the ledger, and will be written through to the vault. Additionally it will be distributed to the parties reflected in the participants list of the states.

By default, the initiating flow will commit states that are relevant to the initiating party as indicated by StatesToRecord.ONLY_RELEVANT. Relevance is determined by the union of all participants to states which have been included in the transaction. This default behaviour may be modified by passing in an alternate value for StatesToRecord.

The transaction is expected to have already been resolved: if its dependencies are not available in local storage, verification will fail. It must have signatures from all necessary parties other than the notary.

A list of FlowSessions is required for each non-local participant of the transaction. These participants will receive the final notarised transaction by calling ReceiveFinalityFlow in their counterpart flows. Sessions with non-participants can also be included, but they must specify StatesToRecord.ALL_VISIBLE for statesToRecord if they wish to record the contract states into their vaults.

The flow returns the same transaction but with the additional signatures from the notary.

NOTE: This is an inlined flow but for backwards compatibility is annotated with InitiatingFlow.

Types

BROADCASTING

object BROADCASTING : Step

ExtraConstructorArgs

data class ExtraConstructorArgs

NOTARISING

object NOTARISING : Step

Constructors

<init>

FinalityFlow(transaction: SignedTransaction, extraRecipients: Set<Party>, progressTracker: ProgressTracker)
FinalityFlow(transaction: SignedTransaction, extraRecipients: Set<Party>)
FinalityFlow(transaction: SignedTransaction)
FinalityFlow(transaction: SignedTransaction, progressTracker: ProgressTracker)

Notarise the given transaction and broadcast it to the given FlowSessions. This list must at least include all the non-local participants of the transaction. Sessions to non-participants can also be provided.

FinalityFlow(transaction: SignedTransaction, firstSession: FlowSession, vararg restSessions: FlowSession)

Notarise the given transaction and broadcast it to all the participants.

FinalityFlow(transaction: SignedTransaction, sessions: Collection<FlowSession>, progressTracker: ProgressTracker = tracker())
FinalityFlow(transaction: SignedTransaction, sessions: Collection<FlowSession>, statesToRecord: StatesToRecord, progressTracker: ProgressTracker = tracker())
FinalityFlow(transaction: SignedTransaction, sessions: Collection<FlowSession>, oldParticipants: Collection<Party>, progressTracker: ProgressTracker)

Properties

progressTracker

Override this to provide a ProgressTracker. If one is provided and stepped, the framework will do something helpful with the progress reports e.g record to the audit service. If this flow is invoked as a subflow of another, then the tracker will be made a child of the current step in the parent. If it's null, this flow doesn't track progress.

val progressTracker: ProgressTracker

transaction

val transaction: SignedTransaction

Functions

call

This is where you fill out your business logic.

fun call(): SignedTransaction

getExtraConstructorArgs

fun getExtraConstructorArgs(): ExtraConstructorArgs

Companion Object Functions

tracker

fun tracker(): ProgressTracker

Extension Functions

receiveAll

Suspends until a message has been received for each session in the specified sessions.

fun FlowLogic<*>.receiveAll(session: Pair<FlowSession, Class<out Any>>, vararg sessions: Pair<FlowSession, Class<out Any>>): Map<FlowSession, UntrustworthyData<Any>>
fun <R : Any> FlowLogic<*>.receiveAll(receiveType: Class<R>, session: FlowSession, vararg sessions: FlowSession): List<UntrustworthyData<R>>
fun <R : Any> FlowLogic<*>.receiveAll(session: FlowSession, vararg sessions: FlowSession): List<UntrustworthyData<R>>