java.lang.Object
org.mule.runtime.extension.api.runtime.source.SourceResult

@MinMuleVersion("4.1") public final class SourceResult extends Object
A class that represents the result of processing a message from a Source through a flow, this reports whether the result of the processing was successful or terminated with errors. The purpose of this class is to be used as input of the OnTerminate callback of a Source so that this callback can operate according to the result.
Since:
1.0
  • Method Details

    • success

      public static SourceResult success(SourceCallbackContext sourceCallbackContext)
    • responseError

      public static SourceResult responseError(org.mule.runtime.api.message.Error responseError, SourceCallbackContext sourceCallbackContext)
    • invocationError

      public static SourceResult invocationError(org.mule.runtime.api.message.Error invocationError, SourceCallbackContext sourceCallbackContext)
    • isSuccess

      public boolean isSuccess()
      Indicates whether an error has occurred or not processing a message from a Source through the owned flow
      Returns:
      boolean indicating the result of the message processing.
    • getInvocationError

      public Optional<org.mule.runtime.api.message.Error> getInvocationError()
      Indicates whether an error occurred before calling OnSuccess or OnError. This could be either due to errors when generating required error parameters, or due to an exception thrown inside an error handler message processor.
      Returns:
      boolean indicating if the error happened before invoking the other callbacks
    • getResponseError

      public Optional<org.mule.runtime.api.message.Error> getResponseError()
      Indicates whether an error occurred or not executing one of the source callbacks (OnSuccess or OnError).
      Returns:
      boolean indicating if the error happened calling the source callbacks.
    • getSourceCallbackContext

      public SourceCallbackContext getSourceCallbackContext()
      Returns:
      the SourceCallbackContext of the message that is being processing.