AbstractStateReplacementFlow.Instigator - corda

corda / net.corda.core.flows / AbstractStateReplacementFlow / Instigator

# Instigator

`abstract class Instigator<out S : ContractState, out T : ContractState, out M> : FlowLogic<StateAndRef<T>>`

The Instigator assembles the transaction for state replacement and sends out change proposals to all participants (Acceptor) of that state. If participants agree to the proposed change, they each sign the transaction. Finally, 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

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

### Types

#### NOTARY | `object NOTARY : Step`
#### SIGNING | `object SIGNING : Step`

### Constructors

#### <init> | The Instigator assembles the transaction for state replacement and sends out change proposals to all participants (Acceptor) of that state. If participants agree to the proposed change, they each sign the transaction. Finally, 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. `Instigator(originalState: StateAndRef<S>, modification: M, progressTracker: ProgressTracker = Instigator.tracker())`

### Properties

#### modification | `val modification: M`
#### originalState | `val originalState: StateAndRef<S>`
#### progressTracker | 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. `open val progressTracker: ProgressTracker`

### Functions

#### assembleTx | Build the upgrade transaction. `abstract fun assembleTx(): UpgradeTx`
#### call | This is where you fill out your business logic. `open fun call(): StateAndRef<T>`
#### getParticipantSessions | Initiate sessions with parties we want signatures from. `open fun getParticipantSessions(): List<Pair<FlowSession, List<AbstractParty>>>`

### Companion Object Functions

#### tracker | `fun tracker(): ProgressTracker`