corda / net.corda.core.flows / FlowLogic / checkFlowIsNotKilled

checkFlowIsNotKilled

fun checkFlowIsNotKilled(): Unit

Helper function that throws a KilledFlowException if the current FlowLogic has been killed.

Call this function in long-running computation loops to exit a flow that has been killed:

for (item in list) {
  checkFlowIsNotKilled()
  // do some computation
}

See the isKilled property for more information.

fun checkFlowIsNotKilled(lazyMessage: () -> Any): Unit

Helper function that throws a KilledFlowException if the current FlowLogic has been killed. The provided message is added to the thrown KilledFlowException.

Call this function in long-running computation loops to exit a flow that has been killed:

for (item in list) {
  checkFlowIsNotKilled { "The flow $runId was killed while iterating through the list of items" }
  // do some computation
}

See the isKilled property for more information.