Skip to content

Commit

Permalink
Bug fixes -
Browse files Browse the repository at this point in the history
DG Review By TA (Jai): Missing Activation Bar In Sequence Diagram nus-cs2113-AY2324S2#109

Added the activation bars
  • Loading branch information
yeozongyao committed Apr 10, 2024
1 parent 955f809 commit eeb669b
Showing 1 changed file with 35 additions and 6 deletions.
41 changes: 35 additions & 6 deletions docs/UML_Files/SetGenreSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


@startuml
hide footbox
participant ":User" as User
Expand All @@ -10,35 +8,66 @@ participant ":BookGenre" as BookGenre
participant ":Ui" as Ui

User -> ParserMain : set-genre [BOOK_INDEX]
activate ParserMain
ParserMain -> ParserGenre : executeParseSetGenre(books, inputArray)
activate ParserGenre
ParserGenre -> BookList : validate index
activate BookList
BookList --> ParserGenre : indexIsValid
deactivate BookList
ParserGenre -> ParserGenre : genreSelectionPrinter()
ParserGenre -> User : Display available genres
ParserGenre --> User : Display available genres
deactivate ParserGenre

alt selecting existing genre
User -> ParserGenre : Select genre number
activate ParserGenre
ParserGenre -> BookList : getAvailableGenres()
activate BookList
BookList --> ParserGenre : availableGenresList
deactivate BookList
ParserGenre -> BookGenre : setBookGenreByIndex(index, selectedGenre, books)
activate BookGenre
BookGenre -> BookList : getBook(index)
activate BookList
BookList --> BookGenre : book
deactivate BookList
BookGenre -> Ui : setGenreBookMessage(title, genre)
Ui -> User : confirmation message
activate Ui
Ui --> User : confirmation message
deactivate Ui
deactivate BookGenre
deactivate ParserGenre
else adding new genre
User -> ParserGenre : 6 (Add new genre)
activate ParserGenre
ParserGenre -> User : Enter new genre
User -> ParserGenre : Input custom genre
ParserGenre -> BookList : Add new genre to list
activate BookList
BookList --> ParserGenre : newGenreAdded
deactivate BookList
ParserGenre -> BookGenre : setBookGenreByIndex(index, newGenre, books)
activate BookGenre
BookGenre -> BookList : getBook(index)
activate BookList
BookList --> BookGenre : book
deactivate BookList
BookGenre -> Ui : setGenreBookMessage(title, genre)
Ui -> User : confirmation message
activate Ui
Ui --> User : confirmation message
deactivate Ui
deactivate BookGenre
deactivate ParserGenre
end

deactivate ParserMain
@enduml






Flow:
1. The user initiates the set-genre command.
2. ParserMain processes the input and delegates the command to ParserGenre.
Expand Down

0 comments on commit eeb669b

Please sign in to comment.