AbstractStateReplacementFlow.Instigator
Keywords: net.corda.core.flows.AbstractStateReplacementFlow.Instigator class
Date: 2023-09-18

net.corda.core.flows

## Class AbstractStateReplacementFlow.Instigator<S extends ContractState,T extends ContractState,M>

- net.corda.core.flows.FlowLogic<T>
- - net.corda.core.flows.AbstractStateReplacementFlow.Instigator<S,T,M>

- Type Parameters:
    `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.

  Enclosing class:
    AbstractStateReplacementFlow

      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.

  See Also:
    `class AbstractStateReplacementFlow.Instigator`, `class AbstractStateReplacementFlow.Acceptor`, `class AbstractStateReplacementFlow.Instigator`

- - ### Field Detail

    - #### Companion

          public static net.corda.core.flows.AbstractStateReplacementFlow.Instigator.Companion Companion

  - ### Constructor Detail

    - #### Instigator

          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.

      Parameters:
        `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.

      See Also:
        `class AbstractStateReplacementFlow.Instigator`, `class AbstractStateReplacementFlow.Acceptor`, `class AbstractStateReplacementFlow.Instigator`

  - ### Method Detail

    - #### call

          @Suspendable
           @NotNull
          public StateAndRef<T> call()

      This is where you fill out your business logic.

    - #### assembleTx

          @NotNull
          protected net.corda.core.flows.AbstractStateReplacementFlow.UpgradeTx assembleTx()

      Build the upgrade transaction.

      Returns:
        the transaction

    - #### getParticipantSessions

          @NotNull
          public java.util.List<kotlin.Pair> getParticipantSessions()

      Initiate sessions with parties we want signatures from.

    - #### getOriginalState

          @NotNull
          public StateAndRef<S> getOriginalState()

    - #### getModification

          public M getModification()

    - #### getProgressTracker

          @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.

      See Also:
        `class ProgressTracker`