UML – How to Show Retry in Sequence Diagram

sequence-diagramuml

I am drawing sequence diagram for large integration project where one system will initiate the REST call to another system and there is a proxy in middle which will pass through the request like

A->b->C

where b is a pass through system. I have shown 200 returned from C->b->A. I am wondering how do I depict when C returns 500 or there is an IOException and A needs to retry n no of times before it gives up.

Best Answer

One way is to use Fragments like this:

enter image description here

But honestly: code is much clearer for such purposes. Avoid using a graphical representation where a few lines of (pseudo) code can clarify what a 1000 pictures obfuscate. Once (in the 80s) I also though that programming graphically would be an advantage. But now I'm old an wise and know that this was wishful thinking. It's simply stupid ;-)

Regarding the IOException this heavily depends on runtime behavior. Usually this is a message sent from c which is not a return message but will produce a call stack in a. This can be placed in an alt Fragment.

Related Topic