<div class="page"> <div class="cover text-center"> <img class="mx-auto" src=/itb/images/logo_mislata.png alt="logo"> # Estats: Caixer automàtic <div class="text-end fit-content ms-auto my-3 mt-auto pt-3"> <p><strong>Autor:</strong> Joan Puigcerver Ibáñez</p> <p><strong>Correu electrònic:</strong> j.puigcerveribanez@edu.gva.es</p> <p><strong>Curs:</strong> 2024/2025</p> </div> <div> <p class="fw-bold mb-0">Llicència: BY-NC-SA</p> <p class="d-none d-md-block">(Reconeixement - No Comercial - Compartir Igual)</p> <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.ca" target="_blank"> <img class="mx-auto" src="/itb/images/license.png" alt="Licence"/> </a> </div><!--license--> </div><!--cover--> </div><!--page--> {:toc} ## Descripció de l'exemple Aquest exemple modela els estats en els quals es pot trobar un caixer automàtic. ## Diagrama <div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="{&quot;highlight&quot;:&quot;#0000ff&quot;,&quot;nav&quot;:true,&quot;resize&quot;:true,&quot;toolbar&quot;:&quot;zoom layers tags lightbox&quot;,&quot;edit&quot;:&quot;_blank&quot;,&quot;xml&quot;:&quot;&lt;mxfile host=\&quot;app.diagrams.net\&quot; modified=\&quot;2024-04-22T09:46:18.797Z\&quot; agent=\&quot;Mozilla&#x2F;5.0 (X11; Linux x86_64) AppleWebKit&#x2F;537.36 (KHTML, like Gecko) Chrome&#x2F;123.0.0.0 Safari&#x2F;537.36\&quot; etag=\&quot;048Vx4bTJ4ZO5uxlu6Yj\&quot; version=\&quot;24.2.7\&quot; type=\&quot;google\&quot;&gt;\n &lt;diagram name=\&quot;Page-1\&quot; id=\&quot;2YBvvXClWsGukQMizWep\&quot;&gt;\n &lt;mxGraphModel dx=\&quot;2074\&quot; dy=\&quot;1114\&quot; grid=\&quot;1\&quot; gridSize=\&quot;10\&quot; guides=\&quot;1\&quot; tooltips=\&quot;1\&quot; connect=\&quot;1\&quot; arrows=\&quot;1\&quot; fold=\&quot;1\&quot; page=\&quot;1\&quot; pageScale=\&quot;1\&quot; pageWidth=\&quot;850\&quot; pageHeight=\&quot;1100\&quot; math=\&quot;0\&quot; shadow=\&quot;0\&quot;&gt;\n &lt;root&gt;\n &lt;mxCell id=\&quot;0\&quot; &#x2F;&gt;\n &lt;mxCell id=\&quot;1\&quot; parent=\&quot;0\&quot; &#x2F;&gt;\n &lt;mxCell id=\&quot;Wbr10UhurKWa1ZI_zyCr-31\&quot; style=\&quot;edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;\&quot; parent=\&quot;1\&quot; source=\&quot;Wbr10UhurKWa1ZI_zyCr-1\&quot; target=\&quot;rUmXZGd3vIKuDlGXPuo1-1\&quot; edge=\&quot;1\&quot;&gt;\n &lt;mxGeometry relative=\&quot;1\&quot; as=\&quot;geometry\&quot;&gt;\n &lt;mxPoint x=\&quot;200\&quot; y=\&quot;160\&quot; as=\&quot;targetPoint\&quot; &#x2F;&gt;\n &lt;&#x2F;mxGeometry&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;Wbr10UhurKWa1ZI_zyCr-1\&quot; value=\&quot;\&quot; style=\&quot;ellipse;html=1;shape=startState;fillColor=#000000;strokeColor=#ff0000;\&quot; parent=\&quot;1\&quot; vertex=\&quot;1\&quot;&gt;\n &lt;mxGeometry x=\&quot;185\&quot; y=\&quot;90\&quot; width=\&quot;30\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot; &#x2F;&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;Wbr10UhurKWa1ZI_zyCr-30\&quot; style=\&quot;edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;\&quot; parent=\&quot;1\&quot; source=\&quot;rUmXZGd3vIKuDlGXPuo1-2\&quot; target=\&quot;rUmXZGd3vIKuDlGXPuo1-4\&quot; edge=\&quot;1\&quot;&gt;\n &lt;mxGeometry relative=\&quot;1\&quot; as=\&quot;geometry\&quot;&gt;\n &lt;mxPoint x=\&quot;200\&quot; y=\&quot;200\&quot; as=\&quot;sourcePoint\&quot; &#x2F;&gt;\n &lt;mxPoint x=\&quot;200\&quot; y=\&quot;410\&quot; as=\&quot;targetPoint\&quot; &#x2F;&gt;\n &lt;&#x2F;mxGeometry&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;Wbr10UhurKWa1ZI_zyCr-18\&quot; value=\&quot;Targeta invàlida\&quot; style=\&quot;edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;\&quot; parent=\&quot;1\&quot; source=\&quot;rUmXZGd3vIKuDlGXPuo1-4\&quot; target=\&quot;rUmXZGd3vIKuDlGXPuo1-21\&quot; edge=\&quot;1\&quot;&gt;\n &lt;mxGeometry x=\&quot;-0.7403\&quot; y=\&quot;15\&quot; relative=\&quot;1\&quot; as=\&quot;geometry\&quot;&gt;\n &lt;mxPoint x=\&quot;260\&quot; y=\&quot;430\&quot; as=\&quot;sourcePoint\&quot; &#x2F;&gt;\n &lt;mxPoint x=\&quot;470\&quot; y=\&quot;655\&quot; as=\&quot;targetPoint\&quot; &#x2F;&gt;\n &lt;mxPoint as=\&quot;offset\&quot; &#x2F;&gt;\n &lt;&#x2F;mxGeometry&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;Wbr10UhurKWa1ZI_zyCr-21\&quot; value=\&quot;Targeta vàlida\&quot; style=\&quot;edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;\&quot; parent=\&quot;1\&quot; source=\&quot;rUmXZGd3vIKuDlGXPuo1-5\&quot; target=\&quot;rUmXZGd3vIKuDlGXPuo1-8\&quot; edge=\&quot;1\&quot;&gt;\n &lt;mxGeometry x=\&quot;-0.4286\&quot; y=\&quot;40\&quot; relative=\&quot;1\&quot; as=\&quot;geometry\&quot;&gt;\n &lt;mxPoint x=\&quot;200\&quot; y=\&quot;450\&quot; as=\&quot;sourcePoint\&quot; &#x2F;&gt;\n &lt;mxPoint x=\&quot;200\&quot; y=\&quot;570\&quot; as=\&quot;targetPoint\&quot; &#x2F;&gt;\n &lt;mxPoint as=\&quot;offset\&quot; &#x2F;&gt;\n &lt;&#x2F;mxGeometry&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;Wbr10UhurKWa1ZI_zyCr-22\&quot; value=\&quot;PIN invàlid\&quot; style=\&quot;edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.25;entryY=0;entryDx=0;entryDy=0;\&quot; parent=\&quot;1\&quot; source=\&quot;rUmXZGd3vIKuDlGXPuo1-8\&quot; target=\&quot;rUmXZGd3vIKuDlGXPuo1-21\&quot; edge=\&quot;1\&quot;&gt;\n &lt;mxGeometry x=\&quot;-0.6596\&quot; y=\&quot;15\&quot; relative=\&quot;1\&quot; as=\&quot;geometry\&quot;&gt;\n &lt;mxPoint x=\&quot;260\&quot; y=\&quot;590\&quot; as=\&quot;sourcePoint\&quot; &#x2F;&gt;\n &lt;mxPoint x=\&quot;440\&quot; y=\&quot;655\&quot; as=\&quot;targetPoint\&quot; &#x2F;&gt;\n &lt;mxPoint as=\&quot;offset\&quot; &#x2F;&gt;\n &lt;&#x2F;mxGeometry&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;Wbr10UhurKWa1ZI_zyCr-24\&quot; value=\&quot;PIN vàlid\&quot; style=\&quot;edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;\&quot; parent=\&quot;1\&quot; source=\&quot;rUmXZGd3vIKuDlGXPuo1-8\&quot; target=\&quot;rUmXZGd3vIKuDlGXPuo1-10\&quot; edge=\&quot;1\&quot;&gt;\n &lt;mxGeometry x=\&quot;-0.5\&quot; y=\&quot;40\&quot; relative=\&quot;1\&quot; as=\&quot;geometry\&quot;&gt;\n &lt;mxPoint x=\&quot;200\&quot; y=\&quot;610\&quot; as=\&quot;sourcePoint\&quot; &#x2F;&gt;\n &lt;mxPoint x=\&quot;200\&quot; y=\&quot;700\&quot; as=\&quot;targetPoint\&quot; &#x2F;&gt;\n &lt;mxPoint as=\&quot;offset\&quot; &#x2F;&gt;\n &lt;&#x2F;mxGeometry&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;Wbr10UhurKWa1ZI_zyCr-25\&quot; value=\&quot;Operació&amp;lt;br&amp;gt;cancelada\&quot; style=\&quot;edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;\&quot; parent=\&quot;1\&quot; source=\&quot;rUmXZGd3vIKuDlGXPuo1-10\&quot; target=\&quot;rUmXZGd3vIKuDlGXPuo1-21\&quot; edge=\&quot;1\&quot;&gt;\n &lt;mxGeometry x=\&quot;-0.4\&quot; y=\&quot;-25\&quot; relative=\&quot;1\&quot; as=\&quot;geometry\&quot;&gt;\n &lt;mxPoint x=\&quot;260\&quot; y=\&quot;720\&quot; as=\&quot;sourcePoint\&quot; &#x2F;&gt;\n &lt;mxPoint x=\&quot;380\&quot; y=\&quot;675\&quot; as=\&quot;targetPoint\&quot; &#x2F;&gt;\n &lt;mxPoint as=\&quot;offset\&quot; &#x2F;&gt;\n &lt;&#x2F;mxGeometry&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;Wbr10UhurKWa1ZI_zyCr-27\&quot; value=\&quot;Operació&amp;lt;br&amp;gt;seleccionada\&quot; style=\&quot;edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;\&quot; parent=\&quot;1\&quot; source=\&quot;rUmXZGd3vIKuDlGXPuo1-10\&quot; target=\&quot;rUmXZGd3vIKuDlGXPuo1-13\&quot; edge=\&quot;1\&quot;&gt;\n &lt;mxGeometry x=\&quot;-0.4286\&quot; y=\&quot;40\&quot; relative=\&quot;1\&quot; as=\&quot;geometry\&quot;&gt;\n &lt;mxPoint x=\&quot;200\&quot; y=\&quot;740\&quot; as=\&quot;sourcePoint\&quot; &#x2F;&gt;\n &lt;mxPoint x=\&quot;200\&quot; y=\&quot;780\&quot; as=\&quot;targetPoint\&quot; &#x2F;&gt;\n &lt;Array as=\&quot;points\&quot; &#x2F;&gt;\n &lt;mxPoint as=\&quot;offset\&quot; &#x2F;&gt;\n &lt;&#x2F;mxGeometry&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;Wbr10UhurKWa1ZI_zyCr-28\&quot; value=\&quot;Una altra operació\&quot; style=\&quot;edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;\&quot; parent=\&quot;1\&quot; source=\&quot;rUmXZGd3vIKuDlGXPuo1-16\&quot; target=\&quot;rUmXZGd3vIKuDlGXPuo1-10\&quot; edge=\&quot;1\&quot;&gt;\n &lt;mxGeometry x=\&quot;-0.7333\&quot; y=\&quot;-20\&quot; relative=\&quot;1\&quot; as=\&quot;geometry\&quot;&gt;\n &lt;mxPoint x=\&quot;70\&quot; y=\&quot;950\&quot; as=\&quot;sourcePoint\&quot; &#x2F;&gt;\n &lt;mxPoint x=\&quot;60\&quot; y=\&quot;710\&quot; as=\&quot;targetPoint\&quot; &#x2F;&gt;\n &lt;Array as=\&quot;points\&quot;&gt;\n &lt;mxPoint x=\&quot;70\&quot; y=\&quot;950\&quot; &#x2F;&gt;\n &lt;mxPoint x=\&quot;70\&quot; y=\&quot;675\&quot; &#x2F;&gt;\n &lt;&#x2F;Array&gt;\n &lt;mxPoint x=\&quot;-20\&quot; y=\&quot;20\&quot; as=\&quot;offset\&quot; &#x2F;&gt;\n &lt;&#x2F;mxGeometry&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;Wbr10UhurKWa1ZI_zyCr-29\&quot; value=\&quot;Finalitzar operació\&quot; style=\&quot;edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;\&quot; parent=\&quot;1\&quot; source=\&quot;rUmXZGd3vIKuDlGXPuo1-16\&quot; target=\&quot;rUmXZGd3vIKuDlGXPuo1-21\&quot; edge=\&quot;1\&quot;&gt;\n &lt;mxGeometry x=\&quot;-0.7108\&quot; y=\&quot;20\&quot; relative=\&quot;1\&quot; as=\&quot;geometry\&quot;&gt;\n &lt;mxPoint x=\&quot;260\&quot; y=\&quot;800\&quot; as=\&quot;sourcePoint\&quot; &#x2F;&gt;\n &lt;mxPoint x=\&quot;440\&quot; y=\&quot;695\&quot; as=\&quot;targetPoint\&quot; &#x2F;&gt;\n &lt;mxPoint as=\&quot;offset\&quot; &#x2F;&gt;\n &lt;&#x2F;mxGeometry&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;rUmXZGd3vIKuDlGXPuo1-1\&quot; value=\&quot;En espera (Idle)\&quot; style=\&quot;swimlane;fontStyle=1;align=center;verticalAlign=middle;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=0;resizeLast=1;container=0;fontColor=#000000;collapsible=0;rounded=1;arcSize=30;strokeColor=#ff0000;fillColor=#ffffc0;swimlaneFillColor=#ffffc0;dropTarget=0;\&quot; parent=\&quot;1\&quot; vertex=\&quot;1\&quot;&gt;\n &lt;mxGeometry x=\&quot;120\&quot; y=\&quot;160\&quot; width=\&quot;160\&quot; height=\&quot;60\&quot; as=\&quot;geometry\&quot; &#x2F;&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;rUmXZGd3vIKuDlGXPuo1-2\&quot; value=\&quot;&amp;lt;b&amp;gt;do&#x2F; &amp;lt;&#x2F;b&amp;gt;Mostrar informació\&quot; style=\&quot;text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;spacingLeft=4;spacingRight=4;whiteSpace=wrap;overflow=hidden;rotatable=0;fontColor=#000000;\&quot; parent=\&quot;rUmXZGd3vIKuDlGXPuo1-1\&quot; vertex=\&quot;1\&quot;&gt;\n &lt;mxGeometry y=\&quot;30\&quot; width=\&quot;160\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot; &#x2F;&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;rUmXZGd3vIKuDlGXPuo1-4\&quot; value=\&quot;Llegint targeta\&quot; style=\&quot;swimlane;fontStyle=1;align=center;verticalAlign=middle;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=0;resizeLast=1;container=0;fontColor=#000000;collapsible=0;rounded=1;arcSize=30;strokeColor=#ff0000;fillColor=#ffffc0;swimlaneFillColor=#ffffc0;dropTarget=0;\&quot; parent=\&quot;1\&quot; vertex=\&quot;1\&quot;&gt;\n &lt;mxGeometry x=\&quot;120\&quot; y=\&quot;270\&quot; width=\&quot;160\&quot; height=\&quot;130\&quot; as=\&quot;geometry\&quot; &#x2F;&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;rUmXZGd3vIKuDlGXPuo1-5\&quot; value=\&quot;&amp;lt;b&amp;gt;entry&#x2F; &amp;lt;&#x2F;b&amp;gt;Realitzar petició de comprovació al servidor&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;do&#x2F; &amp;lt;&#x2F;b&amp;gt;Mostrar &amp;quot;Comprovant targeta...&amp;quot;&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;exit&#x2F; &amp;lt;&#x2F;b&amp;gt;Mostrar resultat comprovació\&quot; style=\&quot;text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;spacingLeft=4;spacingRight=4;whiteSpace=wrap;overflow=hidden;rotatable=0;fontColor=#000000;\&quot; parent=\&quot;rUmXZGd3vIKuDlGXPuo1-4\&quot; vertex=\&quot;1\&quot;&gt;\n &lt;mxGeometry y=\&quot;30\&quot; width=\&quot;160\&quot; height=\&quot;100\&quot; as=\&quot;geometry\&quot; &#x2F;&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;rUmXZGd3vIKuDlGXPuo1-8\&quot; value=\&quot;Comprovant PIN\&quot; style=\&quot;swimlane;fontStyle=1;align=center;verticalAlign=middle;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=0;resizeLast=1;container=0;fontColor=#000000;collapsible=0;rounded=1;arcSize=30;strokeColor=#ff0000;fillColor=#ffffc0;swimlaneFillColor=#ffffc0;dropTarget=0;\&quot; parent=\&quot;1\&quot; vertex=\&quot;1\&quot;&gt;\n &lt;mxGeometry x=\&quot;120\&quot; y=\&quot;470\&quot; width=\&quot;160\&quot; height=\&quot;130\&quot; as=\&quot;geometry\&quot; &#x2F;&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;rUmXZGd3vIKuDlGXPuo1-9\&quot; value=\&quot;&amp;lt;b&amp;gt;entry&#x2F; &amp;lt;&#x2F;b&amp;gt;Realitzar petició de comprovació al servidor&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;do&#x2F; &amp;lt;&#x2F;b&amp;gt;Mostrar &amp;quot;Comprovant PIN...&amp;quot;&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;exit&#x2F; &amp;lt;&#x2F;b&amp;gt;Mostrar resultat comprovació\&quot; style=\&quot;text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;spacingLeft=4;spacingRight=4;whiteSpace=wrap;overflow=hidden;rotatable=0;fontColor=#000000;\&quot; parent=\&quot;rUmXZGd3vIKuDlGXPuo1-8\&quot; vertex=\&quot;1\&quot;&gt;\n &lt;mxGeometry y=\&quot;30\&quot; width=\&quot;160\&quot; height=\&quot;100\&quot; as=\&quot;geometry\&quot; &#x2F;&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;rUmXZGd3vIKuDlGXPuo1-10\&quot; value=\&quot;Triant operació\&quot; style=\&quot;swimlane;fontStyle=1;align=center;verticalAlign=middle;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=0;resizeLast=1;container=0;fontColor=#000000;collapsible=0;rounded=1;arcSize=30;strokeColor=#ff0000;fillColor=#ffffc0;swimlaneFillColor=#ffffc0;dropTarget=0;\&quot; parent=\&quot;1\&quot; vertex=\&quot;1\&quot;&gt;\n &lt;mxGeometry x=\&quot;120\&quot; y=\&quot;640\&quot; width=\&quot;160\&quot; height=\&quot;70\&quot; as=\&quot;geometry\&quot; &#x2F;&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;rUmXZGd3vIKuDlGXPuo1-11\&quot; value=\&quot;&amp;lt;b&amp;gt;do&#x2F; &amp;lt;&#x2F;b&amp;gt;Mostrar operacions disponibles\&quot; style=\&quot;text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;spacingLeft=4;spacingRight=4;whiteSpace=wrap;overflow=hidden;rotatable=0;fontColor=#000000;\&quot; parent=\&quot;rUmXZGd3vIKuDlGXPuo1-10\&quot; vertex=\&quot;1\&quot;&gt;\n &lt;mxGeometry y=\&quot;30\&quot; width=\&quot;160\&quot; height=\&quot;40\&quot; as=\&quot;geometry\&quot; &#x2F;&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;rUmXZGd3vIKuDlGXPuo1-12\&quot; value=\&quot;&amp;lt;b&amp;gt;entry&#x2F; &amp;lt;&#x2F;b&amp;gt;Realitzar petició de comprovació al servidor&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;do&#x2F; &amp;lt;&#x2F;b&amp;gt;Mostrar &amp;quot;Comprovant PIN...&amp;quot;&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;exit&#x2F; &amp;lt;&#x2F;b&amp;gt;Mostrar resultat comprovació\&quot; style=\&quot;text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;spacingLeft=4;spacingRight=4;whiteSpace=wrap;overflow=hidden;rotatable=0;fontColor=#000000;\&quot; parent=\&quot;rUmXZGd3vIKuDlGXPuo1-10\&quot; vertex=\&quot;1\&quot;&gt;\n &lt;mxGeometry y=\&quot;70\&quot; width=\&quot;160\&quot; as=\&quot;geometry\&quot; &#x2F;&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;rUmXZGd3vIKuDlGXPuo1-13\&quot; value=\&quot;Realitzant operació\&quot; style=\&quot;swimlane;fontStyle=1;align=center;verticalAlign=middle;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=0;resizeLast=1;container=0;fontColor=#000000;collapsible=0;rounded=1;arcSize=30;strokeColor=#ff0000;fillColor=#ffffc0;swimlaneFillColor=#ffffc0;dropTarget=0;\&quot; parent=\&quot;1\&quot; vertex=\&quot;1\&quot;&gt;\n &lt;mxGeometry x=\&quot;120\&quot; y=\&quot;770\&quot; width=\&quot;160\&quot; height=\&quot;100\&quot; as=\&quot;geometry\&quot; &#x2F;&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;rUmXZGd3vIKuDlGXPuo1-14\&quot; value=\&quot;&amp;lt;b&amp;gt;do&#x2F; &amp;lt;&#x2F;b&amp;gt;Realitzar operació i mostrar missatge &amp;quot;Realitzant operació&amp;quot;\&quot; style=\&quot;text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;spacingLeft=4;spacingRight=4;whiteSpace=wrap;overflow=hidden;rotatable=0;fontColor=#000000;\&quot; parent=\&quot;rUmXZGd3vIKuDlGXPuo1-13\&quot; vertex=\&quot;1\&quot;&gt;\n &lt;mxGeometry y=\&quot;30\&quot; width=\&quot;160\&quot; height=\&quot;70\&quot; as=\&quot;geometry\&quot; &#x2F;&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;rUmXZGd3vIKuDlGXPuo1-16\&quot; value=\&quot;Operació finalitzada\&quot; style=\&quot;swimlane;fontStyle=1;align=center;verticalAlign=middle;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=0;resizeLast=1;container=0;fontColor=#000000;collapsible=0;rounded=1;arcSize=30;strokeColor=#ff0000;fillColor=#ffffc0;swimlaneFillColor=#ffffc0;dropTarget=0;\&quot; parent=\&quot;1\&quot; vertex=\&quot;1\&quot;&gt;\n &lt;mxGeometry x=\&quot;120\&quot; y=\&quot;900\&quot; width=\&quot;160\&quot; height=\&quot;100\&quot; as=\&quot;geometry\&quot; &#x2F;&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;rUmXZGd3vIKuDlGXPuo1-17\&quot; value=\&quot;&amp;lt;b&amp;gt;do&#x2F; &amp;lt;&#x2F;b&amp;gt;Mostrar missatge finalitzar o realitzar una altra operació\&quot; style=\&quot;text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;spacingLeft=4;spacingRight=4;whiteSpace=wrap;overflow=hidden;rotatable=0;fontColor=#000000;\&quot; parent=\&quot;rUmXZGd3vIKuDlGXPuo1-16\&quot; vertex=\&quot;1\&quot;&gt;\n &lt;mxGeometry y=\&quot;30\&quot; width=\&quot;160\&quot; height=\&quot;70\&quot; as=\&quot;geometry\&quot; &#x2F;&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;rUmXZGd3vIKuDlGXPuo1-19\&quot; style=\&quot;edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;\&quot; parent=\&quot;1\&quot; source=\&quot;rUmXZGd3vIKuDlGXPuo1-14\&quot; target=\&quot;rUmXZGd3vIKuDlGXPuo1-16\&quot; edge=\&quot;1\&quot;&gt;\n &lt;mxGeometry relative=\&quot;1\&quot; as=\&quot;geometry\&quot; &#x2F;&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;rUmXZGd3vIKuDlGXPuo1-25\&quot; style=\&quot;edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.75;exitY=0;exitDx=0;exitDy=0;\&quot; parent=\&quot;1\&quot; source=\&quot;rUmXZGd3vIKuDlGXPuo1-21\&quot; target=\&quot;rUmXZGd3vIKuDlGXPuo1-1\&quot; edge=\&quot;1\&quot;&gt;\n &lt;mxGeometry relative=\&quot;1\&quot; as=\&quot;geometry\&quot;&gt;\n &lt;Array as=\&quot;points\&quot;&gt;\n &lt;mxPoint x=\&quot;520\&quot; y=\&quot;190\&quot; &#x2F;&gt;\n &lt;&#x2F;Array&gt;\n &lt;&#x2F;mxGeometry&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;rUmXZGd3vIKuDlGXPuo1-21\&quot; value=\&quot;Expulsant targeta\&quot; style=\&quot;swimlane;fontStyle=1;align=center;verticalAlign=middle;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=0;resizeLast=1;container=0;fontColor=#000000;collapsible=0;rounded=1;arcSize=30;strokeColor=#ff0000;fillColor=#ffffc0;swimlaneFillColor=#ffffc0;dropTarget=0;\&quot; parent=\&quot;1\&quot; vertex=\&quot;1\&quot;&gt;\n &lt;mxGeometry x=\&quot;400\&quot; y=\&quot;625\&quot; width=\&quot;160\&quot; height=\&quot;100\&quot; as=\&quot;geometry\&quot; &#x2F;&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;mxCell id=\&quot;rUmXZGd3vIKuDlGXPuo1-22\&quot; value=\&quot;&amp;lt;b&amp;gt;entry&#x2F; &amp;lt;&#x2F;b&amp;gt;Expulsar targeta&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;do&#x2F; &amp;lt;&#x2F;b&amp;gt;Mostrar missatge &amp;quot;Agafe la targeta&amp;quot;\&quot; style=\&quot;text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;spacingLeft=4;spacingRight=4;whiteSpace=wrap;overflow=hidden;rotatable=0;fontColor=#000000;\&quot; parent=\&quot;rUmXZGd3vIKuDlGXPuo1-21\&quot; vertex=\&quot;1\&quot;&gt;\n &lt;mxGeometry y=\&quot;30\&quot; width=\&quot;160\&quot; height=\&quot;70\&quot; as=\&quot;geometry\&quot; &#x2F;&gt;\n &lt;&#x2F;mxCell&gt;\n &lt;&#x2F;root&gt;\n &lt;&#x2F;mxGraphModel&gt;\n &lt;&#x2F;diagram&gt;\n&lt;&#x2F;mxfile&gt;\n\n&quot;}"></div><script type="text/javascript" src="https://viewer.diagrams.net/js/viewer-static.min.js"></script> <figcaption>Figura 1: Diagrama d'estats d'un caixer automàtic</figcaption> Aquest diagrama comença a partir d'un estat inicial, que és l'estat __En espera__. En aquest estat, el caixer automàtic mostra informació general (`do`) fins que s'introduisca una targeta. Quan s'introdueix una targeta, es passa al següent estat: __Llegint targeta__, el qual realitza les següents accions: - `entry`: Just quan entra en aquest estat, es realitza una petició al servidor per realitzar una comprovació. - `do`: En aquest estat, el caixer automàtic espera la resposta de la petició i mostra el missatge "Comprovant targeta...". - `exit`: Quan s'haja comprovat la targeta, abans de canviar d'estat, es mostra un missatge amb el resultat de la comprovació. En cas que la targeta siga vàlida, es passa al estat __Comprovant PIN__. En cas negatiu, a l'estat __Expulsant targeta__. L'estat __Comprovant PIN__ té una estructura molt pareguda a l'estat __Comprovant tageta__. En cas que el PIN siga vàlid, passa a l'estat __Triant operació__. En l'estat __Triant operació__, es mostren per pantalla les operacions disponibles i s'espera que l'usuari seleccione una operació o la cancel·le. En cas de cancel·lar, s'expulsarà la targeta. Si es tria una operació, es passa a l'estat __Realitzant operació__, que realitzarà l'operació triada i mostrarà un missatge. Una vegada finalitzada l'operació, canviem d'estat a __Operació finalitzada__, que permetrà a l'usuari triar si dessitja realitzar una nova operació o finalitzar. Si decideix realitzar una nova operació, tornarà a l'estat __Triant operació__. Si dessitja finalitzar, expulsarà la targeta. Per últim, es pot arribar l'estat __Expulsant targeta__ per diferents camins. Independentment del camí pel qual s'arribe a aquest estat, el caixer automàtic realitzarà les següents accions: - `entry`: Expulsarà la targeta del caixer. - `do`: Mostrarà un missatge a l'usuari perquè retire la targeta.