Class ActivityResponse

java.lang.Object
com.broadleafcommerce.orchestration.client.ActivityResponse

public class ActivityResponse extends Object
Describes the outcome of a specific SimpleActivity execution.
  • Constructor Details

    • ActivityResponse

      public ActivityResponse(String responseState)
    • ActivityResponse

      public ActivityResponse()
  • Method Details

    • addContextEntry

      public ActivityResponse addContextEntry(String key, Object value)
    • withErrorInformation

      public ActivityResponse withErrorInformation(String errorInformation)
    • withCompleteOnReturn

      public ActivityResponse withCompleteOnReturn(boolean completeOnReturn)
    • withPauseOnReturn

      public ActivityResponse withPauseOnReturn(boolean pauseOnReturn)
    • getExceptionTrace

      public static String getExceptionTrace(Object sampleObject, Throwable exception)
      Build a filtered stack trace for an exception. This trace is optimized for space and relevance.
      Parameters:
      sampleObject - A sample object from the client project that informs package prefix information to include in the trace element filtration
      exception - The exception from which to harvest the stack trace
      Returns:
      The stack trace represented as a filtered string
    • getResponseState

      public String getResponseState()
      A String value describing the status based on the activity execution attempt
    • getResultingContext

      public Map<String,Object> getResultingContext()
      Any context information the activity wants to add to the main context
    • isCompleteOnReturn

      public boolean isCompleteOnReturn()
      Whether the activity should register itself as completed in the side effect log upon exit. This should only be used when the desire is to leave the workflow in an incomplete state. A case where this may make sense is during a SimpleWorkflow.pause(boolean). If this activity were to implement InterruptAware.interrupt(), then the implementation could persist current state and then exit with completeOnReturn set to false. Then, upon SimpleWorkflow.start(Map), the workflow would replay up to this activity and then the activity implementation could pick up where it left off. Default value is true.
    • getPauseOnReturn

      public Boolean getPauseOnReturn()
      Whether the activity should indicate that a pause is required for the workflow up exit. This is analogous to a workflow pause signal. The main difference between this flag and completeOnReturn is that the latter is intended for noting an incomplete activity, rather than a complete activity and a pause. This should only be used when the desire is to leave the workflow in an incomplete state. A case where this may make sense is if outside action is required before resuming. Once the outside action is complete, the workflow may be resumed via the WorkflowServices API. Default value is null (not set). A null value will be interpreted as false, unless otherwise determined based on Step.getPauseOnReturn().
    • getErrorInformation

      public String getErrorInformation()
      If an error state, this is descriptive information about the error. Usually a stack trace. See getExceptionTrace(Object, Throwable).
    • setResponseState

      public void setResponseState(String responseState)
      A String value describing the status based on the activity execution attempt
    • setCompleteOnReturn

      public void setCompleteOnReturn(boolean completeOnReturn)
      Whether the activity should register itself as completed in the side effect log upon exit. This should only be used when the desire is to leave the workflow in an incomplete state. A case where this may make sense is during a SimpleWorkflow.pause(boolean). If this activity were to implement InterruptAware.interrupt(), then the implementation could persist current state and then exit with completeOnReturn set to false. Then, upon SimpleWorkflow.start(Map), the workflow would replay up to this activity and then the activity implementation could pick up where it left off. Default value is true.
    • setPauseOnReturn

      public void setPauseOnReturn(Boolean pauseOnReturn)
      Whether the activity should indicate that a pause is required for the workflow up exit. This is analogous to a workflow pause signal. The main difference between this flag and completeOnReturn is that the latter is intended for noting an incomplete activity, rather than a complete activity and a pause. This should only be used when the desire is to leave the workflow in an incomplete state. A case where this may make sense is if outside action is required before resuming. Once the outside action is complete, the workflow may be resumed via the WorkflowServices API. Default value is null (not set). A null value will be interpreted as false, unless otherwise determined based on Step.getPauseOnReturn().
    • setErrorInformation

      public void setErrorInformation(String errorInformation)
      If an error state, this is descriptive information about the error. Usually a stack trace. See getExceptionTrace(Object, Throwable).