SessionManager.getInstance().createSession(...);
// Creates a use case scenario.
Scenario scenario = ScenarioManager.createScenario(useCase);
// Sets the scenario name.
scenario.setName("Extract money from ATM.");
// Adds a basic flow step.
FlowStep flowStep1 = scenario.addFlowStep();
// Sets a name for the basic flow step.
flowStep1.setName("Insert card");
FlowStep flowStep2 = scenario.addFlowStep();
flowStep2.setName("Enter pin");
FlowStep flowStep3 = scenario.addFlowStep();
flowStep3.setName("Good bye");
// Adds an alternative condition for the basic flow step.
AlternativeCondition condition = scenario.addAlternativeCondition(flowStep2);
// Sets a condition guard.
condition.setIfCondition("Pin correct");
// Sets a name for the alternative flow step.
FlowStep flowStep = condition.getAlternativeFlowSteps().get(0);
flowStep.setName("Extract money");
// Adds an exception type to the basic flow step.
ExceptionType exceptionType = scenario.addExceptionType(flowStep2);
// Sets a name for the exception type.
exceptionType.setName("Card expired");
// Sets a name for the exceptional flow step.
FlowStep exceptionalFlowStep = exceptionType.getExceptionalFlowSteps().get(0);
exceptionalFlowStep.setName("Inform customer about expired card");
SessionManager.getInstance().closeSession();
// Opens and layouts the Activity diagram.
ScenarioManager.displayScenario(scenario, true, true, "Open ATM Scenario");