1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
{-# OPTIONS_CYMAKE -Wno-overlapping #-}
module BPMNParser where
import Prelude hiding ( (*>) )
import Grappa
process :: Grappa String ()
process = edge ("start", [n1]) *>
flow (n1,n2) *>
edge ("end", [n2])
where n1,n2 free
flow :: (Node,Node) -> Grappa String ()
flow (n1,n2) = flElem (n1,n2)
flow (n1,n2) = flElem (n1,n) *>
flow (n,n2)
where n free
flElem :: (Node,Node) -> Grappa String ()
flElem (n1,n2) = edge ("act", [n1,n2])
flElem (n1,n2) = edge ("inter", [n1,n2])
flElem (n1,n2) = edge ("pgw", [n1,n1t,n1r,n1b]) *>
flow (n1t,n2t) *>
edge ("pgw", [n2l,n2t,n2,n2b]) *>
flow (n1b,n2b)
where n1t,n1r,n1b,n2l,n2t,n2b free
flElem (n1,n2) = edge ("xgw", [n1,n1t,n1r,n1b]) *>
flow (n1t,n2t) *>
edge ("xgw", [n2l,n2t,n2,n2b]) *>
flow (n1b,n2b)
where n1t,n1r,n1b,n2l,n2t,n2b free
ex_sm :: Graph String
ex_sm = [("start", [1]), ("pgw", [1,2,4,3]), ("act", [2,6]),
("act", [3,7]), ("pgw", [5,6,8,7]), ("end", [8])]
|