File size: 3,092 Bytes
f6662f9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
def get_plantuml_examples():
    return {
        'Unselected': {
            "description": "Select a diagram type to see examples.",
            "input": ""
        },
        "Use Case Diagram": {
            "description": "A use case diagram showing how users (actors) interact with a system and what functionalities (use cases) they use.",
            "input": """Create a use case diagram for a library system.
Actors are: Reader, Librarian.
Use cases for Reader are: Search Book, Borrow Book, Return Book.
Use cases for Librarian are: Add Book, Remove Book, Manage Loans."""
        },
        "Class Diagram": {
            "description": "A class diagram displaying the static structure of a system, showing its classes, attributes, operations, and relationships.",
            "input": """Generate a class diagram for an e-commerce system.
Classes are: Customer, Product, Order, OrderItem.
Customer has attributes: name, email, address.
Product has attributes: name, price, description.
Order has attributes: date, status.
OrderItem has attributes: quantity, unitPrice.
Relationships:
- Customer can place 0 or many Orders.
- Order contains 1 or many OrderItem.
- OrderItem is associated with 1 Product."""
        },
        "Sequence Diagram": {
            "description": "A sequence diagram illustrating the order of interactions between objects in a specific scenario, showing message exchange over time.",
            "input": """Draw a sequence diagram for user login.
Participants are: User, Login System, Database.
1. User sends (enter credentials) to Login System.
2. Login System queries (verify credentials) Database.
3. Database responds (valid/invalid credentials) to Login System.
4. If valid credentials, Login System sends (successful login) to User.
5. If invalid credentials, Login System sends (login error) to User."""
        },
        "Activity Diagram": {
            "description": "An activity diagram modeling the control flow of activities in a process or workflow, including decisions and branches.",
            "input": """Create an activity diagram for the online purchasing process.
Start activity.
1. Browse Products.
2. Add to Cart.
3. Decision (Cart Full?).
    - If yes: Go to Checkout.
    - If no: Continue Browse.
4. Process Payment.
5. Decision (Payment Approved?).
    - If yes: Confirm Order.
    - If no: Notify Payment Error.
6. Ship Order.
End activity."""
        },
        "State Machine Diagram": {
            "description": "A state machine diagram describing the different states an object can be in, and the transitions between these states due to events.",
            "input": """Draw a state machine diagram for the order lifecycle.
States are: New, Processing, Shipped, Delivered, Canceled.
Transitions:
- From New to Processing on "Payment Received".
- From Processing to Shipped on "Product Dispatched".
- From Shipped to Delivered on "Customer Received".
- From New to Canceled on "Cancel Order".
- From Processing to Canceled on "Cancel Order".
Initial state: New.
Final states: Delivered, Canceled."""
        }
    }