Documentation ¶
Index ¶
- type Engine
- func (c *Engine) CancelProcessInstance(ctx context.Context, state *model.WorkflowState) error
- func (c *Engine) CompleteManualTask(ctx context.Context, job *model.WorkflowState, newvars []byte) error
- func (c *Engine) CompleteSendMessageTask(ctx context.Context, job *model.WorkflowState, newvars []byte) error
- func (c *Engine) CompleteServiceTask(ctx context.Context, job *model.WorkflowState, newvars []byte) error
- func (c *Engine) CompleteUserTask(ctx context.Context, job *model.WorkflowState, newvars []byte) error
- func (c *Engine) Launch(ctx context.Context, processName string, vars []byte) (string, string, error)
- func (c *Engine) LoadWorkflow(ctx context.Context, model *model.Workflow) (string, error)
- func (c *Engine) Shutdown()
- func (c *Engine) Start(ctx context.Context) error
- type NatsService
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 New ¶ added in v1.0.477
func New(ns NatsService) (*Engine, error)
New returns an instance of the core workflow engine.
func (*Engine) CancelProcessInstance ¶ added in v1.0.645
CancelProcessInstance cancels a workflow instance with a reason.
func (*Engine) CompleteManualTask ¶ added in v0.1.86
func (c *Engine) CompleteManualTask(ctx context.Context, job *model.WorkflowState, newvars []byte) error
CompleteManualTask completes a manual workflow task
func (*Engine) CompleteSendMessageTask ¶ added in v1.0.235
func (c *Engine) CompleteSendMessageTask(ctx context.Context, job *model.WorkflowState, newvars []byte) error
CompleteSendMessageTask completes a send message task
func (*Engine) CompleteServiceTask ¶ added in v0.1.86
func (c *Engine) CompleteServiceTask(ctx context.Context, job *model.WorkflowState, newvars []byte) error
CompleteServiceTask completes a workflow service task
func (*Engine) CompleteUserTask ¶ added in v0.1.86
func (c *Engine) CompleteUserTask(ctx context.Context, job *model.WorkflowState, newvars []byte) error
CompleteUserTask completes and closes a user task with variables
func (*Engine) Launch ¶
func (c *Engine) Launch(ctx context.Context, processName string, vars []byte) (string, string, error)
Launch starts a new instance of a workflow and returns an execution Id.
func (*Engine) LoadWorkflow ¶
LoadWorkflow loads a model.Process describing a workflow into the engine ready for execution.
type NatsService ¶
type NatsService interface { SaveState(ctx context.Context, id string, state *model.WorkflowState) error PutTaskSpec(ctx context.Context, spec *model.TaskSpec) (string, error) GetTaskSpecUID(ctx context.Context, name string) (string, error) GetTaskSpecByUID(ctx context.Context, uid string) (*model.TaskSpec, error) SetTraversalProvider(provider services.TraversalFunc) 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) GetWorkflowNameFor(ctx context.Context, processName string) (string, error) GetWorkflowVersions(ctx context.Context, workflowName string) (*model.WorkflowVersions, error) CreateExecution(ctx context.Context, wfInstance *model.Execution) (*model.Execution, error) GetExecution(ctx context.Context, workflowInstanceID string) (*model.Execution, error) XDestroyProcessInstance(ctx context.Context, state *model.WorkflowState) error GetServiceTaskRoutingKey(ctx context.Context, taskName string) (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) GetElement(ctx context.Context, state *model.WorkflowState) (*model.Element, error) ListExecutions(ctx context.Context, workflowName string) (chan *model.ListExecutionResult, chan error) ListExecutionProcesses(ctx context.Context, id string) ([]string, error) StartProcessing(ctx context.Context) error SetEventProcessor(processor services.EventProcessorFunc) SetMessageProcessor(processor services.MessageProcessorFunc) SetCompleteJobProcessor(processor services.CompleteJobProcessorFunc) SetCompleteActivity(processor services.CompleteActivityFunc) SetAbort(processor services.AbortFunc) DeleteJob(ctx context.Context, trackingID string) error SetCompleteActivityProcessor(processor services.CompleteActivityProcessorFunc) SetLaunchFunc(processor services.LaunchFunc) PublishWorkflowState(ctx context.Context, stateName string, state *model.WorkflowState, ops ...storage.PublishOpt) error PublishMessage(ctx context.Context, name string, key string, vars []byte) error Conn() common.NatsConn Shutdown() CloseUserTask(ctx context.Context, trackingID string) error OwnerID(name string) (string, error) OwnerName(id string) (string, error) GetOldState(ctx context.Context, id string) (*model.WorkflowState, error) CreateProcessInstance(ctx context.Context, workflowInstanceID string, parentProcessID string, parentElementID string, processName string, workflowName string, workflowId string) (*model.ProcessInstance, error) GetProcessInstance(ctx context.Context, processInstanceID string) (*model.ProcessInstance, error) DestroyProcessInstance(ctx context.Context, state *model.WorkflowState, pi *model.ProcessInstance, wi *model.Execution) error GetGatewayInstanceID(state *model.WorkflowState) (string, string, error) GetGatewayInstance(ctx context.Context, gatewayInstanceID string) (*model.Gateway, error) RecordHistoryProcessStart(ctx context.Context, state *model.WorkflowState) error RecordHistoryActivityExecute(ctx context.Context, state *model.WorkflowState) error RecordHistoryProcessAbort(ctx context.Context, state *model.WorkflowState) error RecordHistoryActivityComplete(ctx context.Context, state *model.WorkflowState) error RecordHistoryProcessComplete(ctx context.Context, state *model.WorkflowState) error RecordHistoryProcessSpawn(ctx context.Context, state *model.WorkflowState, newProcessInstanceID string) error GetProcessHistory(ctx context.Context, processInstanceId string) ([]*model.ProcessHistoryEntry, error) }
NatsService is the shar type responsible for interacting with NATS.
Click to show internal directories.
Click to hide internal directories.