workflow

package
v0.1.90 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine contains the workflow processing functions

func NewEngine

func NewEngine(log *zap.Logger, ns NatsService) (*Engine, error)

NewEngine returns an instance of the core workflow engine.

func (*Engine) CancelWorkflowInstance

func (c *Engine) CancelWorkflowInstance(ctx context.Context, id string) error

func (*Engine) CompleteManualTask added in v0.1.86

func (c *Engine) CompleteManualTask(ctx context.Context, trackingID string, newvars []byte) error

func (*Engine) CompleteServiceTask added in v0.1.86

func (c *Engine) CompleteServiceTask(ctx context.Context, trackingID string, newvars []byte) error

func (*Engine) CompleteUserTask added in v0.1.86

func (c *Engine) CompleteUserTask(ctx context.Context, trackingID string, newvars []byte) error

func (*Engine) Launch

func (c *Engine) Launch(ctx context.Context, workflowName string, vars []byte) (string, error)

Launch starts a new instance of a workflow and returns a workflow instance Id.

func (*Engine) LoadWorkflow

func (c *Engine) LoadWorkflow(ctx context.Context, model *model.Workflow) (string, error)

LoadWorkflow loads a model.Process describing a workflow into the engine ready for execution.

func (*Engine) Shutdown

func (c *Engine) Shutdown()

func (*Engine) Start

func (c *Engine) Start(ctx context.Context) error

Start sets up the activity and job processors and starts the engine processing workflows.

type NatsService

type NatsService interface {
	AwaitMsg(ctx context.Context, state *model.WorkflowState) error
	ListWorkflows(ctx context.Context) (chan *model.ListWorkflowResult, chan error)
	StoreWorkflow(ctx context.Context, wf *model.Workflow) (string, error)
	GetWorkflow(ctx context.Context, workflowId string) (*model.Workflow, error)
	CreateWorkflowInstance(ctx context.Context, wfInstance *model.WorkflowInstance) (*model.WorkflowInstance, error)
	GetWorkflowInstance(ctx context.Context, workflowInstanceId string) (*model.WorkflowInstance, error)
	DestroyWorkflowInstance(ctx context.Context, workflowInstanceId string) error
	GetLatestVersion(ctx context.Context, workflowName string) (string, error)
	CreateJob(ctx context.Context, job *model.WorkflowState) (string, error)
	GetJob(ctx context.Context, id string) (*model.WorkflowState, error)
	ListWorkflowInstance(ctx context.Context, workflowName string) (chan *model.ListWorkflowInstanceResult, chan error)
	GetWorkflowInstanceStatus(ctx context.Context, id string) (*model.WorkflowInstanceStatus, error)
	StartProcessing(ctx context.Context) error
	SetEventProcessor(processor services.EventProcessorFunc)
	SetMessageCompleteProcessor(processor services.MessageCompleteProcessorFunc)
	SetCompleteJobProcessor(processor services.CompleteJobProcessorFunc)
	PublishWorkflowState(ctx context.Context, stateName string, state *model.WorkflowState, delay int) error
	PublishMessage(ctx context.Context, workflowInstanceID string, name string, key string, vars []byte) error
	Conn() common.NatsConn
	Shutdown()
	CloseUserTask(trackingID string) error
	OwnerId(name string) (string, error)
	OwnerName(id string) (string, error)
}

Jump to

Keyboard shortcuts

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