java.lang.Object
com.broadleafcommerce.orchestration.config.Step

public class Step extends Object
A configuration element that is analogous to a SimpleActivity in the workflow. Used to establish the activities, as well as the decision criteria used to determine the next step based on activity outcome (see ActivityResponse).
  • Constructor Details

    • Step

      public Step(String name, boolean adminSelectable)
    • Step

      public Step(String name, boolean adminSelectable, boolean isWait, Duration waitDuration)
    • Step

      public Step()
  • Method Details

    • addDecision

      public Step addDecision(String response, String nextStep)
    • copy

      public Step copy()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getName

      public String getName()
      The name of the activity. Should match SimpleActivity.getName(). Exception to this is when isWait() is true, in which case, there is no explicitly declared SimpleActivity. There is also no backing Spring bean for a wait step.
    • isAdminSelectable

      public boolean isAdminSelectable()
      Whether the activity should be allowed to be selected for targeted execution via SimpleWorkflow.goToStep(String).
    • getDecisions

      public Map<String,String> getDecisions()
      Map of response value (see ActivityResponse.getResponseState()) to activity name (see SimpleActivity.getName()). Used to decide what activity to execute next based on a response from the current activity. For a Step marked with isWait() true, there will always only be one response key (WaitStep.WAIT_COMPLETION_RESPONSE).
    • isWait

      public boolean isWait()
      Special case for a step that should simply wait for an amount of time. This type of step always results in a responseState of WaitStep.WAIT_COMPLETION_RESPONSE upon completion. For this type of step, you will usually include a single decision element whose key is WaitStep.WAIT_COMPLETION_RESPONSE and whose value is the next activity to execute at the conclusion of the wait duration.
    • getWaitDuration

      public Duration getWaitDuration()
      The amount of time to wait for a cases where isWait is true.
    • getInterruptPollingInterval

      public Duration getInterruptPollingInterval()
      When isWait() is true, the amount of time to pause before checking for an interrupt signal. Workflow signals (like SimpleWorkflow.pause(boolean)) can request change, and by intermittent polling for such signals, a wait step can exit early.
    • getTimeout

      public Duration getTimeout()
      The timeout value for a step. If the system detects that a step has not concluded within the timeout duration, the workflow is a candidate for being declared a failed workflow. The default is 5 minutes. Longer running activities should set this to a higher value to avoid premature conclusion of the workflow.
    • getPauseOnReturn

      public Boolean getPauseOnReturn()
      Analogous to ActivityResponse.getPauseOnReturn(). Setting here has the effect of statically declaring the SimpleActivity defined by this step should return the declared value on exit. This is useful for activities that are known to always pause the workflow upon exit. Note, if the ActivityResponse is explicitly set via logic in the SimpleActivity, then that value will win over what's declared here. Default value is null (not set).
    • setName

      public void setName(String name)
      The name of the activity. Should match SimpleActivity.getName(). Exception to this is when isWait() is true, in which case, there is no explicitly declared SimpleActivity. There is also no backing Spring bean for a wait step.
    • setAdminSelectable

      public void setAdminSelectable(boolean adminSelectable)
      Whether the activity should be allowed to be selected for targeted execution via SimpleWorkflow.goToStep(String).
    • setWait

      public void setWait(boolean isWait)
      Special case for a step that should simply wait for an amount of time. This type of step always results in a responseState of WaitStep.WAIT_COMPLETION_RESPONSE upon completion. For this type of step, you will usually include a single decision element whose key is WaitStep.WAIT_COMPLETION_RESPONSE and whose value is the next activity to execute at the conclusion of the wait duration.
    • setWaitDuration

      public void setWaitDuration(Duration waitDuration)
      The amount of time to wait for a cases where isWait is true.
    • setInterruptPollingInterval

      public void setInterruptPollingInterval(Duration interruptPollingInterval)
      When isWait() is true, the amount of time to pause before checking for an interrupt signal. Workflow signals (like SimpleWorkflow.pause(boolean)) can request change, and by intermittent polling for such signals, a wait step can exit early.
    • setTimeout

      public void setTimeout(Duration timeout)
      The timeout value for a step. If the system detects that a step has not concluded within the timeout duration, the workflow is a candidate for being declared a failed workflow. The default is 5 minutes. Longer running activities should set this to a higher value to avoid premature conclusion of the workflow.
    • setPauseOnReturn

      public void setPauseOnReturn(Boolean pauseOnReturn)
      Analogous to ActivityResponse.getPauseOnReturn(). Setting here has the effect of statically declaring the SimpleActivity defined by this step should return the declared value on exit. This is useful for activities that are known to always pause the workflow upon exit. Note, if the ActivityResponse is explicitly set via logic in the SimpleActivity, then that value will win over what's declared here. Default value is null (not set).