All Superinterfaces:
ScenarioNode

@OpenApiAll public interface Scenario extends ScenarioNode

Represents a use case flow scenario.

Contains methods for manipulating it. Use ScenarioManager for scenario utility methods.

See Also:
  • Field Details

    • SCENARIO_CHANGE_EVENT

      static final String SCENARIO_CHANGE_EVENT
      Event for indicating scenario change.
      See Also:
  • Method Details

    • addFlowStep

      FlowStep addFlowStep()
      Adds a flow step to the scenario.
      Returns:
      added scenario.
    • addFlowStep

      FlowStep addFlowStep(FlowStep addAfter)
      Adds a flow step after a given flow step.
      Parameters:
      addAfter - flow step after which to add a flow step.
      Returns:
      added flow step.
    • addUseCaseStep

      FlowStep addUseCaseStep(UseCase useCase)
      Adds a flow step which references another use case.
      Parameters:
      useCase - use case to add.
      Returns:
      created flow step.
    • addUseCaseStep

      FlowStep addUseCaseStep(FlowStep addAfter, UseCase useCase)
      Adds a flow step which references another use case.
      Parameters:
      addAfter - flow step after which to add.
      useCase - use case to add.
      Returns:
      added step
    • addExceptionType

      ExceptionType addExceptionType(FlowStep flowStep)
      Adds exception type.
      Parameters:
      flowStep - flow set to which exception type should be added.
      Returns:
      added exception type.
    • addExceptionType

      ExceptionType addExceptionType(FlowStep flowStep, ExceptionType exceptionType)
      Adds exception type.
      Parameters:
      flowStep - flow step to which to add.
      exceptionType - exception type to add.
      Returns:
      added exception type.
    • addExceptionalFlowStep

      FlowStep addExceptionalFlowStep(ExceptionType exceptionType, FlowStep addAfter)
      Adds exceptional flow step.
      Parameters:
      exceptionType - exception type to which step should be added.
      addAfter - flow step after which to add.
      Returns:
      added exceptional flow step.
    • addExceptionalFlowStep

      FlowStep addExceptionalFlowStep(ExceptionType exceptionType)
      Adds exceptional flow step.
      Parameters:
      exceptionType - exception type to which to add exceptional flow step.
      Returns:
      added exceptional flow step.
    • removeFlowStep

      void removeFlowStep(FlowStep flowStep)
      Removes flow step.
      Parameters:
      flowStep - flow step to remove.
    • swapScenarioNodes

      void swapScenarioNodes(ScenarioNode node1, ScenarioNode node2)
      Swaps scenario nodes.
      Parameters:
      node1 - first node to swap.
      node2 - second node to swap.
    • getFlowSteps

      List<FlowStep> getFlowSteps()
      Gets scenario flow steps.
      Returns:
      scenario flow steps.
    • addAlternativeCondition

      AlternativeCondition addAlternativeCondition(FlowStep flowStep)
      Adds alternative condition to the flow step.
      Parameters:
      flowStep - flow step to which to add alternative condition.
      Returns:
      created alternative condition.
    • removeAlternativeCondition

      void removeAlternativeCondition(AlternativeCondition condition)
      Removes alternative condition.
      Parameters:
      condition - alternative condition to remove.
    • removeExceptionType

      void removeExceptionType(FlowStep flowStep, ExceptionType exceptionType)
      Removes exception type.
      Parameters:
      flowStep - flow step from which to remove exception type.
      exceptionType - exception type to remove.
    • removeExceptionalFlowStep

      void removeExceptionalFlowStep(FlowStep exceptionalFlowStep)
      Removes exceptional flow step.
      Parameters:
      exceptionalFlowStep - exceptional flow step to remove.
    • removeAlternativeFlowStep

      void removeAlternativeFlowStep(FlowStep alternativeFlowStep)
      Removes alternative flow step.
      Parameters:
      alternativeFlowStep - alternative flow step to remove.
    • addAlternativeCondition

      AlternativeCondition addAlternativeCondition(FlowStep flowStep, AlternativeCondition addAfter)
      Adds alternative condition.
      Parameters:
      flowStep - flow step to which to add alternative condition.
      addAfter - condition after which to add.
      Returns:
      created alternative condition.
    • addAlternativeFlowStep

      FlowStep addAlternativeFlowStep(AlternativeCondition alternativeCondition)
      Adds alternative flow step.
      Parameters:
      alternativeCondition - condition to which to add.
      Returns:
      created flow step.
    • addAlternativeFlowStep

      FlowStep addAlternativeFlowStep(AlternativeCondition alternativeCondition, FlowStep addAfter)
      Adds alternative flow step.
      Parameters:
      alternativeCondition - condition to which to add.
      addAfter - flow step after which to add.
      Returns:
      added alternative flow step.
    • getActivity

      Activity getActivity()
      Gets activity in which use case is represented.
      Returns:
      activity in which steps are represented.
    • getUseCase

      UseCase getUseCase()
      Gets use case which represents scenario.
      Returns:
      use case which represents scenario.
    • getElements

      List<Element> getElements()
      Gets all elements which represent scenario.
      Returns:
      all elements which represent scenario.
    • getScenarioDiagram

      Diagram getScenarioDiagram(boolean createIfNotExists)
      Gets diagram which represents scenario.
      Parameters:
      createIfNotExists - flag which forces diagram creation.
      Returns:
      gets diagram which represents scenario or null if it did not exist or was not created.
    • readScenario

      void readScenario(UseCase useCase)
      Reads scenario from a given use case.
      Parameters:
      useCase - use case from which to read.
    • readScenario

      void readScenario()
      Reads scenario from the current scenario use case.
    • addPropertyChangeListener

      void addPropertyChangeListener(PropertyChangeListener listener)
      Adds a property change listener to this scenario. Listeners are notified about changes in the scenario.
      Parameters:
      listener - listener to add.
    • removePropertyChangeListener

      void removePropertyChangeListener(PropertyChangeListener listener)
      Removes listener from scenario listeners.
      Parameters:
      listener - listener to remove.
    • getScenarioStart

      ScenarioNodeStart getScenarioStart()
      Gets scenario node which starts scenario.
      Returns:
      scenario node which starts scenario.
    • getScenarioEnd

      ScenarioNodeStart getScenarioEnd()
      Gets scenario node which ends scenario.
      Returns:
      scenario node which ends scenario.
    • isEditable

      boolean isEditable()
      Indicates if permissions allow to edit scenario.
      Specified by:
      isEditable in interface ScenarioNode
      Returns:
      true if scenario is editable, false otherwise.
    • getScenarioReadResult

      ScenarioReadResult getScenarioReadResult()
      Gets errors of the last scenario reading.
      Returns:
      scenario read result.
    • getReferencedScenarioUseCases

      List<UseCase> getReferencedScenarioUseCases()
      Gets scenario use cases which are referenced by this scenario.
      Returns:
      scenario use cases which are referenced by this scenario.
    • prepareModelBeforeDisplay

      void prepareModelBeforeDisplay()
      Performs necessary model preparations before displaying the scenario.
    • getScenarioRepresentationTextProvider

      ScenarioRepresentationTextProvider getScenarioRepresentationTextProvider()
      Gets scenario GUI text provider.
      Returns:
      scenario GUI text provider.