S
- the input contract state type
T
- the output contract state type, this can be different from S. For example, in contract upgrade, the output state type can be different from the input state type after the upgrade process.
M
- the type of a class representing proposed modification by the instigator.
public static class AbstractStateReplacementFlow.Instigator<S extends ContractState,T extends ContractState,M> extends FlowLogic<T>
The class AbstractStateReplacementFlow.Instigator
assembles the transaction for state replacement and sends out change proposals to all participants
(class AbstractStateReplacementFlow.Acceptor
) of that state. If participants agree to the proposed change, they each sign the transaction.
Finally, class AbstractStateReplacementFlow.Instigator
sends the transaction containing all participants' signatures to the notary for signature, and
then back to each participant so they can record it and use the new updated state for future transactions.
public static net.corda.core.flows.AbstractStateReplacementFlow.Instigator.Companion Companion
public Instigator(@NotNull StateAndRef<? extends S> originalState, M modification, @NotNull ProgressTracker progressTracker)
The class AbstractStateReplacementFlow.Instigator
assembles the transaction for state replacement and sends out change proposals to all participants
(class AbstractStateReplacementFlow.Acceptor
) of that state. If participants agree to the proposed change, they each sign the transaction.
Finally, class AbstractStateReplacementFlow.Instigator
sends the transaction containing all participants' signatures to the notary for signature, and
then back to each participant so they can record it and use the new updated state for future transactions.
progressTracker
- 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 AbstractStateReplacementFlow.Instigator
,
class AbstractStateReplacementFlow.Acceptor
,
class AbstractStateReplacementFlow.Instigator
@Suspendable @NotNull public StateAndRef<T> call()
This is where you fill out your business logic.
@NotNull protected net.corda.core.flows.AbstractStateReplacementFlow.UpgradeTx assembleTx()
Build the upgrade transaction.
@NotNull public java.util.List<kotlin.Pair> getParticipantSessions()
Initiate sessions with parties we want signatures from.
@NotNull public StateAndRef<S> getOriginalState()
public M getModification()
@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