public class UseCase
extends java.lang.Object
As an example, a use case for an ATM is "Get cash". As another example, a use case for an online flight reservation system is "Book flight".
The use case itself defines no behavior. The steps that are part of the use case define the behavior of the use case. As steps are often performed one after the other, in sequence, they are grouped in use case flows.
| Modifier and Type | Method and Description |
|---|---|
Flow |
findFlow(java.lang.String flowName)
Finds the flow with the specified name, contained in this use case.
|
Step |
findStep(java.lang.String stepName)
Finds the step with the specified name, contained in this use case.
|
Flow |
getBasicFlow()
The basic flow defines the 'happy day scenario' of the use case: no
exceptions are handled in it, all steps are assumed to go well.
|
java.util.Collection<Flow> |
getFlows()
Returns the flows contained in this use case.
|
Model |
getModel()
Returns the model that this element is part of.
|
java.lang.String |
getName()
Returns the name of the element.
|
java.util.Collection<Step> |
getSteps()
Returns the steps contained in this use case.
|
boolean |
hasFlow(java.lang.String flowName)
Checks whether this use case contains the specified flow.
|
boolean |
hasStep(java.lang.String stepName)
Checks whether this use case contains the specified step.
|
Flow |
newFlow(java.lang.String flowName)
Creates a new flow in this use case.
|
FlowlessStep |
newFlowlessStep(java.lang.String stepName,
Condition optionalCondition)
Creates a step that is independent of a flow.
|
InterruptableFlowStep |
newInterruptableFlowStep(java.lang.String stepName,
Flow flow)
Creates a step that can be "interrupted", that is: interrupting steps are
performed instead of this step when their flow position is correct and their
condition is fulfilled.
|
InterruptingFlowStep |
newInterruptingFlowStep(java.lang.String stepName,
Flow flow,
FlowPosition flowPosition,
Condition condition)
Creates a new step that can interrupt other flows.
|
java.lang.String |
toString() |
public Flow getBasicFlow()
The basic flow is a sequence of steps that lead the user to the user's goal. There is exactly one basic flow per use case.
public boolean hasFlow(java.lang.String flowName)
flowName - the name of the flow whose existence to checkpublic boolean hasStep(java.lang.String stepName)
stepName - the name of the step whose existence to checkpublic Flow newFlow(java.lang.String flowName)
flowName - the name of the flow to be created.ElementAlreadyInModel - if a flow with the specified name already
exists in the use casepublic InterruptingFlowStep newInterruptingFlowStep(java.lang.String stepName, Flow flow, FlowPosition flowPosition, Condition condition)
stepName - the name of the stepflow - the flow the step shall belong toflowPosition - the flow position, may be null, meaning: anytime.condition - the condition, may be null if there is none.public InterruptableFlowStep newInterruptableFlowStep(java.lang.String stepName, Flow flow)
builder.useCase("UC1").basicFlow().step("S1"), then S1 is an
interruptable step as well.stepName - the name of the stepflow - the flow the step shall belong topublic FlowlessStep newFlowlessStep(java.lang.String stepName, Condition optionalCondition)
stepName - the name of the stepoptionalCondition - the condition of the flow, or null if the step is
unconditional.public Flow findFlow(java.lang.String flowName)
flowName - the name of the flow to look forNoSuchElementInModel - if no flow with the specified flowName is found
in the current use casepublic Step findStep(java.lang.String stepName)
stepName - the name of the step to look forNoSuchElementInModel - if no step with the specified stepName is found
in the current use casepublic java.util.Collection<Flow> getFlows()
public java.util.Collection<Step> getSteps()
public java.lang.String getName()
public Model getModel()
public java.lang.String toString()
toString in class java.lang.Object