With help of you I could get started with TikZ and create this image:
Because I want to explain the double arrow part (HIS <-> Processing) better, I want to extend the "HIS" block and split this into two different blocks, surrounded with a dashed container "HIS":
As you can see the arrows overlap and I don't know the correct syntax to shift arrows, like what happened on the right side. This is what I'd like to accomplish:
Note the shift of the arrow coming out of processing, which is translated to the bottom. This shifting is also needed to have arrows between Reporting and Archive. The tex code (I use pdflatex) with the complete document surrounding the image is this:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,fit,calc}
\tikzstyle{box} = [draw, rectangle, rounded corners, thick, node distance=7em, text width=6em, text centered, minimum height=3.5em]
\tikzstyle{container} = [draw, rectangle, dashed, inner sep=2em]
\tikzstyle{line} = [draw, thick, -latex']
\begin{document}
\begin{tikzpicture}[auto]
\node [box] (planning) {Planning};
\node [box, below of=planning] (resources) {Resources};
\node [box, below of=resources] (sensors) {Sensors};
\node [box, below of=sensors] (processing) {Processing};
\coordinate (middle) at ($(resources.west)!0.5!(sensors.west)$);
\node [box, left of=middle, node distance=10em] (archive) {Archive};
\node [box, left of=archive, node distance=10em] (reporting) {Reporting};
\node[container, fit=(resources) (sensors)] (or) {};
\node at (or.north west) [above right,node distance=0 and 0] {OR};
\node[container, fit=(archive) (reporting)] (his) {};
\node at (his.north west) [above right,node distance=0 and 0] {HIS};
\path [line] (planning) -- (resources);
\path [line] (resources) -- (sensors);
\path [line] (sensors) -- (processing);
\path [line] (archive) |- (planning);
\path [line] (archive) |- (processing);
\path [line] (processing) -| (reporting);
\draw [line] (processing.east) -- ++(2,0) node(lowerright){} |- (planning.east);
\draw [line] (lowerright |- or.east) -- (or.east -| resources.south east);
\end{tikzpicture}
\end{document}
I tried already (processing.south) -| (reporting)
instead of (processing) -| (reporting)
, but this doesn't translate the arrow enough to have it fist a vertical part.
Any help is really appreciated, as I hope to understand TikZ better!
Best Answer
My solution leads to:
The code to realize it is:
To shift down from the
Reporting
toProcessing
box I used this trick:to draw a line below the box using as reference its
south
anchor. Of course($(processing.south)-(0,0.5)$)
is the new reference also to connect thePlanning
box to theProcessing
one:Notice that here I extended your
++(2,0)
to cope with the fact that the new starting position is in the middle of the box.Finally, to draw connection lines between
Reporting
andArchive
box I used definitions that you can find in the TikZ documentation 48.2 Predefined Shapes (rectangle).