corda / net.corda.core.flows / WithReferencedStatesFlow / <init>

<init>

WithReferencedStatesFlow(progressTracker: ProgressTracker = tracker(), flowLogicProducer: () -> 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:

  1. the owner of the reference state has updated the state with a valid, notarised transaction
  2. the owner of the reference state has shared the update with the node attempting to run the flow which uses the reference state
  3. 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.

Parameters

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.