msc { "User", "Quit GUI", "Session Manager", "Application"; "User" -> "Quit GUI" [label = "I'm leaving"]; "Quit GUI" -> "Session Manager" [label = "I'm thinking about quitting"]; --- [label = "For each application"]; "Session Manager" -> "Application" [label = "SaveYourself"]; --- [label = "If the application wants to interact"]; "Session Manager" <- "Application" [label = "InteractRequest"]; --- [label = "If the application does not want to interact"]; ... [label = "A bunch of work"]; "Session Manager" <- "Application" [label = "SaveYourselfDone"]; --- [label = "Everyone Now"]; "Session Manager" -> "Application" [label = "ShutdownCancelled"]; "Quit GUI" <- "Session Manager" [label = "List of apps that asked for interaction"]; --- [label = "If the list is non-zero"]; "User" <- "Quit GUI" [label = "How would you like to handle these?"]; --- [label = "else"]; "Quit GUI" -> "Session Manager" [label = "Okay, really shutdown"]; }