@InitiatingFlow public class FinalityFlow extends FlowLogic<T>
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 enum 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 class FlowSession
s is required for each non-local participant of the transaction. These participants will receive
the final notarised transaction by calling class 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 annotationclass InitiatingFlow
.
@Deprecated public FinalityFlow(@NotNull SignedTransaction transaction, @NotNull java.util.Set<net.corda.core.identity.Party> extraRecipients, @NotNull ProgressTracker progressTracker)
@Deprecated public FinalityFlow(@NotNull SignedTransaction transaction, @NotNull java.util.Set<net.corda.core.identity.Party> extraRecipients)
@Deprecated public FinalityFlow(@NotNull SignedTransaction transaction)
@Deprecated public FinalityFlow(@NotNull SignedTransaction transaction, @NotNull ProgressTracker progressTracker)
public FinalityFlow(@NotNull SignedTransaction transaction, @NotNull FlowSession firstSession, @NotNull net.corda.core.flows.FlowSession... restSessions)
Notarise the given transaction and broadcast it to the given class FlowSession
s. This list must at least include
all the non-local participants of the transaction. Sessions to non-participants can also be provided.
transaction
- What to commit.class FlowSession
@JvmOverloads public FinalityFlow(@NotNull SignedTransaction transaction, @NotNull java.util.Collection<? extends net.corda.core.flows.FlowSession> sessions, @NotNull ProgressTracker progressTracker)
Notarise the given transaction and broadcast it to all the participants.
transaction
- What to commit.sessions
- A collection of class FlowSession
s for each non-local participant of the transaction. Sessions to non-participants canalso be provided.@JvmOverloads public FinalityFlow(@NotNull SignedTransaction transaction, @NotNull java.util.Collection<? extends net.corda.core.flows.FlowSession> sessions)
Notarise the given transaction and broadcast it to all the participants.
transaction
- What to commit.sessions
- A collection of class FlowSession
s for each non-local participant of the transaction. Sessions to non-participants canalso be provided.@JvmOverloads public FinalityFlow(@NotNull SignedTransaction transaction, @NotNull java.util.Collection<? extends net.corda.core.flows.FlowSession> sessions, @NotNull StatesToRecord statesToRecord, @NotNull ProgressTracker progressTracker)
Notarise the given transaction and broadcast it to all the participants.
transaction
- What to commit.sessions
- A collection of class FlowSession
s for each non-local participant of the transaction. Sessions to non-participants canalso be provided.statesToRecord
- Which states to commit to the vault.@JvmOverloads public FinalityFlow(@NotNull SignedTransaction transaction, @NotNull java.util.Collection<? extends net.corda.core.flows.FlowSession> sessions, @NotNull StatesToRecord statesToRecord)
Notarise the given transaction and broadcast it to all the participants.
transaction
- What to commit.sessions
- A collection of class FlowSession
s for each non-local participant of the transaction. Sessions to non-participants canalso be provided.statesToRecord
- Which states to commit to the vault.@Deprecated public FinalityFlow(@NotNull SignedTransaction transaction, @NotNull java.util.Collection<? extends net.corda.core.flows.FlowSession> sessions, @NotNull java.util.Collection<net.corda.core.identity.Party> oldParticipants, @NotNull ProgressTracker progressTracker)
Notarise the given transaction and broadcast it to all the participants.
transaction
- What to commit.sessions
- A collection of class FlowSession
s for each non-local participant.oldParticipants
- An optional collection of parties for participants who are still using the old API.
You will only need to use this parameter if you have upgraded your CorDapp from the V3 FinalityFlow API but are required to provide backwards compatibility with participants running V3 nodes. If you're writing a new CorDapp then this does not apply and this parameter should be ignored.
@CordaInternal @NotNull public net.corda.core.flows.FinalityFlow.ExtraConstructorArgs getExtraConstructorArgs()
@Suspendable @NotNull public SignedTransaction call()
This is where you fill out your business logic.
@NotNull public SignedTransaction getTransaction()
@NotNull public ProgressTracker getProgressTracker()
Override this to provide a class 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.
Note that this has to return a tracker before the flow is invoked. You can't change your mind half way through.
class ProgressTracker
@JvmStatic @NotNull public static ProgressTracker tracker()