Class TryContext

java.lang.Object
edu.tufts.hrilab.action.execution.Context
edu.tufts.hrilab.action.execution.control.TryContext

public class TryContext extends Context
This represents the semantics of the TRY control in an action script.
  • Constructor Details

  • Method Details

    • resetConcreteContext

      public void resetConcreteContext()
      Description copied from class: Context
      This resets fields specific to concrete sub-classes and should be overridden by inheriting classes if additional resetting needs to happen.
      Overrides:
      resetConcreteContext in class Context
    • setStatus

      public void setStatus(ActionStatus eStatus, Justification justification)
      Exit the current event. Note that this is always called from the child event, setting its execution status before it returns.

      Special handling of error in try context: do not transmit error to parent context, instead handle the error within the context by jumping to the catch block. If an exit happens in the catch block, resume standard behavior by transmitting error to parent context.

      Overrides:
      setStatus in class Context
      Parameters:
      eStatus - the execution status of the currently running event
    • setupNextStep

      protected void setupNextStep()
      Description copied from class: Context
      If Context can have next steps (i.e., children), implement this method to add the next child context that should be executed.
      Overrides:
      setupNextStep in class Context
    • copy

      public TryContext copy(Context newParent)
      Description copied from class: Context
      deep copy of the context, its status, and its children
      Specified by:
      copy in class Context
      Parameters:
      newParent - parent to attach the copied context too
      Returns:
      the copied context