@@ -130,12 +130,12 @@ func TestValidateProcess(t *testing.T) {
130130func TestContinueExecution (t * testing.T ) {
131131 assert , require := assert .New (t ), require .New (t )
132132
133- scope := & ElementInstanceEntity {}
134-
135133 t .Run ("start event" , func (t * testing.T ) {
136134 // given
137135 graph := mustCreateGraph (t , "start-end.bpmn" , "startEndTest" )
138136
137+ scope := graph .createProcessScope (& ProcessInstanceEntity {})
138+
139139 t .Run ("scope QUEUED" , func (t * testing.T ) {
140140 // given
141141 scope .State = engine .InstanceQueued
@@ -144,7 +144,7 @@ func TestContinueExecution(t *testing.T) {
144144 BpmnElementId : "startEvent" ,
145145 BpmnElementType : model .ElementNoneStartEvent ,
146146
147- parent : scope ,
147+ parent : & scope ,
148148 }
149149
150150 // when
@@ -169,7 +169,7 @@ func TestContinueExecution(t *testing.T) {
169169
170170 assert .Equal ("endEvent" , executions2 [0 ].BpmnElementId )
171171 assert .Equal (model .ElementNoneEndEvent , executions2 [0 ].BpmnElementType )
172- assert .Equal (scope , executions2 [0 ].parent )
172+ assert .Equal (& scope , executions2 [0 ].parent )
173173 assert .Nil (executions2 [0 ].prev )
174174 })
175175 })
@@ -178,6 +178,8 @@ func TestContinueExecution(t *testing.T) {
178178 // given
179179 graph := mustCreateGraph (t , "event/error-boundary-event.bpmn" , "errorBoundaryEventTest" )
180180
181+ scope := graph .createProcessScope (& ProcessInstanceEntity {})
182+
181183 t .Run ("scope STARTED" , func (t * testing.T ) {
182184 // given
183185 scope .State = engine .InstanceStarted
@@ -186,7 +188,7 @@ func TestContinueExecution(t *testing.T) {
186188 BpmnElementId : "serviceTask" ,
187189 BpmnElementType : model .ElementServiceTask ,
188190
189- parent : scope ,
191+ parent : & scope ,
190192 }
191193
192194 // when
@@ -201,7 +203,7 @@ func TestContinueExecution(t *testing.T) {
201203
202204 assert .Equal ("errorBoundaryEvent" , executions1 [0 ].BpmnElementId )
203205 assert .Equal (model .ElementErrorBoundaryEvent , executions1 [0 ].BpmnElementType )
204- assert .Equal (scope , executions1 [0 ].parent )
206+ assert .Equal (& scope , executions1 [0 ].parent )
205207 assert .Equal (execution , executions1 [0 ].prev )
206208
207209 // when
@@ -222,7 +224,7 @@ func TestContinueExecution(t *testing.T) {
222224 BpmnElementId : "serviceTask" ,
223225 BpmnElementType : model .ElementServiceTask ,
224226
225- parent : scope ,
227+ parent : & scope ,
226228 }
227229
228230 // when
@@ -237,7 +239,7 @@ func TestContinueExecution(t *testing.T) {
237239
238240 assert .Equal ("errorBoundaryEvent" , executions1 [0 ].BpmnElementId )
239241 assert .Equal (model .ElementErrorBoundaryEvent , executions1 [0 ].BpmnElementType )
240- assert .Equal (scope , executions1 [0 ].parent )
242+ assert .Equal (& scope , executions1 [0 ].parent )
241243 assert .Equal (execution , executions1 [0 ].prev )
242244
243245 // when
@@ -277,13 +279,15 @@ func TestContinueExecution(t *testing.T) {
277279 {BpmnElementId : "errorBoundaryEvent" , ErrorCode : pgtype.Text {String : "TEST_CODE" }},
278280 })
279281
282+ scope := graph .createProcessScope (& ProcessInstanceEntity {})
283+
280284 scope .State = engine .InstanceStarted
281285
282286 execution := & ElementInstanceEntity {
283287 BpmnElementId : "serviceTask" ,
284288 BpmnElementType : model .ElementServiceTask ,
285289
286- parent : scope ,
290+ parent : & scope ,
287291 }
288292
289293 // when
@@ -305,6 +309,8 @@ func TestContinueExecution(t *testing.T) {
305309 // given
306310 graph := mustCreateGraph (t , "event/error-boundary-event.bpmn" , "errorBoundaryEventTest" )
307311
312+ scope := graph .createProcessScope (& ProcessInstanceEntity {})
313+
308314 t .Run ("scope STARTED" , func (t * testing.T ) {
309315 // given
310316 scope .State = engine .InstanceStarted
@@ -314,7 +320,7 @@ func TestContinueExecution(t *testing.T) {
314320 BpmnElementType : model .ElementServiceTask ,
315321 State : engine .InstanceCreated ,
316322
317- parent : scope ,
323+ parent : & scope ,
318324 }
319325
320326 // when
@@ -338,7 +344,7 @@ func TestContinueExecution(t *testing.T) {
338344 ExecutionCount : - 1 ,
339345 State : engine .InstanceCreated ,
340346
341- parent : scope ,
347+ parent : & scope ,
342348 }
343349
344350 // when
@@ -362,7 +368,7 @@ func TestContinueExecution(t *testing.T) {
362368 ExecutionCount : - 1 ,
363369 State : engine .InstanceCreated ,
364370
365- parent : scope ,
371+ parent : & scope ,
366372 }
367373
368374 // when
@@ -397,7 +403,7 @@ func TestContinueExecution(t *testing.T) {
397403 BpmnElementType : model .ElementServiceTask ,
398404 State : engine .InstanceSuspended ,
399405
400- parent : scope ,
406+ parent : & scope ,
401407 }
402408
403409 // when
@@ -416,6 +422,8 @@ func TestContinueExecution(t *testing.T) {
416422 // given
417423 graph := mustCreateGraph (t , "event/timer-catch.bpmn" , "timerCatchTest" )
418424
425+ scope := graph .createProcessScope (& ProcessInstanceEntity {})
426+
419427 t .Run ("scope STARTED" , func (t * testing.T ) {
420428 // given
421429 scope .State = engine .InstanceStarted
@@ -424,7 +432,7 @@ func TestContinueExecution(t *testing.T) {
424432 BpmnElementId : "startEvent" ,
425433 BpmnElementType : model .ElementNoneStartEvent ,
426434
427- parent : scope ,
435+ parent : & scope ,
428436 }
429437
430438 // when
0 commit comments