\begin{tikzpicture}

    \begin{umlstate}[name=Amain]{Overall state of the object A} % Amain

        \begin{umlstate}[name=Bgraph, fill=red!20]{graph B} % Bgraph

            \umlstateinitial[name=Binit] % state-Binit
            \umlbasicstate[y=-4, name=test1, fill=white]{test1} % state-test1
            \umltrans{Binit}{test1}
            \umltrans[recursive=20|60|2.5cm, recursive direction=right to top, arg={op1}, pos=1.5]{test1}{test1}
            \umltrans[recursive=160|120|2.5cm, recursive direction=left to top, arg={op2}, pos=1.5]{test1}{test1}
            \umltrans[recursive=-160|-120|2.5cm, recursive direction=left to bottom, arg={op3}, pos=1.5]{test1}{test1}
            \umltrans[recursive=-20|-60|2.5cm, recursive direction=right to bottom, arg={op4}, pos=1.5]{test1}{test1}

            \umlbasicstate[y=-8, name=test2, fill=white]{test2} % state-test2
            \umltrans[recursive=-160|-120|2.5cm, recursive direction=left to bottom, arg={op5}, pos=1.5]{test2}{test2}
            \umltrans{test1}{test2}

            \umlstatefinal[x=3, y=-7.75, name=Bfinal] % state-Bfinal
            \umltrans{test2}{Bfinal}

        \end{umlstate}

        \umlstateinitial[x=6, y=1, name=Ainit] % state-Ainit
        \umlVHtrans[anchor2=40]{Ainit}{Bgraph}

        \umlstatefinal[x=6, y=-3.5, name=Afinal] % state-Afinal
        \umlHVtrans[anchor1=30]{Bgraph}{Afinal}

        \umlbasicstate[x=6, y=-6, name=visu, fill=green!20]{Visualisation} % state-visu
        \umlHVtrans{Bfinal}{visu}
        \umltrans{visu}{Afinal}
        \umltrans[recursive=-20|-60|2.5cm, recursive direction=right to bottom, arg=a, pos=1.5]{visu}{visu}

    \end{umlstate}

\end{tikzpicture}

%Local variables:
% coding: utf-8
% mode: text
% mode: rst
% End:
% vim: fileencoding=utf-8 filetype=tex :
