Class ActivityResponse
java.lang.Object
com.broadleafcommerce.orchestration.client.ActivityResponse
Describes the outcome of a specific
SimpleActivity
execution.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddContextEntry
(String key, Object value) If an error state, this is descriptive information about the error.static String
getExceptionTrace
(Object sampleObject, Throwable exception) Build a filtered stack trace for an exception.Whether the activity should indicate that a pause is required for the workflow up exit.A String value describing the status based on the activity execution attemptAny context information the activity wants to add to the main contextboolean
Whether the activity should register itself as completed in the side effect log upon exit.void
setCompleteOnReturn
(boolean completeOnReturn) Whether the activity should register itself as completed in the side effect log upon exit.void
setErrorInformation
(String errorInformation) If an error state, this is descriptive information about the error.void
setPauseOnReturn
(Boolean pauseOnReturn) Whether the activity should indicate that a pause is required for the workflow up exit.void
setResponseState
(String responseState) A String value describing the status based on the activity execution attemptwithCompleteOnReturn
(boolean completeOnReturn) withErrorInformation
(String errorInformation) withPauseOnReturn
(boolean pauseOnReturn)
-
Constructor Details
-
ActivityResponse
-
ActivityResponse
public ActivityResponse()
-
-
Method Details
-
addContextEntry
-
withErrorInformation
-
withCompleteOnReturn
-
withPauseOnReturn
-
getExceptionTrace
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 filtrationexception
- The exception from which to harvest the stack trace- Returns:
- The stack trace represented as a filtered string
-
getResponseState
A String value describing the status based on the activity execution attempt -
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 aSimpleWorkflow.pause(boolean)
. If this activity were to implementInterruptAware.interrupt()
, then the implementation could persist current state and then exit withcompleteOnReturn
set to false. Then, uponSimpleWorkflow.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
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 andcompleteOnReturn
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 theWorkflowServices API
. Default value is null (not set). A null value will be interpreted asfalse
, unless otherwise determined based onStep.getPauseOnReturn()
. -
getErrorInformation
If an error state, this is descriptive information about the error. Usually a stack trace. SeegetExceptionTrace(Object, Throwable)
. -
setResponseState
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 aSimpleWorkflow.pause(boolean)
. If this activity were to implementInterruptAware.interrupt()
, then the implementation could persist current state and then exit withcompleteOnReturn
set to false. Then, uponSimpleWorkflow.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
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 andcompleteOnReturn
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 theWorkflowServices API
. Default value is null (not set). A null value will be interpreted asfalse
, unless otherwise determined based onStep.getPauseOnReturn()
. -
setErrorInformation
If an error state, this is descriptive information about the error. Usually a stack trace. SeegetExceptionTrace(Object, Throwable)
.
-