runFlowWithLogicalRetry

fun runFlowWithLogicalRetry(runFlow: (CordaRPCOps) -> StateMachineRunId, hasFlowStarted: (CordaRPCOps) -> Boolean, onFlowConfirmed: () -> Unit = {}, timeout: Duration = 4.seconds)

This function runs a flow and retries until it completes successfully.

runFlow is a function that starts a flow. hasFlowStarted is a function that checks if the flow has actually completed by checking some side-effect, for example the vault. onFlowConfirmed Callback when the flow is confirmed. timeout Indicative timeout to wait until the flow would create the side-effect. Should be increased if the flow is slow. Note that this timeout is calculated after the rpc client has reconnected to the node.

Note that this method does not guarantee 100% that the flow will not be started twice.