Skip to content

Commit

Permalink
Merge pull request #270 from tengcharmaine/activitydiagram
Browse files Browse the repository at this point in the history
Activitydiagram for add and addnote
  • Loading branch information
Jayne1010 authored Apr 14, 2024
2 parents 1be9bf6 + 3a33b71 commit cdaa69a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 22 deletions.
8 changes: 4 additions & 4 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Given below is an example usage scenario and how the add mechanism behaves at ea

Step 1. The user launches the application for the first time. The `AddressBook` will be initialized with the initial address book state.

Step 2. The user executes `add n/John Doe …` to add the person in the address book with the unique identification number `T0123456A`. The add command calls `Model#addPerson(Person p)`, causing the modified state of the address book after the `add n/John Doe …` command executes to be saved.
Step 2. The user executes `add n\John Doe …` to add the person in the address book with the unique identification number `T0123456A`. The add command calls `Model#addPerson(Person p)`, causing the modified state of the address book after the `add n\John Doe …` command executes to be saved.


<box type="info" seamless>
Expand All @@ -171,7 +171,7 @@ Step 2. The user executes `add n/John Doe …` to add the person in the address

</box>

The following sequence diagram shows how an undo operation goes through the `Logic` component:
The following sequence diagram shows how an add operation goes through the `Logic` component:

<puml src="diagrams/AddCommandDiagram.puml" alt="AddCommandDiagram" />

Expand All @@ -184,7 +184,7 @@ The following sequence diagram shows how an undo operation goes through the `Log
The following activity diagram summarizes what happens when a user executes a new command:

<div style="text-align: center;">
<puml src="diagrams/AddCommandActivityDiagram.puml" width="250"/>
<puml src="diagrams/AddCommandActivityDiagram.puml" width="600"/>
</div>

#### Design Considerations & Alternatives Considered:
Expand Down Expand Up @@ -363,7 +363,7 @@ The following activity diagram summarizes what happens when a user executes a ne

**Aspect: Display of error message when command is unsuccessful:**
* Current choice: Displays the correct error message based on the type of error made (e.g. missing fields, invalid ic format).
* Rationale: Users will be able to learn of their error quickly and have an idea of what to edit to make the command successful.
* Rationale: Users will be able to learn of their error quickly annd have an idea of what to edit to make the command successful.

### Edit feature

Expand Down
22 changes: 13 additions & 9 deletions docs/diagrams/AddCommandActivityDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ start
'Since the beta syntax does not support placing the condition outside the
'diamond we place it as the true branch instead.

if () then ([command successful])
:Save new contact to
addressbook;
else ([command unsuccessful])
:Error messages;
:Edit command
accordingly;
:Successfully saves
new contact;
if () then ([user input is valid])
if () then ([patient already exists])
:System displays patient
already exists error message;
else ([else])
:System inserts patient to
list of patients;
:System displays added patient
in patient list panel;
endif
else ([else])
:System displays specific
error message;
endif
stop
@enduml
24 changes: 15 additions & 9 deletions docs/diagrams/AddNoteCommandActivityDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@ start
'Since the beta syntax does not support placing the condition outside the
'diamond we place it as the true branch instead.

if () then ([command successful])
:Add new note to
specified patient;
else ([command unsuccessful])
:Error messages;
:Edit command
accordingly;
:Successfully adds
new note;
if () then ([valid user input])
if () then ([with -replace flag])
:Successfully replaces original
note with new note;
:System displays the new note
on patient list panel;
else ([without -replace flag])
:Successfully appends
new note to original note;
:System displays the updated
note on patient list panel;
endif
else ([else])
:System displays specific
error messages;
endif
stop
@enduml

0 comments on commit cdaa69a

Please sign in to comment.