% !TeX root = sxmanual.tex
\colorlet{c0}{yellow!20}
\colorlet{c1}{green!10}
\colorlet{c2}{green!30}
\colorlet{fail}{red!80!black}
\colorlet{good}{green!80!black}

\begin{tikzpicture}[auto, thick, >=stealth', shorten >=1pt,
array/.style={rectangle split,rectangle split horizontal, rectangle split parts=#1,draw, minimum height=4em,
inner sep=1em
}]
\tikzstyle{sx}=[draw,circle,black,bottom color=skylableblue, node distance=6em,
top color= white, text=black,minimum width=2em]

\node[sx] (sx1) {\SX node};
\node[sx] (sx2) [right of=sx1] {\SX node};
\node[sx] (sx3) [right of=sx2] {\SX node};
\node[sx] (sx4) [right of=sx3] {\SX node};

\node[] (sx)  at ($(sx1)!0.5!(sx4)$) {};
\draw[] node[draw,dotted,cloud,cloud puffs=15,cloud puff arc=120,inner ysep=1em,aspect=2,color=black,
minimum height=20em,minimum width=25em] at (sx) {}; 


\node[array=10] (f1) [below of=sx, node distance=15em,
rectangle split part fill={c0,c1,c2,c1,c2,c1,c2,c1,c0,c0}] {
	\nodepart{one}=
	\nodepart{two}2
	\nodepart{three}3
	\nodepart{four}4
	\nodepart{five}5
	\nodepart{six}6
	\nodepart{seven}7
	\nodepart{eight}8
	\nodepart{nine}=
	\nodepart{ten}=
};


\draw[*->,fail,dashed]
let \p1 = ($(f1.one)+(-0.5em,1em)$),
\p2 = ($(\p1)!0.6!(sx1)$),
\p3 = ($(sx1)$) in
(\p1) |- (\x3,\y2) -| (sx1);

\path[->,bend left,fail,dashed]
(sx1.north) edge [bend left] (sx2.north);

\path[->,bend left,fail,dashed]
(sx1.north) edge [bend left] (sx4.north);

\draw[*->,dashdotted,very thick,fail]
let \p1 = ($(f1.one)+(0.25em,1em)$),
\p2 = ($(\p1)!0.5!(sx2)$),
\p3 = ($(sx2)$) in
(\p1) |- (\x3,\y2) -| (sx2);

\path[->,bend left, very thick, dashdotted,fail]
(sx2.south) edge [bend left] (sx1.south);

\path[->,bend left, very thick, dashdotted, fail]
(sx2.south) edge [bend right] (sx4.south);

\draw[*->,good]
let \p1 = ($(f1.one)+(1em,1em)$),
\p2 = ($(\p1)!0.4!(sx4)$),
\p3 = ($(sx4)$) in
(\p1) |- (\x3,\y2) -| (sx4);

\path[->,bend left, good]
(sx4.north) edge [bend right=60] (sx1.north);

\path[->,bend left, good]
(sx4.north) edge [bend right=60] (sx2.north);


\end{tikzpicture}