class WithReferencedStatesFlow<T : Any> : FlowLogic<T>
Given a flow which uses reference states, the WithReferencedStatesFlow will execute the flow as a subFlow. If the flow fails due to a NotaryError.Conflict for a reference state, then WithReferencedStatesFlow will be suspended until the state refs for the reference states are consumed. In this case, a consumption means that:
WARNING: Caution should be taken when using this flow as it facilitates automated re-running of flows which use reference states. The flow using reference states should include checks to ensure that the reference data is reasonable, especially if some economics transaction depends upon it.
progressTracker
- a progress tracker instance.
flowLogicProducer
- a lambda which creates the FlowLogic instance using reference states. This will be executed at least once.
It is recommended a new FlowLogic instance be returned each time.
ATTEMPT |
object ATTEMPT : Step |
RETRYING |
object RETRYING : Step |
SUCCESS |
object SUCCESS : Step |
<init> |
Given a flow which uses reference states, the WithReferencedStatesFlow will execute the flow as a subFlow. If the flow fails due to a NotaryError.Conflict for a reference state, then WithReferencedStatesFlow will be suspended until the state refs for the reference states are consumed. In this case, a consumption means that: WithReferencedStatesFlow(progressTracker: ProgressTracker = tracker(), flowLogicProducer: () -> FlowLogic<T>) |
progressTracker |
a progress tracker instance. val progressTracker: ProgressTracker |
call |
This is where you fill out your business logic. fun call(): T |
tracker |
fun tracker(): ProgressTracker |
receiveAll |
Suspends until a message has been received for each session in the specified sessions. fun FlowLogic<*>.receiveAll(session: Pair<FlowSession, Class<out Any>>, vararg sessions: Pair<FlowSession, Class<out Any>>): Map<FlowSession, UntrustworthyData<Any>> fun <R : Any> FlowLogic<*>.receiveAll(receiveType: Class<R>, session: FlowSession, vararg sessions: FlowSession): List<UntrustworthyData<R>> fun <R : Any> FlowLogic<*>.receiveAll(session: FlowSession, vararg sessions: FlowSession): List<UntrustworthyData<R>> |