{--------------------------------------------------} { Simple telephone connection phase - TMDL Example } { January 31, 1995 } {--------------------------------------------------} Map Map4 is {--------------------------------------------------} INTERNAL { Hidden global activities } GiveTone, GotDial, EndDial {--------------------------------------------------} INTERACTIONS ConnectionPhase, Dialing on GiveTone, GotDial, EndDial; {--------------------------------------------------} DESCRIPTIONS Timethread ConnectionPhase is { This is the main timethread. } Internal RegInit, { Register the initiator in the database } CheckDB { Check a abstract (and virtual!) database } Trigger (OffHook) Action (RegInit) Sync (GiveTone) { Starts the Dialing TT } Wait Time (GotDial) OrFork Guard (TimeGotDial eq OK) { Dial is finished in time } Continue OR Guard (TimeGotDial eq TOut) { TimeOut: Took too much time to dial } Path Abort (EndDial) { Abort Dialing TT } Result (ErrorDial) { ... and ask user to hangup } EndPath EndOrFork Action (CheckDB) Action (Ring) Wait (Answer) Result (Connected) { Connection done. } EndTT { ConnectionPhase } {--------------------------------------------------} Timethread Dialing is AbortedOn (EndDial) Trigger (GiveTone) Action (Tone) Wait (Dial) Result (GotDial) EndTT { Dialing } EndMap { Map4 }