store

package
v1.1.1921 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNatsHistory

func NewNatsHistory(ns *natz.NatsService) *natsHistoryStore

NewNatsHistory creates a new history store based upon NATS JetStream KV

func NewPGHistory

func NewPGHistory(nats common.NatsConn, conn *pgxpool.Pool) *pgHistoryStore

NewPGHistory creates a new history store based upon a postgres table

Types

type WorkflowHistoryOperations

type WorkflowHistoryOperations interface {
	// Delete removes all history for a process instance.
	Delete(ctx context.Context, ns string, processInstanceId string) error
	// Record logs a new workflow state transition in the history store based on the given action and current state.
	Record(ctx context.Context, ns string, state *model.WorkflowState, action model.ProcessHistoryType) error
	// GetItemsForElement returns the history entries for the given process instance and element ID.
	GetItemsForElement(ctx context.Context, ns string, processInstanceId string, elementId string) ([]*model.ProcessHistoryEntry, error)
	// GetItem returns the history entry for the given process instance, tracking ID, and history type.
	GetItem(ctx context.Context, ns string, processInstanceID string, trackingID string, historyType model.ProcessHistoryType) (*model.ProcessHistoryEntry, error)
	// Get streams process history entries for a given process instance to the provided channel.
	Get(ctx context.Context, ns string, processInstanceId string) <-chan data.Result[*model.ProcessHistoryEntry]
	// GetCompensable streams all compensable process history entries for a given process instance to a channel.
	GetCompensable(ctx context.Context, ns string, processInstanceId string) <-chan data.Result[*model.ProcessHistoryEntry]
	// GetActiveStates retrieves all active states of a specific process instance, sending results to a channel.
	GetActiveStates(ctx context.Context, ns string, processInstanceId string) <-chan data.Result[*model.ProcessHistoryEntry]
}

WorkflowHistoryOperations defines the operations on the history store

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL