| 1 |
\documentclass{article} |
| 2 |
|
| 3 |
\usepackage{booktabs,multirow,tabularx,tikz,amssymb,amsmath} |
| 4 |
\usetikzlibrary{bpmn} |
| 5 |
|
| 6 |
\title{The Tikz BPMN package} |
| 7 |
\author{Sander J.J. Leemans} |
| 8 |
|
| 9 |
\begin{document} |
| 10 |
\maketitle |
| 11 |
|
| 12 |
This manual describes the BPMN Tikz package, used to draw BPMN models. |
| 13 |
|
| 14 |
\def\event#1{ |
| 15 |
\eventsymbol{#1} |
| 16 |
& |
| 17 |
\eventcode{#1} |
| 18 |
} |
| 19 |
|
| 20 |
\def\eventsymbol#1{ |
| 21 |
\begin{tikzpicture}[baseline] |
| 22 |
\node [#1] {}; |
| 23 |
\end{tikzpicture} |
| 24 |
} |
| 25 |
\def\eventcode#1{ |
| 26 |
\texttt{\textbackslash{}node [#1] \{\};} |
| 27 |
} |
| 28 |
|
| 29 |
\def\boundary#1{ |
| 30 |
\begin{tikzpicture}[baseline] |
| 31 |
\node [task, label={[#1]225:}] {}; |
| 32 |
\end{tikzpicture} |
| 33 |
& |
| 34 |
\texttt{\textbackslash{}node [task, label=\{[#1]225:\}] \{\};} |
| 35 |
} |
| 36 |
|
| 37 |
\section{Usage} |
| 38 |
Place the file \texttt{tikzlibrarybpmn.code.tex} in the same folder as your .tex file, and include \verb!\usetikzlibrary{bpmn}! in the preamble of your .text file. |
| 39 |
|
| 40 |
\subsection{Gateways} |
| 41 |
\begin{tabularx}{\linewidth}{cX} |
| 42 |
\toprule |
| 43 |
Symbol & code\\ |
| 44 |
\midrule |
| 45 |
\event{exclusive gateway}\newline\eventcode{xor gateway}\\ |
| 46 |
\event{parallel gateway}\newline\eventcode{and gateway}\\ |
| 47 |
\event{inclusive gateway}\newline\eventcode{or gateway}\\ |
| 48 |
\event{eventbased gateway}\\ |
| 49 |
\bottomrule |
| 50 |
\end{tabularx} |
| 51 |
|
| 52 |
\subsection{Events} |
| 53 |
\begin{tabularx}{\linewidth}{cX} |
| 54 |
\toprule |
| 55 |
Symbol & code\\ |
| 56 |
\midrule |
| 57 |
\event{start event}\\ |
| 58 |
\event{end event}\\ |
| 59 |
\midrule |
| 60 |
\event{message start event}\\ |
| 61 |
\event{catching message intermediate event}\\ |
| 62 |
\event{throwing message intermediate event}\\ |
| 63 |
\event{message end event}\\ |
| 64 |
\midrule |
| 65 |
\event{timer start event}\\ |
| 66 |
\eventsymbol{timer event} |
| 67 |
& |
| 68 |
\texttt{\textbackslash{}node [timer event] \{\};}\newline |
| 69 |
\texttt{\textbackslash{}node [intermediate timer event] \{\};} |
| 70 |
\\ |
| 71 |
\midrule |
| 72 |
\event{throwing compensation intermediate event}\\ |
| 73 |
\event{throwing compensation end event}\\ |
| 74 |
\midrule |
| 75 |
\eventsymbol{error event} & \eventcode{error event} \newline \eventcode{throwing error end event}\\ |
| 76 |
\midrule |
| 77 |
\event{signal start event}\\ |
| 78 |
\event{catching signal intermediate event} \newline \eventcode{signal intermediate event}\\ |
| 79 |
\event{throwing signal intermediate event}\\ |
| 80 |
\event{signal end event}\\ |
| 81 |
\bottomrule |
| 82 |
\end{tabularx} |
| 83 |
|
| 84 |
\subsubsection{Background colour} |
| 85 |
The background colour is an optional argument for several event styles, and required to be set if the background is not white for correct rendering. |
| 86 |
The default can be set using |
| 87 |
\verb=\colorlet{defaultbackgroundcolour}{new default colour}= after loading the package. |
| 88 |
|
| 89 |
\subsection{Tasks \& sub-processes} |
| 90 |
\begin{tabularx}{\linewidth}{cX} |
| 91 |
\toprule |
| 92 |
Symbol & code\\ |
| 93 |
\midrule |
| 94 |
\begin{tikzpicture}[baseline] |
| 95 |
\node [task] {A}; |
| 96 |
\end{tikzpicture} |
| 97 |
& |
| 98 |
\texttt{\textbackslash{}node [task] \{A\};} |
| 99 |
\\ |
| 100 |
\begin{tikzpicture}[baseline] |
| 101 |
\node [compensation task] {A}; |
| 102 |
\end{tikzpicture} |
| 103 |
& |
| 104 |
\texttt{\textbackslash{}node [compensation task] \{A\};} |
| 105 |
\\ |
| 106 |
\begin{tikzpicture}[baseline] |
| 107 |
\node [loop task] {A}; |
| 108 |
\end{tikzpicture} |
| 109 |
& |
| 110 |
\texttt{\textbackslash{}node [loop task] \{A\};} \newline |
| 111 |
requires the \texttt{amssymb} and \texttt{amsmath} packages |
| 112 |
\\ |
| 113 |
\begin{tikzpicture}[baseline] |
| 114 |
\node [multiinstance task] {A}; |
| 115 |
\end{tikzpicture} |
| 116 |
& |
| 117 |
\texttt{\textbackslash{}node [multiinstance task] \{A\};} |
| 118 |
\\ |
| 119 |
|
| 120 |
\midrule |
| 121 |
|
| 122 |
\begin{tikzpicture}[baseline] |
| 123 |
\node [manual task] {A}; |
| 124 |
\end{tikzpicture} |
| 125 |
& |
| 126 |
\texttt{\textbackslash{}node [manual task] \{A\};} |
| 127 |
\\ |
| 128 |
\begin{tikzpicture}[baseline] |
| 129 |
\node [receive task] {A}; |
| 130 |
\end{tikzpicture} |
| 131 |
& |
| 132 |
\texttt{\textbackslash{}node [receive task] \{A\};} |
| 133 |
\\ |
| 134 |
\begin{tikzpicture}[baseline] |
| 135 |
\node [script task] {A}; |
| 136 |
\end{tikzpicture} |
| 137 |
& |
| 138 |
\texttt{\textbackslash{}node [script task] \{A\};} |
| 139 |
\\ |
| 140 |
\begin{tikzpicture}[baseline] |
| 141 |
\node [send task] {A}; |
| 142 |
\end{tikzpicture} |
| 143 |
& |
| 144 |
\texttt{\textbackslash{}node [send task] \{A\};} |
| 145 |
\\ |
| 146 |
\begin{tikzpicture}[baseline] |
| 147 |
\node [service task] {A}; |
| 148 |
\end{tikzpicture} |
| 149 |
& |
| 150 |
\texttt{\textbackslash{}node [service task] \{A\};} |
| 151 |
\\ |
| 152 |
\begin{tikzpicture}[baseline] |
| 153 |
\node [user task] {A}; |
| 154 |
\end{tikzpicture} |
| 155 |
& |
| 156 |
\texttt{\textbackslash{}node [user task] \{A\};} |
| 157 |
\\ |
| 158 |
\bottomrule |
| 159 |
\end{tabularx} |
| 160 |
|
| 161 |
\begin{tabularx}{\linewidth}{cX} |
| 162 |
\toprule |
| 163 |
Symbol & code\\ |
| 164 |
\midrule |
| 165 |
\begin{tikzpicture}[baseline] |
| 166 |
\node [subprocess] {A}; |
| 167 |
\end{tikzpicture} |
| 168 |
& |
| 169 |
\texttt{\textbackslash{}node [subprocess] \{A\};} \newline |
| 170 |
\texttt{\textbackslash{}node [collapsed subprocess] \{A\};} |
| 171 |
\\ |
| 172 |
\begin{tikzpicture}[baseline] |
| 173 |
\node [adhoc subprocess] {A}; |
| 174 |
\end{tikzpicture} |
| 175 |
& |
| 176 |
\texttt{\textbackslash{}node [adhoc subprocess] \{A\};} \newline |
| 177 |
\texttt{\textbackslash{}node [collapsed adhoc subprocess] \{A\};} |
| 178 |
\\ |
| 179 |
\begin{tikzpicture}[baseline] |
| 180 |
\node [compensation subprocess] {A}; |
| 181 |
\end{tikzpicture} |
| 182 |
& |
| 183 |
\texttt{\textbackslash{}node [compensation subprocess] \{A\};} \newline |
| 184 |
\texttt{\textbackslash{}node [collapsed compensation subprocess] \{A\};} |
| 185 |
\\ |
| 186 |
\begin{tikzpicture}[baseline] |
| 187 |
\node [loop subprocess] {A}; |
| 188 |
\end{tikzpicture} |
| 189 |
& |
| 190 |
\texttt{\textbackslash{}node [loop subprocess] \{A\};} \newline |
| 191 |
\texttt{\textbackslash{}node [collapsed loop subprocess] \{A\};} \newline |
| 192 |
requires the \texttt{amssymb} and \texttt{amsmath} packages |
| 193 |
\\ |
| 194 |
\begin{tikzpicture}[baseline] |
| 195 |
\node [multiinstance subprocess] {A}; |
| 196 |
\end{tikzpicture} |
| 197 |
& |
| 198 |
\texttt{\textbackslash{}node [multiinstance subprocess] \{A\};} \newline |
| 199 |
\texttt{\textbackslash{}node [collapsed multiinstance subprocess] \{A\};} |
| 200 |
\\ |
| 201 |
|
| 202 |
\midrule |
| 203 |
|
| 204 |
\multirow{2}{*}{\begin{tikzpicture}[baseline] |
| 205 |
\node [expanded subprocess] {}; |
| 206 |
\end{tikzpicture}} |
| 207 |
& |
| 208 |
\texttt{\textbackslash{}node [expanded subprocess] \{\};}\newline |
| 209 |
use in combination with the \verb=fit= key |
| 210 |
\\ |
| 211 |
\begin{tikzpicture}[baseline] |
| 212 |
\node [expanded adhoc subprocess] {}; |
| 213 |
\end{tikzpicture} |
| 214 |
& |
| 215 |
\texttt{\textbackslash{}node [expanded adhoc subprocess] \{\};}\newline |
| 216 |
use in combination with the \verb=fit= key |
| 217 |
\\ |
| 218 |
\begin{tikzpicture}[baseline] |
| 219 |
\node [expanded compensation subprocess] {}; |
| 220 |
\end{tikzpicture} |
| 221 |
& |
| 222 |
\texttt{\textbackslash{}node [expanded compensation subprocess] \{\};}\newline |
| 223 |
use in combination with the \verb=fit= key |
| 224 |
\\ |
| 225 |
\begin{tikzpicture}[baseline] |
| 226 |
\node [expanded loop subprocess] {}; |
| 227 |
\end{tikzpicture} |
| 228 |
& |
| 229 |
\texttt{\textbackslash{}node [expanded loop subprocess] \{\};}\newline |
| 230 |
use in combination with the \verb=fit= key |
| 231 |
\\ |
| 232 |
\begin{tikzpicture}[baseline] |
| 233 |
\node [expanded multiinstance subprocess] {}; |
| 234 |
\end{tikzpicture} |
| 235 |
& |
| 236 |
\texttt{\textbackslash{}node [expanded multiinstance subprocess] \{\};}\newline |
| 237 |
use in combination with the \verb=fit= key |
| 238 |
\\ |
| 239 |
\begin{tikzpicture}[baseline] |
| 240 |
\node [subprocess label=A] {}; |
| 241 |
\end{tikzpicture} |
| 242 |
& |
| 243 |
\texttt{\textbackslash{}node [subprocess label=A] \{\};}\newline |
| 244 |
use in combination with the \verb=fit= key |
| 245 |
\\ |
| 246 |
\bottomrule |
| 247 |
\end{tabularx} |
| 248 |
|
| 249 |
\subsection{Event sub-processes} |
| 250 |
\begin{tabularx}{\linewidth}{cX} |
| 251 |
\toprule |
| 252 |
Symbol & code\\ |
| 253 |
\midrule |
| 254 |
\event{message subprocess event}\\ |
| 255 |
\event{timer subprocess event}\\ |
| 256 |
\event{signal subprocess event}\\ |
| 257 |
\event{compensation subprocess event}\\ |
| 258 |
\event{error subprocess event}\\ |
| 259 |
\midrule |
| 260 |
\event{message noninterrupting subprocess event}\\ |
| 261 |
\event{timer noninterrupting subprocess event}\\ |
| 262 |
\event{signal noninterrupting subprocess event}\\ |
| 263 |
\midrule |
| 264 |
\event{message event subprocess}\\ |
| 265 |
\event{timer event subprocess}\\ |
| 266 |
\event{signal event subprocess}\\ |
| 267 |
\event{compensation event subprocess}\\ |
| 268 |
\event{error event subprocess}\\ |
| 269 |
\midrule |
| 270 |
\event{message noninterrupting event subprocess}\\ |
| 271 |
\event{timer noninterrupting event subprocess}\\ |
| 272 |
\event{signal noninterrupting event subprocess}\\ |
| 273 |
\bottomrule |
| 274 |
\end{tabularx} |
| 275 |
|
| 276 |
\subsection{Boundary events} |
| 277 |
In the following, the number 225 controls the position of the boundary event (in degrees). |
| 278 |
Naturally, a label can be used on any node. |
| 279 |
To connect associations to a label, use the style \texttt{name=}. |
| 280 |
|
| 281 |
\noindent\begin{tabularx}{\linewidth}{cX} |
| 282 |
\toprule |
| 283 |
Symbol & code\\ |
| 284 |
\midrule |
| 285 |
\boundary{timer boundary event}\\ |
| 286 |
\boundary{message boundary event}\\ |
| 287 |
\boundary{signal boundary event}\\ |
| 288 |
\boundary{compensation boundary event}\\ |
| 289 |
\boundary{error boundary event}\\ |
| 290 |
\boundary{timer noninterrupting boundary event}\\ |
| 291 |
\boundary{message noninterrupting boundary event}\\ |
| 292 |
\boundary{signal noninterrupting boundary event}\\ |
| 293 |
\bottomrule |
| 294 |
\end{tabularx} |
| 295 |
|
| 296 |
All boundary events use fill to draw over the border of the parent node, and accept an argument for the fill colour. |
| 297 |
The default fill colour can be changed using \verb=\colorlet{defaultbackgroundcolour}{new default colour}= after loading the package. |
| 298 |
|
| 299 |
\subsection{Data} |
| 300 |
\begin{tabularx}{\linewidth}{cX} |
| 301 |
\toprule |
| 302 |
Symbol & code\\ |
| 303 |
\midrule |
| 304 |
\event{data object}\\ |
| 305 |
\event{data collection}\\ |
| 306 |
\event{data store}\\ |
| 307 |
\bottomrule |
| 308 |
\end{tabularx} |
| 309 |
|
| 310 |
|
| 311 |
\subsection{Resources} |
| 312 |
\begin{tabularx}{\linewidth}{cX} |
| 313 |
\toprule |
| 314 |
Symbol & code\\ |
| 315 |
\midrule |
| 316 |
\begin{tikzpicture}[baseline] |
| 317 |
\node [pool] {\phantom{ABCDEF}\strut}; |
| 318 |
\end{tikzpicture} |
| 319 |
& |
| 320 |
\texttt{\textbackslash{}node [pool] \{\};} \newline |
| 321 |
use in combination with the \verb=fit= key |
| 322 |
\\ |
| 323 |
\begin{tikzpicture}[baseline] |
| 324 |
\node [pool label=A] {\phantom{ABCDEF}\strut}; |
| 325 |
\end{tikzpicture} |
| 326 |
& |
| 327 |
\texttt{\textbackslash{}node [pool label=A] \{\};} \newline |
| 328 |
use in combination with the \verb=fit= key |
| 329 |
\\ |
| 330 |
\bottomrule |
| 331 |
\end{tabularx} |
| 332 |
|
| 333 |
\end{document} |