diff --git a/part-customization.tex b/part-customization.tex index 103d7b7..826ba6e 100644 --- a/part-customization.tex +++ b/part-customization.tex @@ -59,41 +59,34 @@ \section{Workflow configuration} will be \texttt{posted}. E-mailing an invoice does not change its state: it remains posted. Instead, a new workflow is created which manages state of the e-mail. - \IfFileExists{./wf1.pdf}{ - \begin{figure}[H] - \centering - % \includegraphics[width=0.8\textwidth]{dmc-create-step1.png} - % HTML processing does not handle cropping of this image, need to figure out why? - % \includegraphics[width=\graphicswidth, trim={0pt 50 0 0}, clip]{\autoscreenshotdir/setup-pl-login.png} - \includegraphics[width=\graphicswidth]{wf1.pdf} - \caption{Workflow triggered from another workflow} - \label{fig:triggered-workflow} - \end{figure} -}{ - \begin{figure} - \digraph[scale=0.4]{wf1}{ - rankdir=LR; - subgraph invoice { - graph [label="Invoice"]; - cluster = true; - saved -> posted [label="post"]; - posted -> reversed [label="reverse"]; - }; - - subgraph email { - graph [label="email"]; - cluster = true; - created -> sent [label="send"]; - }; - - posted -> created [label="e-mail"]; - posted -> posted [label="e-mail"]; - +\begin{figure}[H] +\centering +\ifpdf + % File existence check is needed to keep from having an infinit loop + % Each pdf creation changes the hash, so latexmk never completes + \IfFileExists{wf1.pdf} {} { + \digraph[scale=0.4]{wf1}{ + rankdir=LR; + subgraph invoice { + graph [label="Invoice"]; + cluster = true; + saved -> posted [label="post"]; + posted -> reversed [label="reverse"]; + }; + subgraph email { + graph [label="email"]; + cluster = true; + created -> sent [label="send"]; + }; + posted -> created [label="e-mail"]; + posted -> posted [label="e-mail"]; + } } - \caption{Workflow triggered from another workflow} - \label{fig:triggered-workflow} - \end{figure} -} +\fi +\includegraphics[width=\graphicswidth]{wf1.pdf} +\caption{Workflow triggered from another workflow} +\label{fig:triggered-workflow} +\end{figure} Actions belonging to a state may (or may not) be available. This is determined by one or more conditions. Examples are ``is the posting date of the transaction in a closed period'' @@ -115,18 +108,12 @@ \section{Workflow configuration} By adding a condition on this action, it can be made required for invoices over 100.000 USD (but not for other invoices). -\IfFileExists{./wf2.pdf}{ - \begin{figure}[H] - \centering - % \includegraphics[width=0.8\textwidth]{dmc-create-step1.png} - % HTML processing does not handle cropping of this image, need to figure out why? - % \includegraphics[width=\graphicswidth, trim={0pt 50 0 0}, clip]{\autoscreenshotdir/setup-pl-login.png} - \includegraphics[width=\graphicswidth]{wf2.pdf} - \caption{Conditional workflow actions} - \label{fig:conditional-workflows} - \end{figure} -}{ - \begin{figure} +\begin{figure}[H] +\centering +\ifpdf + % File existence check is needed to keep from having an infinit loop + % Each pdf creation changes the hash, so latexmk never completes + \IfFileExists{wf2.pdf} {} { \digraph[scale=0.4]{wf2}{ rankdir=LR; subgraph invoice { @@ -138,10 +125,12 @@ \section{Workflow configuration} posted -> reversed [label="reverse"] } } - \caption{Conditional workflow actions} - \label{fig:conditional-workflows} - \end{figure} -} + } +\fi +\includegraphics[width=\graphicswidth]{wf2.pdf} +\caption{Conditional workflow actions} +\label{fig:conditional-workflows} +\end{figure} By changing association of the \texttt{save} action with its code, the application will act differently when saving the invoice. Customizations may associate new behaviors with existing diff --git a/scripts/local-build.sh b/scripts/local-build.sh index 926f5a2..fcb8962 100755 --- a/scripts/local-build.sh +++ b/scripts/local-build.sh @@ -32,9 +32,11 @@ if [[ $1 = '--use-pdf-latex' ]]; then elif [[ $1 = '--use-latex-mk' ]]; then # Only builds files that have changed + # Have to use '-shell-escape' in order to build graphviz's dot files + # latexmk takes 3 runs to complete as of 26 Nov 2024 # -diagnostics \ - latexmk -dvi- \ + -shell-escape \ -interaction=nonstopmode \ -pdf \ -silent \ diff --git a/wf1.dot b/wf1.dot index 44d14bd..c454ebd 100644 --- a/wf1.dot +++ b/wf1.dot @@ -1,19 +1 @@ -digraph wf1 { -rankdir=LR; -subgraph invoice { -graph [label="Invoice"]; -cluster = true; -saved -> posted [label="post"]; -posted -> reversed [label="reverse"]; -}; - -subgraph email { -graph [label="email"]; -cluster = true; -created -> sent [label="send"]; -}; - -posted -> created [label="e-mail"]; -posted -> posted [label="e-mail"]; - -} +digraph wf1 { rankdir=LR; subgraph invoice { graph [label="Invoice"]; cluster = true; saved -> posted [label="post"]; posted -> reversed [label="reverse"]; }; subgraph email { graph [label="email"]; cluster = true; created -> sent [label="send"]; }; posted -> created [label="e-mail"]; posted -> posted [label="e-mail"]; } diff --git a/wf1.pdf b/wf1.pdf index 26a35da..6135df2 100644 Binary files a/wf1.pdf and b/wf1.pdf differ diff --git a/wf2.dot b/wf2.dot index 2a1134f..57b4171 100644 --- a/wf2.dot +++ b/wf2.dot @@ -1,11 +1 @@ -digraph wf2 { -rankdir=LR; -subgraph invoice { -graph [label="Invoice"]; -cluster=true; -saved -> posted [label="post (<100.000)"]; -saved -> submitted [label="submit (>100.000)"]; -submitted -> posted [label="post"]; -posted -> reversed [label="reverse"] -} -} +digraph wf2 { rankdir=LR; subgraph invoice { graph [label="Invoice"]; cluster=true; saved -> posted [label="post (<100.000)"]; saved -> submitted [label="submit (>100.000)"]; submitted -> posted [label="post"]; posted -> reversed [label="reverse"] } } diff --git a/wf2.pdf b/wf2.pdf index 0216435..ba12b78 100644 Binary files a/wf2.pdf and b/wf2.pdf differ