exec_trace


\documentclass[border=10pt]{standalone}
\usepackage{tikz}
    \usetikzlibrary{matrix}
    \tikzset{>=latex}
\usepackage{lib/tikz-uml}
\begin{document}
    \begin{tikzpicture}
	    [auto,
	    if/.style={diamond, draw=blue, thick, fill=blue!20,
	               minimum width =2cm, align=flush center,
	               inner sep=1pt},
	    pas/.style={rectangle, draw=blue, thick, fill=blue!20,
	                minimum width =5cm, align=center, rounded corners,
	                minimum height=2em},
	    inici/.style={draw=red, thick, ellipse, fill=red!20,
	                  minimum height=2em},
	    event/.style={draw=orange, thick, circle, fill=orange!20,
	                minimum height=2em}, thick,scale=0.4]               
	   
	    \matrix[matrix of nodes, row sep=0.5cm, column sep=0.2cm]
	    {
	        |[inici](A)| IniciadorAplicacioUB & &\\
	        |[pas](B)| main() & &\\
	        |[pas](C)| AplicaciouB3() &  & \\
	        |[pas](D)| GestioAplicacioUB() & |[pas](E)| controlador.obrirFinestraReproductor() & \\
	        |[pas](F)| menuPrincipa() & |[pas](Z)|controlador.tancarFinestraReproductor() &\\
	        |[pas](G)| menuControl() & &\\
	        |[pas](H)| controlador.reproduirCarpeta() & &\\
	        |[pas](I)| controlador.reproduir(this.dades.GetBiblioteca()) & &\\
	        |[pas](J)| escoltador.iniciarReproduccio() & &\\
	        |[pas](K)| next() & |[event](M)| onEndFile() &\\
	        |[if](O)| hasNext() & |[pas](P)| fitxerReproduible.reproduir() &\\
	        |[if](N)| reproduccioCiclica() & |[pas](L)| reset()  &  \\
	        |[inici](Q)| END & &\\
	   };
   	   \begin{scope}
        \draw [->](A) --                                    node [midway]{1} (B);
        \draw [out=0, in =5, ->](B) to                      node [midway]{2} (C);
        \draw [out=-5, in=5, ->](C) to                      node [midway]{3} (D);
        \draw [out=0, in=180, ->](D) to                      node [midway]{4} (E);
        \draw [out=180, in=0, ->](E) to                      node [midway]{5} (D);
        \draw [out=-5, in=5, ->](D) to                     node [midway]{6} (F);
        \draw [out=-5, in=5, ->](F) to                      node [midway]{7} (G);
        \draw [out=-5, in=0, ->](G) to                      node [midway]{8} (H);
        \draw [out=-5, in=0, ->](H) to                      node [midway]{9} (I); 
        \draw [out=-5, in=0, ->](I) to                      node [midway]{Thread} (J);
        \draw [->] (J) to (K);
        \draw [->] (K) to (O);
        \draw [->] (O) to node[midway]{No}(N);
        \draw [->] (O) to node[near start]{Sí}(P); 
        \draw [->] (N) to node[midway]{No}(Q); 
        \draw [->] (N) to node[midway]{Sí}(L); 
        \draw [->] (P) to (M); 
        \draw [->] (M) to (K); 
        \draw [->] (L) to (K);
        \draw [out=180, in=185, ->](I) to                   node [midway]{10} (H);
        \draw [out=180, in=185, ->](H) to                   node [midway]{11} (G);
	    \draw [out=175, in=185, ->](G) to                   node [midway]{12} (F);
	    \draw [->](Z) to                                    node [midway]{13} (F);
	    \draw [->](F) to                                    node [midway]{14} (Z);
	    \draw [out=175, in=185, ->](F) to                   node [midway]{15} (D);
	    \draw [out=175, in=185, ->](D) to                   node [midway]{16} (C);
	    \draw [out=175, in=185, ->](C) to                   node [midway]{17} (B);
       \end{scope}
    \end{tikzpicture}
\end{document}