Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNatsHistory ¶
func NewNatsHistory(natsService *natz.NatsService, storageType jetstream.StorageType) *natsHistoryStore
NewNatsHistory creates a new history store based upon NATS JetStream KV
func NewPGHistory ¶
func NewPGHistory(natsService *natz.NatsService, 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
Click to show internal directories.
Click to hide internal directories.