2

Can I make a call to a class without a caller class using TikZ-uml sequence diagrams? It would be just an arrow pointing at a timeline of a class beginning a new method as added in this picture created withe the code below.

\begin{tikzpicture} 
\begin{umlseqdiag} 
\umlobject[class=A]{a} 
\umlobject[class=B]{b} 
\umlobject[class=C]{c} 
\begin{umlcall}{a}{b} 
\begin{umlcall}{b}{c} 
\end{umlcall} 
\end{umlcall} 
\end{umlseqdiag} 
\end{tikzpicture}

enter image description here enter image description here

Nada
  • 23

1 Answers1

2

Similarly to Add notes on tikz-uml sequence diagram, the box at the start if the umlcall is a node named st-call-N, where N is the number of the call (counting from 1). So you can do for example

\draw [tikzuml synchron-msg style] ([xshift=-2cm]st-call-1.north west) node[left] {methodWithoutCaller()} -- (st-call-1.north west);

output of code

\documentclass[border=20pt]{standalone} 
\usepackage{tikz-uml}
\begin{document} 
\begin{tikzpicture} 
\begin{umlseqdiag} 
\umlobject[class=A]{a} 
\umlobject[class=B]{b} 
\umlobject[class=C]{c} 
\begin{umlcall}{a}{b} 
\end{umlcall} 
\begin{umlcall}{b}{c} 
\end{umlcall} 
\end{umlseqdiag} 
\draw [tikzuml synchron-msg style] ([xshift=-2cm]st-call-1.north west) node[left] {methodWithoutCaller()} -- (st-call-1.north west);
\end{tikzpicture}
\end{document}
Torbjørn T.
  • 206,688