engine

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateWorkflowInstance

func CreateWorkflowInstance(wm *WorkflowManager, name string) (core.Workflow, error)

func RunWorkflow

func RunWorkflow(w core.Workflow, r repository.WorkflowRepository, wa repository.WorkflowActionRepository, executorID int64, workerID string)

Engine runs a workflow

func Worker

func Worker(id int, executorID int64, workflowRepository repository.WorkflowRepository, workflowActionRepository repository.WorkflowActionRepository, workflowQueue <-chan core.Workflow)

Worker function that processes workflows from the queue

Types

type WorkflowManager

type WorkflowManager struct {
	WorkflowRegistry   *map[string]func() core.Workflow
	WorkflowRepo       *repository.WorkflowRepository
	WorkflowActionRepo *repository.WorkflowActionRepository

	DefinitionRepo *repository.WorkflowDefinitionRepository
	// contains filtered or unexported fields
}

func NewWorkflowManager

func NewWorkflowManager(workflowRepo *repository.WorkflowRepository, workflowActionRepo *repository.WorkflowActionRepository, executorRepo *repository.ExecutorRepository,
	definitionRepo *repository.WorkflowDefinitionRepository, WorkflowRegistry *map[string]func() core.Workflow) *WorkflowManager

func (*WorkflowManager) DefinitionOverview

func (wm *WorkflowManager) DefinitionOverview(workflowType string) ([]repository.DefinitionStateRow, error)

DefinitionOverview exposes counts by state for a workflow type

func (*WorkflowManager) GetWorkflowDefinitionByName

func (wm *WorkflowManager) GetWorkflowDefinitionByName(name string) (*domain.WorkflowDefinition, error)

GetWorkflowDefinitionByName exposes repository get by name for web/API layers.

func (*WorkflowManager) ListExecutors

func (wm *WorkflowManager) ListExecutors(limit int) ([]*domain.Executor, error)

ListExecutors returns recent executors ordered by last_active desc.

func (*WorkflowManager) ListWorkflowDefinitions

func (wm *WorkflowManager) ListWorkflowDefinitions() (*[]domain.WorkflowDefinition, error)

ListWorkflowDefinitions exposes repository list for web/API layers.

func (*WorkflowManager) NextToExecute

func (wm *WorkflowManager) NextToExecute(limit int) (*[]domain.Workflow, error)

NextToExecute exposes repository method for dashboard

func (*WorkflowManager) Overview

Overview exposes grouped counts for home dashboard

func (*WorkflowManager) SearchWorkflows

func (wm *WorkflowManager) SearchWorkflows(req models.SearchWorkflowRequest) (*[]domain.Workflow, error)

SearchWorkflows delegates to the repository to search based on request filters.

func (*WorkflowManager) StartEngine

func (wm *WorkflowManager) StartEngine(pollInterval time.Duration)

StartEngine starts polling for new workflows at the given interval

func (*WorkflowManager) TopExecuting

func (wm *WorkflowManager) TopExecuting(limit int) (*[]domain.Workflow, error)

TopExecuting exposes repository method for dashboard

func (*WorkflowManager) Wakeup

func (wm *WorkflowManager) Wakeup()

Jump to

Keyboard shortcuts

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