net.corda.flows

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

- FlowLogic
- - net.corda.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.
  Direct Known Subclasses:
    ContractUpgradeFlow.Instigator, NotaryChangeFlow.Instigator
  Enclosing class:
    AbstractStateReplacementFlow

      public static class AbstractStateReplacementFlow.Instigator<S extends ContractState,T extends ContractState,M>
      extends FlowLogic

  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`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Instigator.Companion`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Instigator.Companion` | `Companion`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Instigator(StateAndRef<? extends S> originalState, M modification, 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.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `kotlin.Pair<net.corda.core.transactions.SignedTransaction,java.lang.Iterable>` | `assembleTx()`
    `StateAndRef<T>` | `call()` This is where you fill out your business logic. The returned object will usually be ignored, but can be helpful if this flow is meant to be used as a subflow.
    `M` | `getModification()`
    `StateAndRef<S>` | `getOriginalState()`
    `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. 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.

    - ### Methods inherited from class net.corda.core.flows.FlowLogic

      `call, getCounterpartyMarker, getLogger, getProgressTracker, getRunId, getServiceHub, getStateMachine, receive, send, sendAndReceive, setStateMachine, subFlow, subFlow, track, waitForLedgerCommit`

- - ### Field Detail

    - #### Companion

          public static Instigator.Companion Companion

  - ### Constructor Detail

    - #### Instigator

          public Instigator(StateAndRef<? extends S> originalState,
                            M modification,
                            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. 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

          public StateAndRef<T> call()

      This is where you fill out your business logic. The returned object will usually be ignored, but can be helpful if this flow is meant to be used as a subflow.

    - #### assembleTx

          public kotlin.Pair<net.corda.core.transactions.SignedTransaction,java.lang.Iterable> assembleTx()

    - #### getOriginalState

          public StateAndRef<S> getOriginalState()

    - #### getModification

          public M getModification()

    - #### getProgressTracker

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