syntaxdiagramplantumlsrs

Syntax Error in PlantUML Sequence Diagram


I'm encountering a syntax error in my PlantUML sequence diagram. It's related to line 19. Here's the diagram I'm trying to create:

@startuml
participant Employee
participant System

group "Employee adds leave request" {
    Employee -> System: Log in
    activate System
    Employee -> System: Select 'Add Leave Request'
    Employee -> System: Fill out leave request form
    Employee -> System: Submit leave request
    System -> System: Validate leave request
    alt Leave request is valid
        System -> System: Update leave request status
        System --> Employee: Notify successful submission
    else Leave request is invalid
        System --> Employee: Notify invalid request
    end
    deactivate System
}
@enduml

The error message I'm getting is "Syntax error on line 19". I've tried reformatting the code, but I can't seem to figure out what's causing the issue.

here is img to see error

here is activities diagram to see Activities Digram

Could someone please help me identify and resolve the syntax error in my PlantUML sequence diagram?

Thank you!

In attempting to resolve the syntax error, I first reviewed the PlantUML documentation and made sure that my sequence diagram adhered to the correct syntax guidelines. I carefully checked each line for any typos or missing elements.

I also attempted to simplify the diagram by removing any unnecessary components to see if the error persisted. However, even after these adjustments, the syntax error on line 19 persisted.

I expected that by adhering to the correct syntax and simplifying the diagram, the error would be resolved and the sequence diagram would render correctly without any syntax errors. However, the error message continued to appear despite my efforts.


Solution

  • Use end instead of { }. Also, " should probably be skipped if you do not want to have your group description in quotes.

    @startuml
    participant Employee
    participant System
    
    group Employee adds leave request
        Employee -> System: Log in
        activate System
        Employee -> System: Select 'Add Leave Request'
        Employee -> System: Fill out leave request form
        Employee -> System: Submit leave request
        System -> System: Validate leave request
        alt Leave request is valid
            System -> System: Update leave request status
            System --> Employee: Notify successful submission
        else Leave request is invalid
            System --> Employee: Notify invalid request
        end
        deactivate System
    end
    @enduml
    

    enter image description here