subFlow

@Suspendable
abstract fun <R> subFlow(subFlow: SubFlow<R>): R

Executes the given SubFlow.

This function returns once the SubFlow completes, returning either:

Any open FlowSessions created within a SubFlow annotated with InitiatingFlow are sent:

  • Session close messages after successfully completing the SubFlow.

  • Session error messages when an exception is thrown from the SubFlow.

Return

The result of executing SubFlow.call.

See also

Parameters

subFlow

The SubFlow to execute.

R

The type returned by subFlow.

Throws

net.corda.v5.base.exceptions.CordaRuntimeException

General type of exception thrown by most Corda APIs.