@startuml
skin rose
skinparam ActivityFontSize 15
skinparam ArrowFontSize 12
!pragma useVerticalIf on
start
:User enters Add Command;

'Since the beta syntax does not support placing the condition outside the
'diamond we place it as the true branch instead.

 partition AddCommandParser{
    if () then ([else])
        :ParseException: Invalid command format;
           stop
    ( [all prefixes present]) elseif () then ( [else])
        :ParseException: Duplicate prefixes;
           stop
    ( [no duplicate prefixes]) elseif () then ( [else])
        :ParseException: Invalid parameter;
        stop
    else ( [valid parameters])

    endif
}

partition AddCommand {

if () then ([else])
    :ModuleNotFoundException: Module not found;
    stop
( [module is in ModuleData]) elseif() then([else])
    :DuplicateModuleException: Module already added;
    stop
else ( [module not in ModulePlan] )

endif
}

:Add Command is executed successfully.
Module is added to ModulePlan.;
stop



@enduml
