@startuml

    state ModeInstalling
    state ModeUpgrading
    state ModeHookError
    state ModeTerminating
    state ModeAbide
    state ModeConflicted

    [*] -> ModeContinue

    ModeContinue : determines next \n action based \n on persistent \n uniter state
    ModeContinue -> ModeContinue
    ModeContinue -> ModeInstalling
    ModeContinue -> ModeUpgrading
    ModeContinue -> ModeAbide
    ModeContinue --> ModeHookError
    ModeContinue --> ModeConflicted
    ModeContinue --> ModeTerminating
    ModeContinue --> unexpectedError


    ModeInstalling : responsible for \n initial charm deployment
    ModeInstalling --> ModeContinue
    ModeInstalling --> unexpectedError

    ModeUpgrading : responsible for \n upgrading the charm
    ModeUpgrading --> ModeContinue
    ModeUpgrading --> unexpectedError

    ModeConflicted : charm specific conflict mode \n responds to - \n  * user resolution of \n    charm upgrade conflicts \n  * forced charm upgrade
    ModeConflicted --> ModeContinue
    ModeConflicted --> unexpectedError

    ModeHookError : responsible for watching and \n responding to \n  * user resolution of hook errors \n  * forced charm upgrade requests
    ModeHookError --> ModeUpgrading
    ModeHookError --> ModeContinue
    ModeHookError --> unexpectedError

    ModeAbide : uniters usual steady state
    ModeAbide --> ModeAbide
    ModeAbide --> ModeUpgrading
    ModeAbide --> unexpectedError

    unexpectedError --> [*] : error
    ModeTerminating --> [*] : normal exit

@enduml
