flatMap

fun <V, W> CordaFuture<out V>.flatMap(transform: (V) -> CordaFuture<out W>): CordaFuture<W>

Returns a future that will have the same outcome as the future returned by the given transform. But if this future or the transform fails, the returned future's outcome is the same throwable. In the case where this future fails, the transform is not invoked.