-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtraces.go
More file actions
129 lines (92 loc) · 2.82 KB
/
traces.go
File metadata and controls
129 lines (92 loc) · 2.82 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*
Copyright 2023 The bpmn Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package bpmn
import (
"github.com/olive-io/bpmn/schema"
"github.com/olive-io/bpmn/v2/pkg/id"
"github.com/olive-io/bpmn/v2/pkg/tracing"
)
type ErrorTrace struct {
Error error
}
func (t ErrorTrace) Unpack() any { return t.Error }
type NewFlowTrace struct {
FlowId id.Id
}
func (t NewFlowTrace) Unpack() any { return t.FlowId }
type FlowTrace struct {
Source schema.FlowNodeInterface
Flows []Snapshot
}
func (t FlowTrace) Unpack() any { return t.Source }
type TerminationTrace struct {
FlowId id.Id
Source schema.FlowNodeInterface
}
func (t TerminationTrace) Unpack() any { return t.Source }
type CancellationFlowTrace struct {
FlowId id.Id
Node schema.FlowNodeInterface
}
func (t CancellationFlowTrace) Unpack() any { return t.Node }
type CompletionTrace struct {
Node schema.FlowNodeInterface
}
func (t CompletionTrace) Unpack() any { return t.Node }
type CeaseFlowTrace struct {
Process schema.Element
}
func (t CeaseFlowTrace) Unpack() any { return t.Process }
type VisitTrace struct {
Node schema.FlowNodeInterface
}
func (t VisitTrace) Unpack() any { return t.Node }
type LeaveTrace struct {
Node schema.FlowNodeInterface
}
func (t LeaveTrace) Unpack() any { return t.Node }
type CancellationFlowNodeTrace struct {
Node schema.FlowNodeInterface
}
func (t CancellationFlowNodeTrace) Unpack() any { return t.Node }
type NewFlowNodeTrace struct {
Node schema.FlowNodeInterface
}
func (t NewFlowNodeTrace) Unpack() any { return t.Node }
// ProcessTrace wraps any trace within a given process
type ProcessTrace struct {
Process *schema.Process
Trace tracing.ITrace
}
func (t ProcessTrace) Unwrap() tracing.ITrace {
return t.Trace
}
func (t ProcessTrace) Unpack() any { return t.Process }
// InstantiationTrace denotes instantiation of a given process
type InstantiationTrace struct {
InstanceId id.Id
}
func (i InstantiationTrace) Unpack() any { return i.InstanceId }
// InstanceTrace wraps any trace with process instance id
type InstanceTrace struct {
InstanceId id.Id
Trace tracing.ITrace
}
func (t InstanceTrace) Unwrap() tracing.ITrace {
return t.Trace
}
func (t InstanceTrace) Unpack() any { return t.InstanceId }
type CeaseProcessSetTrace struct {
Definitions *schema.Definitions
}
func (t CeaseProcessSetTrace) Unpack() any { return t.Definitions }