@@ -12,6 +12,7 @@ import (
12
12
"github.com/cschleiden/go-workflows/internal/core"
13
13
"github.com/cschleiden/go-workflows/internal/history"
14
14
"github.com/cschleiden/go-workflows/internal/task"
15
+ "github.com/cschleiden/go-workflows/workflow"
15
16
"github.com/google/uuid"
16
17
"github.com/pkg/errors"
17
18
@@ -81,7 +82,7 @@ func (sb *sqliteBackend) CreateWorkflowInstance(ctx context.Context, m history.W
81
82
return nil
82
83
}
83
84
84
- func createInstance (ctx context.Context , tx * sql.Tx , wfi core. WorkflowInstance ) error {
85
+ func createInstance (ctx context.Context , tx * sql.Tx , wfi workflow. Instance ) error {
85
86
var parentInstanceID * string
86
87
var parentEventID * int
87
88
if wfi .SubWorkflow () {
@@ -106,7 +107,7 @@ func createInstance(ctx context.Context, tx *sql.Tx, wfi core.WorkflowInstance)
106
107
return nil
107
108
}
108
109
109
- func (sb * sqliteBackend ) CancelWorkflowInstance (ctx context.Context , instance core. WorkflowInstance ) error {
110
+ func (sb * sqliteBackend ) CancelWorkflowInstance (ctx context.Context , instance workflow. Instance ) error {
110
111
tx , err := sb .db .BeginTx (ctx , nil )
111
112
if err != nil {
112
113
return err
@@ -212,7 +213,7 @@ func (sb *sqliteBackend) GetWorkflowTask(ctx context.Context) (*task.Workflow, e
212
213
kind = task .Continuation
213
214
}
214
215
215
- var wfi core. WorkflowInstance
216
+ var wfi workflow. Instance
216
217
if parentInstanceID != nil {
217
218
wfi = core .NewSubWorkflowInstance (instanceID , executionID , core .NewWorkflowInstance (* parentInstanceID , "" ), * parentEventID )
218
219
} else {
@@ -267,11 +268,11 @@ func (sb *sqliteBackend) GetWorkflowTask(ctx context.Context) (*task.Workflow, e
267
268
return t , nil
268
269
}
269
270
270
- // CompleteWorkflowTask(ctx context.Context, instance core.WorkflowInstance , executedEvents []history.Event, workflowEvents []history.WorkflowEvent) error
271
+ // CompleteWorkflowTask(ctx context.Context, instance workflow.Instance , executedEvents []history.Event, workflowEvents []history.WorkflowEvent) error
271
272
272
273
func (sb * sqliteBackend ) CompleteWorkflowTask (
273
274
ctx context.Context ,
274
- instance core. WorkflowInstance ,
275
+ instance workflow. Instance ,
275
276
executedEvents []history.Event ,
276
277
workflowEvents []history.WorkflowEvent ,
277
278
) error {
@@ -335,7 +336,7 @@ func (sb *sqliteBackend) CompleteWorkflowTask(
335
336
}
336
337
337
338
// Insert new workflow events
338
- groupedEvents := make (map [core. WorkflowInstance ][]history.Event )
339
+ groupedEvents := make (map [workflow. Instance ][]history.Event )
339
340
for _ , m := range workflowEvents {
340
341
if _ , ok := groupedEvents [m .WorkflowInstance ]; ! ok {
341
342
groupedEvents [m .WorkflowInstance ] = []history.Event {}
@@ -373,7 +374,7 @@ func (sb *sqliteBackend) CompleteWorkflowTask(
373
374
return tx .Commit ()
374
375
}
375
376
376
- func (sb * sqliteBackend ) ExtendWorkflowTask (ctx context.Context , instance core. WorkflowInstance ) error {
377
+ func (sb * sqliteBackend ) ExtendWorkflowTask (ctx context.Context , instance workflow. Instance ) error {
377
378
tx , err := sb .db .BeginTx (ctx , nil )
378
379
if err != nil {
379
380
return err
@@ -460,7 +461,7 @@ func (sb *sqliteBackend) GetActivityTask(ctx context.Context) (*task.Activity, e
460
461
return t , nil
461
462
}
462
463
463
- func (sb * sqliteBackend ) CompleteActivityTask (ctx context.Context , instance core. WorkflowInstance , id string , event history.Event ) error {
464
+ func (sb * sqliteBackend ) CompleteActivityTask (ctx context.Context , instance workflow. Instance , id string , event history.Event ) error {
464
465
tx , err := sb .db .BeginTx (ctx , nil )
465
466
if err != nil {
466
467
return err
0 commit comments