workflows

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChildInit       = "ChildInit"
	ChildProcessing = "ChildProcessing"
	ChildWakeParent = "ChildWakeParent"
	ChildFinish     = "ChildFinish"
)

State constants for child workflow

View Source
const (
	ParentInit            = "ParentInit"
	ParentSpawnChildren   = "ParentSpawnChildren"
	ParentWaitForChildren = "ParentWaitForChildren"
	ParentFinish          = "ParentFinish"
)

State constants for parent workflow

View Source
const VAR_AGE = "age"
View Source
const VAR_IP = "ip"
View Source
const VAR_NAME = "name"

Variables

View Source
var StateApprove string = "Approve"
View Source
var StateApproveError string = "ApproveError"
View Source
var StateFinish string = "Finish"

Define a named string type

View Source
var StateGetIpData string = "StateGetIpData"

Define a named string type

View Source
var StateInit string = "Init"
View Source
var StateReview string = "Review"

Functions

This section is empty.

Types

type DemoChildWorkflow added in v1.5.0

type DemoChildWorkflow struct {
	core.BaseWorkflow
	Clock core.Clock
}

DemoChildWorkflow is a demonstration of a child workflow that wakes its parent

func (*DemoChildWorkflow) ChildFinish added in v1.5.0

func (w *DemoChildWorkflow) ChildFinish(ctx context.Context) (*models.NextState, error)

ChildFinish finishes the child workflow

func (*DemoChildWorkflow) ChildInit added in v1.5.0

func (w *DemoChildWorkflow) ChildInit(ctx context.Context) (*models.NextState, error)

ChildInit initializes the child workflow

func (*DemoChildWorkflow) ChildProcessing added in v1.5.0

func (w *DemoChildWorkflow) ChildProcessing(ctx context.Context) (*models.NextState, error)

ChildProcessing performs the child workflow's task (simulated with a delay)

func (*DemoChildWorkflow) ChildWakeParent added in v1.5.0

func (w *DemoChildWorkflow) ChildWakeParent(ctx context.Context) (*models.NextState, error)

ChildWakeParent wakes the parent workflow

func (*DemoChildWorkflow) Description added in v1.5.0

func (w *DemoChildWorkflow) Description() string

func (*DemoChildWorkflow) GetAllStates added in v1.5.0

func (w *DemoChildWorkflow) GetAllStates() []models.WorkflowState

func (*DemoChildWorkflow) GetChildWorkflows added in v1.5.0

func (w *DemoChildWorkflow) GetChildWorkflows(ctx context.Context) ([]domain.Workflow, error)

GetChildWorkflows implements the ParentChildCapable interface

func (*DemoChildWorkflow) GetRetryConfig added in v1.5.0

func (w *DemoChildWorkflow) GetRetryConfig() models.RetryConfig

func (*DemoChildWorkflow) GetStateVariables added in v1.5.0

func (w *DemoChildWorkflow) GetStateVariables() map[string]string

func (*DemoChildWorkflow) GetWorkflowData added in v1.5.0

func (w *DemoChildWorkflow) GetWorkflowData() *domain.Workflow

func (*DemoChildWorkflow) InitialState added in v1.5.0

func (w *DemoChildWorkflow) InitialState() string

func (*DemoChildWorkflow) Setup added in v1.5.0

func (w *DemoChildWorkflow) Setup(wf *domain.Workflow)

func (*DemoChildWorkflow) StateTransitions added in v1.5.0

func (w *DemoChildWorkflow) StateTransitions() map[string][]string

type DemoParentWorkflow added in v1.5.0

type DemoParentWorkflow struct {
	core.BaseWorkflow
	Clock core.Clock
	// contains filtered or unexported fields
}

DemoParentWorkflow is a demonstration of a parent workflow that creates child workflows

func (*DemoParentWorkflow) Description added in v1.5.0

func (w *DemoParentWorkflow) Description() string

func (*DemoParentWorkflow) GetAllStates added in v1.5.0

func (w *DemoParentWorkflow) GetAllStates() []models.WorkflowState

func (*DemoParentWorkflow) GetChildWorkflows added in v1.5.0

func (w *DemoParentWorkflow) GetChildWorkflows(ctx context.Context) ([]domain.Workflow, error)

GetChildWorkflows implements the ParentChildCapable interface

func (*DemoParentWorkflow) GetRetryConfig added in v1.5.0

func (w *DemoParentWorkflow) GetRetryConfig() models.RetryConfig

func (*DemoParentWorkflow) GetStateVariables added in v1.5.0

func (w *DemoParentWorkflow) GetStateVariables() map[string]string

func (*DemoParentWorkflow) GetWorkflowData added in v1.5.0

func (w *DemoParentWorkflow) GetWorkflowData() *domain.Workflow

func (*DemoParentWorkflow) InitialState added in v1.5.0

func (w *DemoParentWorkflow) InitialState() string

func (*DemoParentWorkflow) ParentFinish added in v1.5.0

func (w *DemoParentWorkflow) ParentFinish(ctx context.Context) (*models.NextState, error)

ParentFinish finishes the workflow

func (*DemoParentWorkflow) ParentInit added in v1.5.0

func (w *DemoParentWorkflow) ParentInit(ctx context.Context) (*models.NextState, error)

ParentInit initializes the parent workflow

func (*DemoParentWorkflow) ParentSpawnChildren added in v1.5.0

func (w *DemoParentWorkflow) ParentSpawnChildren(ctx context.Context) (*models.NextState, error)

ParentSpawnChildren creates two child workflows

func (*DemoParentWorkflow) ParentWaitForChildren added in v1.5.0

func (w *DemoParentWorkflow) ParentWaitForChildren(ctx context.Context) (*models.NextState, error)

ParentWaitForChildren checks if all children are complete

func (*DemoParentWorkflow) Setup added in v1.5.0

func (w *DemoParentWorkflow) Setup(wf *domain.Workflow)

func (*DemoParentWorkflow) StateTransitions added in v1.5.0

func (w *DemoParentWorkflow) StateTransitions() map[string][]string

func (*DemoParentWorkflow) WakeParent added in v1.5.0

func (w *DemoParentWorkflow) WakeParent(ctx context.Context) error

WakeParent implements the ParentChildCapable interface

type DemoWorkflow

type DemoWorkflow struct {
	core.BaseWorkflow
	Clock core.Clock
}

func (*DemoWorkflow) Approve

func (m *DemoWorkflow) Approve(ctx context.Context) (*models.NextState, error)

func (*DemoWorkflow) Description

func (m *DemoWorkflow) Description() string

func (*DemoWorkflow) GetAllStates

func (m *DemoWorkflow) GetAllStates() []models.WorkflowState

func (*DemoWorkflow) GetRetryConfig

func (m *DemoWorkflow) GetRetryConfig() models.RetryConfig

func (*DemoWorkflow) GetStateVariables

func (m *DemoWorkflow) GetStateVariables() map[string]string

func (*DemoWorkflow) GetWorkflowData

func (m *DemoWorkflow) GetWorkflowData() *domain.Workflow

func (*DemoWorkflow) Init

func (m *DemoWorkflow) Init(ctx context.Context) (*models.NextState, error)

Each method returns the next state

func (*DemoWorkflow) InitialState

func (m *DemoWorkflow) InitialState() string

func (*DemoWorkflow) Review

func (m *DemoWorkflow) Review(ctx context.Context) (*models.NextState, error)

func (*DemoWorkflow) Setup

func (m *DemoWorkflow) Setup(wf *domain.Workflow)

func (*DemoWorkflow) StateTransitions

func (m *DemoWorkflow) StateTransitions() map[string][]string

type EnrollmentStruct

type EnrollmentStruct struct {
	Name string `json:"name"`
	Age  int    `json:"age"`
}

type GetIpWorkflow

type GetIpWorkflow struct {
	core.BaseWorkflow
}

func (*GetIpWorkflow) Description

func (m *GetIpWorkflow) Description() string

func (*GetIpWorkflow) GetAllStates

func (m *GetIpWorkflow) GetAllStates() []models.WorkflowState

func (*GetIpWorkflow) GetRetryConfig

func (m *GetIpWorkflow) GetRetryConfig() models.RetryConfig

func (*GetIpWorkflow) GetStateVariables

func (m *GetIpWorkflow) GetStateVariables() map[string]string

func (*GetIpWorkflow) GetWorkflowData

func (m *GetIpWorkflow) GetWorkflowData() *domain.Workflow

func (*GetIpWorkflow) Init

Each method returns the next state

func (*GetIpWorkflow) InitialState

func (m *GetIpWorkflow) InitialState() string

func (*GetIpWorkflow) Setup

func (m *GetIpWorkflow) Setup(wf *domain.Workflow)

func (*GetIpWorkflow) StateGetIpData

func (m *GetIpWorkflow) StateGetIpData(ctx context.Context) (*models.NextState, error)

func (*GetIpWorkflow) StateTransitions

func (m *GetIpWorkflow) StateTransitions() map[string][]string

Jump to

Keyboard shortcuts

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