@@ -44,7 +44,7 @@ type ProcessSet struct {
4444
4545 definitions * schema.Definitions
4646
47- sourceMessageFlows map [string ]* schema.MessageFlow
47+ messageFlows map [string ]* schema.MessageFlow
4848
4949 cmu sync.RWMutex
5050 catchCh map [string ]chan struct {}
@@ -94,25 +94,23 @@ func NewProcessSet(executeProcesses, waitingProcesses []*schema.Process, definit
9494 executes = append (executes , process )
9595 }
9696
97- sourceMessageFlows := make (map [string ]* schema.MessageFlow )
97+ messageFlows := make (map [string ]* schema.MessageFlow )
9898 for _ , collaboration := range * definitions .Collaborations () {
9999 for _ , msg := range * collaboration .MessageFlows () {
100- sourceMessageFlows [string (msg .SourceRefField )] = & msg
100+ messageFlows [string (msg .SourceRefField )] = & msg
101101 }
102102 }
103103
104104 ps := & ProcessSet {
105- Options : options ,
106- sourceOptions : opts ,
107- executes : executes ,
108- waitings : waitingProcesses ,
109- definitions : definitions ,
110- sourceMessageFlows : sourceMessageFlows ,
111-
112- catchCh : make (map [string ]chan struct {}),
113-
114- mch : make (chan imessage , len (executes )+ 1 ),
115- done : make (chan struct {}, 1 ),
105+ Options : options ,
106+ sourceOptions : opts ,
107+ executes : executes ,
108+ waitings : waitingProcesses ,
109+ definitions : definitions ,
110+ messageFlows : messageFlows ,
111+ catchCh : make (map [string ]chan struct {}),
112+ mch : make (chan imessage , len (executes )+ 1 ),
113+ done : make (chan struct {}, 1 ),
116114 }
117115
118116 return ps , nil
@@ -160,7 +158,7 @@ func (ps *ProcessSet) run(ctx context.Context) {
160158 case ch := <- ps .mch :
161159 switch msg := ch .(type ) {
162160 case throwMessage :
163- sourceRef , ok := ps .sourceMessageFlows [msg .Id ]
161+ sourceRef , ok := ps .messageFlows [msg .Id ]
164162 if ok {
165163 startFlowNode , waitingProcess , found := ps .resolveWaitingProcessAndEvent (string (sourceRef .TargetRefField ))
166164 if found {
@@ -184,9 +182,9 @@ func (ps *ProcessSet) run(ctx context.Context) {
184182 ps .wg .Add (1 )
185183 go ps .tracerProcess (ctx , process , & ps .wg )
186184 }
187- trigger , found := ps .triggerCatch (string (sourceRef .TargetRefField ))
185+ cancel , found := ps .triggerCatch (string (sourceRef .TargetRefField ))
188186 if found {
189- trigger ()
187+ cancel ()
190188 }
191189 }
192190 }
0 commit comments