FlowLogic.Companion
Keywords: net.corda.core.flows.FlowLogic.Companion class
Date: 2023-09-18

net.corda.core.flows

## Class FlowLogic.Companion

- net.corda.core.flows.FlowLogic.Companion

- Enclosing class:
    FlowLogic<T>

      public static class FlowLogic.Companion

- - ### Method Detail

    - #### getCurrentTopLevel

          @Nullable
          public FlowLogic<?> getCurrentTopLevel()

      Return the outermost `class FlowLogic` instance, or null if not in a flow.

      See Also:
        `class FlowLogic`

    - #### sleep

          @Suspendable
           @JvmStatic
           @JvmOverloads
          public void sleep(@NotNull
                                                                    java.time.Duration duration,
                                                                    boolean maySkipCheckpoint)

      If on a flow, suspends the flow and only wakes it up after at least `duration` time has passed. Otherwise, just sleep for `duration`. This sleep function is not designed to aid scheduling, for which you should consider using `interface SchedulableState`. It is designed to aid with managing contention for which you have not managed via another means.

      Warning: long sleeps and in general long running flows are highly discouraged, as there is currently no support for flow migration! This method will throw an exception if you attempt to sleep for longer than 5 minutes.

      See Also:
        `duration`, `duration`, `interface SchedulableState`

    - #### sleep

          @Suspendable
           @JvmStatic
           @JvmOverloads
          public void sleep(@NotNull
                                                                    java.time.Duration duration)

      If on a flow, suspends the flow and only wakes it up after at least `duration` time has passed. Otherwise, just sleep for `duration`. This sleep function is not designed to aid scheduling, for which you should consider using `interface SchedulableState`. It is designed to aid with managing contention for which you have not managed via another means.

      Warning: long sleeps and in general long running flows are highly discouraged, as there is currently no support for flow migration! This method will throw an exception if you attempt to sleep for longer than 5 minutes.

      See Also:
        `duration`, `duration`, `interface SchedulableState`