Files
tasks/service/history/workflow/transaction.go
Yichao YangandGitHub 63839f1a9d CHASM: Propagate ArchetypeID (#8693)
## What changed?
- Use archetypeID everywhere in history service and pass them to
persistence

## Why?
- Required for separate ID space work.

## How did you test it?
- [x] built
- [ ] run locally and tested manually
- [x] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)
2025-11-26 16:04:44 -08:00

59 lines
1.8 KiB
Go

package workflow
import (
"context"
"go.temporal.io/server/chasm"
"go.temporal.io/server/common/persistence"
)
//go:generate mockgen -package $GOPACKAGE -source $GOFILE -destination transaction_mock.go
type (
Transaction interface {
CreateWorkflowExecution(
ctx context.Context,
createMode persistence.CreateWorkflowMode,
archetypeID chasm.ArchetypeID,
newWorkflowFailoverVersion int64,
newWorkflowSnapshot *persistence.WorkflowSnapshot,
newWorkflowEventsSeq []*persistence.WorkflowEvents,
isWorkflow bool,
) (int64, error)
ConflictResolveWorkflowExecution(
ctx context.Context,
conflictResolveMode persistence.ConflictResolveWorkflowMode,
archetypeID chasm.ArchetypeID,
resetWorkflowFailoverVersion int64,
resetWorkflowSnapshot *persistence.WorkflowSnapshot,
resetWorkflowEventsSeq []*persistence.WorkflowEvents,
newWorkflowFailoverVersion *int64,
newWorkflowSnapshot *persistence.WorkflowSnapshot,
newWorkflowEventsSeq []*persistence.WorkflowEvents,
currentWorkflowFailoverVersion *int64,
currentWorkflowMutation *persistence.WorkflowMutation,
currentWorkflowEventsSeq []*persistence.WorkflowEvents,
isWorkflow bool,
) (int64, int64, int64, error)
UpdateWorkflowExecution(
ctx context.Context,
updateMode persistence.UpdateWorkflowMode,
archetypeID chasm.ArchetypeID,
currentWorkflowFailoverVersion int64,
currentWorkflowMutation *persistence.WorkflowMutation,
currentWorkflowEventsSeq []*persistence.WorkflowEvents,
newWorkflowFailoverVersion *int64,
newWorkflowSnapshot *persistence.WorkflowSnapshot,
newWorkflowEventsSeq []*persistence.WorkflowEvents,
isWorkflow bool,
) (int64, int64, error)
SetWorkflowExecution(
ctx context.Context,
archetypeID chasm.ArchetypeID,
workflowSnapshot *persistence.WorkflowSnapshot,
) error
}
)