#Paste this on http://www.websequencediagrams.com/
participant Initiator as I
participant Acceptor as A
participant StringEncoder
participant StringDecoder
participant MsgValidator
participant MapEncoder
participant MapDecoder
participant FieldChecker
participant SequenceNumberHandler
participant LogOnHandler
participant HeartbeatHandler
participant TestRequestHandler
participant ResendRequestHandler
participant GapFillHandler
participant SeqResetHandler
participant LogOffHandler

I->A: LogOn Msg
activate I
A->StringEncoder: Convert bytes\n to string
StringEncoder->MsgValidator: Chk BodyLength \n& ChkSum field vals
MsgValidator-->I:OnERROR:DISCONNECT
MsgValidator->MapEncoder: Convert to\n tag/value map
MapEncoder->FieldChecker: Check required\n session fields
FieldChecker-->I:OnERROR:DISCONNECT
FieldChecker->SequenceNumberHandler: Check sequence numbers
SequenceNumberHandler->LogOnHandler: Process logon
LogOnHandler->HeartbeatHandler: Do heartbeats
loop until disconnect (if no outgoing msg in X seconds)
HeartbeatHandler->SequenceNumberHandler: Send Heartbeat
end
SequenceNumberHandler->MapDecoder: Convert to\n FIX string
MapDecoder->StringDecoder: Convert string to bytes
StringDecoder->I:Response

note over MapEncoder: Convert to a map\n like data structure\n for ease
