@@ -3,6 +3,7 @@ package backend
3
3
import (
4
4
"context"
5
5
6
+ core "github.com/cschleiden/go-workflows/internal/core"
6
7
"github.com/cschleiden/go-workflows/internal/history"
7
8
"github.com/cschleiden/go-workflows/internal/task"
8
9
"github.com/cschleiden/go-workflows/workflow"
@@ -21,13 +22,13 @@ type Backend interface {
21
22
CreateWorkflowInstance (ctx context.Context , event history.WorkflowEvent ) error
22
23
23
24
// CancelWorkflowInstance cancels a running workflow instance
24
- CancelWorkflowInstance (ctx context.Context , instance workflow.Instance ) error
25
+ CancelWorkflowInstance (ctx context.Context , instance * workflow.Instance , event * history. Event ) error
25
26
26
27
// GetWorkflowInstanceState returns the state of the given workflow instance
27
- GetWorkflowInstanceState (ctx context.Context , instance workflow.Instance ) (WorkflowState , error )
28
+ GetWorkflowInstanceState (ctx context.Context , instance * workflow.Instance ) (WorkflowState , error )
28
29
29
30
// GetWorkflowInstanceHistory returns the full workflow history for the given instance
30
- GetWorkflowInstanceHistory (ctx context.Context , instance workflow.Instance ) ([]history.Event , error )
31
+ GetWorkflowInstanceHistory (ctx context.Context , instance * workflow.Instance ) ([]history.Event , error )
31
32
32
33
// SignalWorkflow signals a running workflow instance
33
34
SignalWorkflow (ctx context.Context , instanceID string , event history.Event ) error
@@ -36,22 +37,22 @@ type Backend interface {
36
37
GetWorkflowTask (ctx context.Context ) (* task.Workflow , error )
37
38
38
39
// ExtendWorkflowTask extends the lock of a workflow task
39
- ExtendWorkflowTask (ctx context.Context , instance workflow. Instance ) error
40
+ ExtendWorkflowTask (ctx context.Context , taskID string , instance * core. WorkflowInstance ) error
40
41
41
42
// CompleteWorkflowTask checkpoints a workflow task retrieved using GetWorkflowTask
42
43
//
43
44
// This checkpoints the execution. events are new events from the last workflow execution
44
45
// which will be added to the workflow instance history. workflowEvents are new events for the
45
46
// completed or other workflow instances.
46
47
CompleteWorkflowTask (
47
- ctx context.Context , instance workflow.Instance , state WorkflowState ,
48
+ ctx context.Context , taskID string , instance * workflow.Instance , state WorkflowState ,
48
49
executedEvents []history.Event , activityEvents []history.Event , workflowEvents []history.WorkflowEvent ) error
49
50
50
51
// GetActivityTask returns a pending activity task or nil if there are no pending activities
51
52
GetActivityTask (ctx context.Context ) (* task.Activity , error )
52
53
53
54
// CompleteActivityTask completes a activity task retrieved using GetActivityTask
54
- CompleteActivityTask (ctx context.Context , instance workflow.Instance , activityID string , event history.Event ) error
55
+ CompleteActivityTask (ctx context.Context , instance * workflow.Instance , activityID string , event history.Event ) error
55
56
56
57
// ExtendActivityTask extends the lock of an activity task
57
58
ExtendActivityTask (ctx context.Context , activityID string ) error
0 commit comments