sync/gen_dot.ysl2
author Krista 'DarthMama' Bennett <krista@pep.foundation>
Tue, 09 Apr 2019 09:26:27 +0200
changeset 3473 9cd6a0ad3c74
parent 2287 026ab4dae779
child 2829 e444c3c960bb
permissions -rw-r--r--
ENGINE-538: added DB repair to default - no use risking it.
     1 // This file is under GNU General Public License 3.0
     2 // see LICENSE.txt
     3 
     4 include yslt.yml2
     5 
     6 tstylesheet {
     7     template "protocol/fsm" document "{@filename}.dot", "text"
     8     ||
     9     digraph finite_state_machine {
    10         rankdir=LR;
    11         node [shape = doublecircle];
    12         `apply "state[@end='1']" mode=end`;
    13         node [shape = circle];
    14 
    15         `` apply "state" mode=do
    16     }
    17     ||
    18 
    19     template "state", mode=end > «@name» 
    20     template "state", mode=do apply "event", 0 with "state", "@name";
    21 
    22     template "event" {
    23         param "state";
    24         const "transitions", "transition|descendant::condition/transition|descendant::alternative/transition";
    25         choose {
    26             when "count($transitions) > 0"
    27                 apply "$transitions", 0
    28                     with "state", "$state", with "event", "@name";
    29             otherwise
    30                 if "@name != 'Init'"
    31                     | «$state» -> «$state» [ label="«@name»" ];
    32         }
    33     }
    34 
    35     template "transition" {
    36         param "state";
    37         param "event";
    38 
    39         | «$state» -> «@target» [ label ="«$event»" ];
    40     }
    41 }
    42