-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
46 lines (38 loc) · 1006 Bytes
/
main.go
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
package main
import (
"fmt"
"os"
"github.com/rs/zerolog/log"
"github.com/beam/core/pkg/parser"
)
func main() {
/*dict := make(map[string]states.WorkflowState)
dict["1"] = states.NewTask("Fun1", "", "", false)
dict["2"] = states.NewWait("Fun2", "", "", false)
dict["3"] = states.NewChoice(nil, "Fun3", "", "", false)
for _, value := range dict {
tp := value.Type()
switch tp {
case states.Task:
tk := value.(*states.TaskState)
fmt.Println("Task Name = ", tk.Name())
case states.Wait:
wt := value.(*states.WaitState)
fmt.Println("Wait Name = ", wt.Name())
case states.Cond:
cd := value.(*states.ChoiceState)
fmt.Println("Condition Name = ", cd.Name(), cd.Conditions())
default:
fmt.Println("Invalid state")
}
}*/
file, err := os.Open("resources/RE2RE.json")
if err != nil {
log.Error().Msg("Cannot Read File = " + err.Error())
os.Exit(0)
}
defer file.Close()
p := parser.NewJsonParser()
res, _ := p.CreateWorkflowGraph(file)
fmt.Println(res)
}