net.corda.core.flows / FlowStateMachine

# FlowStateMachine

`interface FlowStateMachine<R>`

A FlowStateMachine instance is a suspendable fiber that delegates all actual logic to a FlowLogic instance. For any given flow there is only one PSM, even if that flow invokes subflows.

These classes are created by the StateMachineManager when a new flow is started at the topmost level. If a flow invokes a sub-flow, then it will pass along the PSM to the child. The call method of the topmost logic element gets to return the value that the entire state machine resolves to.

### Properties

id | `abstract val id: StateMachineRunId` Unique ID for this machine run, valid across restarts
logger | `abstract val logger: <ERROR CLASS>`
resultFuture | `abstract val resultFuture: <ERROR CLASS><R>` This future will complete when the call method returns.
serviceHub | `abstract val serviceHub: ServiceHub`

### Functions

receive | `abstract fun <T : Any> receive(otherParty: Party, receiveType: Class<T>, sessionFlow: FlowLogic<*>): UntrustworthyData<T>`
send | `abstract fun send(otherParty: Party, payload: Any, sessionFlow: FlowLogic<*>): Unit`
sendAndReceive | `abstract fun <T : Any> sendAndReceive(otherParty: Party, payload: Any, receiveType: Class<T>, sessionFlow: FlowLogic<*>): UntrustworthyData<T>`

### Inheritors

FlowStateMachineImpl | `class FlowStateMachineImpl<R> : FlowStateMachine<R>`