EngineeringSoftwareDesign
Seqgoodexample

Description

The code defines a sequence diagram using the tikz-uml package in LaTeX. The diagram includes three objects/classes B, C, and D. The fill object and fill call styles are set to white and gray, respectively. The diagram depicts a loop where B sends a message to C, and based on a condition, C may either send a message to D or assess the update and send a message back to B. The condition is depicted with an alt fragment. If C sends the message to D, D will execute the run operation before returning a message to C, which will then continue the loop. The diagram also includes three timeline markers for B, C, and D that indicate the duration between messages.

Keywords

latex, tikz-uml, umlobject, umlseqdiag, umlfragment, umlcallself, umlcall, umlfpart, umlsdnode

Source Code

EngineeringSoftwareDesign

\documentclass[border=3mm]{standalone}
\usepackage[english]{babel}
\usepackage{tikz-uml}
 
\begin{document}
 
\begin{tikzpicture}
 \tikzumlset{fill object = white, fill call = gray!20} 
\begin{umlseqdiag}
\umlobject[class=B]{b}
\umlobject[class=C]{c}
\umlobject[class=D]{d}
 
 
\begin{umlfragment}[type=loop]
\begin{umlcallself}[op=run]{b} 
 
\begin{umlcall}[op=send, type=asynchron]{b}{c}
    \begin{umlfragment}[type=alt, label=condition, inner xsep=8]
        \begin{umlcall}[op=send, type=synchron, return=send update]{c}{d}
            \begin{umlcallself}[padding=1.5, op=run]{d} 
            \end{umlcallself}
        \end{umlcall}
        \begin{umlcallself}[op=assess update]{c} 
            \begin{umlcall}[op=send update, type=synchron, return=acknowledge]{c}{b}
            \end{umlcall}
            \begin{umlcall}[op=allow continue, padding=-2.5, type=asynchron]{c}{b}
            \end{umlcall}
        \end{umlcallself}
        \umlfpart[default]
        \begin{umlcall}[op=allow continue, type=asynchron]{c}{b}
        \end{umlcall}
    \end{umlfragment}
\end{umlcall}
 
\end{umlcallself}
 
\end{umlfragment}
\umlsdnode[dt=1.5]{b}
\umlsdnode[dt=5]{c}
\umlsdnode[dt=32]{d}
\end{umlseqdiag}
\end{tikzpicture}
\end{document}
Deploy to Overleaf