public class WithReferencedStatesFlow<T> extends FlowLogic<T>
Given a flow which uses reference states, the class WithReferencedStatesFlow
will execute the flow as a subFlow.
If the flow fails due to a class 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:
the owner of the reference state has updated the state with a valid, notarised transaction
the owner of the reference state has shared the update with the node attempting to run the flow which uses the reference state
The node has successfully committed the transaction updating the reference state (and all the dependencies), and added the updated reference state to the vault.
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.
Modifier and Type | Class and Description |
---|---|
static class |
WithReferencedStatesFlow.Companion |
Modifier and Type | Field and Description |
---|---|
static WithReferencedStatesFlow.Companion |
Companion |
Constructor and Description |
---|
WithReferencedStatesFlow(ProgressTracker progressTracker,
Function0<? extends net.corda.core.flows.FlowLogic<? extends T>> flowLogicProducer)
Given a flow which uses reference states, the
class WithReferencedStatesFlow will execute the flow as a subFlow.
If the flow fails due to a class 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: |
Modifier and Type | Method and Description |
---|---|
T |
call()
This is where you fill out your business logic.
|
ProgressTracker |
getProgressTracker()
a progress tracker instance.
|
await, await, call, checkFlowIsNotKilled, checkFlowIsNotKilled, checkFlowPermission, close, flowStackSnapshot, getFlowInfo, getLogger, getOurIdentity, getOurIdentityAndCert, getProgressTracker, getRunId, getServiceHub, initiateFlow, initiateFlow, isKilled, persistFlowStackSnapshot, receive, receiveAll, receiveAllMap, recordAuditEvent, send, sendAll, sendAllMap, sendAndReceive, subFlow, track, trackStepsTree, trackStepsTreeIndex, waitForLedgerCommit, waitForStateConsumption
public static WithReferencedStatesFlow.Companion Companion
public WithReferencedStatesFlow(ProgressTracker progressTracker, Function0<? extends net.corda.core.flows.FlowLogic<? extends T>> flowLogicProducer)
Given a flow which uses reference states, the class WithReferencedStatesFlow
will execute the flow as a subFlow.
If the flow fails due to a class 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:
the owner of the reference state has updated the state with a valid, notarised transaction
the owner of the reference state has shared the update with the node attempting to run the flow which uses the reference state
The node has successfully committed the transaction updating the reference state (and all the dependencies), and added the updated reference state to the vault.
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 class FlowLogic
instance using reference states. This will be executed at least once.It is recommended a new class FlowLogic
instance be returned each time.progressTracker
- a progress tracker instance.flowLogicProducer
- a lambda which creates the class FlowLogic
instance using reference states. This will be executed at least once.
It is recommended a new class FlowLogic
instance be returned each time.class WithReferencedStatesFlow
,
class NotaryError.Conflict
public T call()
This is where you fill out your business logic.
public ProgressTracker getProgressTracker()
a progress tracker instance.