Skip to content

Commit

Permalink
Improve the ABACUS import state diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
egli committed Jul 4, 2024
1 parent 78a10d0 commit d494d96
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions doc/import_from_ABACUS.org
Original file line number Diff line number Diff line change
Expand Up @@ -64,31 +64,35 @@
* State diagram
** Import
#+begin_src plantuml :file ABACUS_import.png
@startuml
start
:Receive ABACUS XML;
:Validate;
:Extract data;
:Validate ISBN;
:Validate product_number;
if (Not for Daisyproducer?) then (no)
:Ignore file;
elseif (Existing document for product_number?) then (yes)
:Assert that there is only one document;
:Update the metadata in the db;
:Update the XML with the metadata;
elseif (Document with ISBN or same title and source_edition?) then (yes)
:Assert that there is only one document;
:Update the metadata in the db;
:Update the XML with the metadata;
:Create a product with given product_number, product_type and document;
else (no)
:Create a new document in the db;
:Create a product with given product_number, product_type and document;
:Create an initial default XML with the given metadata;
endif
stop
@enduml
@startuml
start
:Receive ABACUS XML;
if (XML valid?) then (no)
stop
endif
:Extract data;
if (For daisyproducer?) then (no)
stop
elseif (ISBN (source) valid?) then (no)
#pink:Throw error;
stop
elseif (product_number valid?) then (no)
#pink:Throw error;
stop
elseif (Product seen before?) then (yes)
:Update the metadata in the db;
:Update the XML with the metadata;
elseif (ISBN or Title+Edition seen before?) then (yes)
:Update the metadata in the db;
:Update the XML with the metadata;
:Create a new product;
else (no)
:Create a new document in the db;
:Create a new product;
:Create an initial default XML;
endif
stop
@enduml
#+end_src

#+RESULTS:
Expand Down

0 comments on commit d494d96

Please sign in to comment.