@@ -3,6 +3,7 @@ package backend
33import (
44 "context"
55
6+ core "github.com/cschleiden/go-workflows/internal/core"
67 "github.com/cschleiden/go-workflows/internal/history"
78 "github.com/cschleiden/go-workflows/internal/task"
89 "github.com/cschleiden/go-workflows/workflow"
@@ -21,13 +22,13 @@ type Backend interface {
2122 CreateWorkflowInstance (ctx context.Context , event history.WorkflowEvent ) error
2223
2324 // 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
2526
2627 // 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 )
2829
2930 // 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 )
3132
3233 // SignalWorkflow signals a running workflow instance
3334 SignalWorkflow (ctx context.Context , instanceID string , event history.Event ) error
@@ -36,22 +37,22 @@ type Backend interface {
3637 GetWorkflowTask (ctx context.Context ) (* task.Workflow , error )
3738
3839 // 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
4041
4142 // CompleteWorkflowTask checkpoints a workflow task retrieved using GetWorkflowTask
4243 //
4344 // This checkpoints the execution. events are new events from the last workflow execution
4445 // which will be added to the workflow instance history. workflowEvents are new events for the
4546 // completed or other workflow instances.
4647 CompleteWorkflowTask (
47- ctx context.Context , instance workflow.Instance , state WorkflowState ,
48+ ctx context.Context , taskID string , instance * workflow.Instance , state WorkflowState ,
4849 executedEvents []history.Event , activityEvents []history.Event , workflowEvents []history.WorkflowEvent ) error
4950
5051 // GetActivityTask returns a pending activity task or nil if there are no pending activities
5152 GetActivityTask (ctx context.Context ) (* task.Activity , error )
5253
5354 // 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
5556
5657 // ExtendActivityTask extends the lock of an activity task
5758 ExtendActivityTask (ctx context.Context , activityID string ) error
0 commit comments