-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathcommand.go
More file actions
85 lines (64 loc) · 2.08 KB
/
command.go
File metadata and controls
85 lines (64 loc) · 2.08 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
package bpmn_engine
import "github.com/nitram509/lib-bpmn-engine/pkg/spec/BPMN20"
type commandType string
const (
flowTransitionType commandType = "flowTransition"
activityType commandType = "activity"
continueActivityType commandType = "continueActivity"
// A command that there is a technical error and the engine should fail the process instance
errorType commandType = "error"
eventSubProcessCompletedType commandType = "eventSubProcessCompletedType"
checkExclusiveGatewayDoneType commandType = "checkExclusiveGatewayDone"
)
type command interface {
Type() commandType
}
// ---------------------------------------------------------------------
type flowTransitionCommand struct {
sourceId string
sourceActivity activity
sequenceFlowId string
}
func (f flowTransitionCommand) Type() commandType {
return flowTransitionType
}
// ---------------------------------------------------------------------
type activityCommand struct {
sourceId string
element *BPMN20.BaseElement
originActivity activity
}
func (a activityCommand) Type() commandType {
return activityType
}
// ---------------------------------------------------------------------
type continueActivityCommand struct {
activity activity
originActivity activity
}
func (ga continueActivityCommand) Type() commandType {
return continueActivityType
}
// ---------------------------------------------------------------------
type errorCommand struct {
err error
elementId string
elementName string
}
func (e errorCommand) Type() commandType {
return errorType
}
// ---------------------------------------------------------------------
type checkExclusiveGatewayDoneCommand struct {
gatewayActivity eventBasedGatewayActivity
}
func (t checkExclusiveGatewayDoneCommand) Type() commandType {
return checkExclusiveGatewayDoneType
}
type eventSubProcessCompletedCommand struct {
// activity reference to the event sub-process, which has completed
activity activity
}
func (t eventSubProcessCompletedCommand) Type() commandType {
return eventSubProcessCompletedType
}