Finality Flow
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.
As of 4.11 a list of observer FlowSession can be specified to indicate sessions with transaction non-participants (e.g. observers). This enables ledger recovery to default these sessions associated StatesToRecord value to StatesToRecord.ALL_VISIBLE.
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.
Constructors
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.
Notarise the given transaction and broadcast it to all the participants.
Notarise the given transaction and broadcast it to all the participants.
Notarise the given transaction and broadcast it to all the participants.
Types
Properties
Specifies the identity to use for this flow. This will be one of the multiple identities that belong to this node. This is the same as calling ourIdentityAndCert.party
.
Specifies the identity, with certificate, to use for this flow. This will be one of the multiple identities that belong to this node.
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.
Returns a wrapped java.util.UUID object that identifies this state machine run (i.e. subflows have the same identifier as their parents).
Provides access to big, heavy classes that may be reconstructed from time to time, e.g. across restarts. It is only available once the flow has started, which means it cannot be accessed in the constructor. Either access this lazily or from inside call.
Functions
This is where you fill out your business logic.
Helper function that throws a KilledFlowException if the current FlowLogic has been killed.
Helper function that throws a KilledFlowException if the current FlowLogic has been killed. The provided message is added to the thrown KilledFlowException.
Flows can call this method to ensure that the active FlowInitiator is authorised for a particular action. This provides fine grained control over application level permissions, when RPC control over starting the flow is insufficient, or the permission is runtime dependent upon the choices made inside long lived flow code. For example some users may have restricted limits on how much cash they can transfer, or whether they can change certain fields. An audit event is always recorded whenever this method is used. If the permission is not granted for the FlowInitiator a FlowException is thrown.
Check that network parameters hash on this transaction is the current hash for the network.
Closes the provided sessions and performs cleanup of any resources tied to these sessions.
Returns a shallow copy of the Quasar stack frames at the time of call to flowStackSnapshot. Use this to inspect what objects would be serialised at the time of call to a suspending action (e.g. send/receive). Note: This logic is only available during tests and is not meant to be used during the production deployment. Therefore the default implementation does nothing.
Returns a FlowInfo object describing the flow otherParty is using. With FlowInfo.flowVersion it provides the necessary information needed for the evolution of flows and enabling backwards compatibility.
Creates a communication session with destination. Subsequently you may send/receive using this session object. How the messaging is routed depends on the Destination type, including whether this call does any initial communication.
Creates a communication session with party. Subsequently you may send/receive using this session object. Note that this function does not communicate in itself, the counter-flow will be kicked off by the first send/receive.
Persists a shallow copy of the Quasar stack frames at the time of call to persistFlowStackSnapshot. Use this to track the monitor evolution of the quasar stack values during the flow execution. The flow stack snapshot is stored in a file located in {baseDir}/flowStackSnapshots/YYYY-MM-DD/{flowId}/ where baseDir is the node running directory and flowId is the flow unique identifier generated by the platform.
Suspends until the specified otherParty sends us a message of type R.
Suspends until the specified otherParty sends us a message of type receiveType.
Suspends until a message has been received for each session in the specified sessions.
Suspends until a message has been received for each session in the specified sessions.
Suspends until a message has been received for each session in the specified sessions.
Queues the given payloads for sending to the provided sessions and continues without suspending.
Serializes and queues the given payload object for sending to the otherParty. Suspends until a response is received, which must be of the given R type.
Serializes and queues the given payload object for sending to the otherParty. Suspends until a response is received, which must be of the given receiveType. Remember that when receiving data from other parties the data should not be trusted until it's been thoroughly verified for consistency and that all expectations are satisfied, as a malicious peer may send you subtly corrupted data in order to exploit your code.
Returns a pair of the current steps tree of current progressTracker as pairs of zero-based depth and stringified step label and observable of upcoming changes to the structure.
Returns a pair of the current progress step index (as integer) in steps tree of current progressTracker, and an observable of its upcoming changes.
Suspends the flow until the transaction with the specified ID is received, successfully verified and sent to the vault for processing. Note that this call suspends until the transaction is considered valid by the local node, but that doesn't imply the vault will consider it relevant.
Suspends the current flow until all the provided StateRefs have been consumed.