Class BodyExecutionCallback

    • Constructor Detail

      • BodyExecutionCallback

        public BodyExecutionCallback()
    • Method Detail

      • onStart

        public void onStart​(StepContext context)
        Notifies that the body execution has started.

        This callback has to return synchronously. It is intended for performing log output, update FlowNode, or some such decorative actions. For any asynchronous computation that needs to happen prior to the body execution, the best place to do that is before calling StepContext.newBodyInvoker().

        StepContext given to this method lets you access objects that correspond to the beginning of the body, as opposed to the objects that correspond to the invocation of the step that invoked the body. Otherwise the context is identical in behaviour to that given to Step.start(StepContext).

        So for example this is a good place to record any logging that's attributed to the body execution, such as reporting that this is Nth retry of the body, or that this is the parallel branch named 'xyz'.

      • onSuccess

        public abstract void onSuccess​(StepContext context,
                                       Object result)
        Notifies that the body execution has completed successfully.

        StepContext given to this method lets you access objects that correspond to the end of the body, as opposed to the objects that correspond to the invocation of the step that invoked the body. Otherwise the context is identical in behaviour to that given to Step.start(StepContext).

        So for example this is a good place to record any logging that's attributed to the end of the body execution.