workflows

package
v0.0.0-...-0a06464 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

README

Workflows

A workflow is custom application logic that consists of a set of tasks and or state transitions.

Implementing a new Workflow

A compliant workflow needs to implement the Workflow interface included in the workflow.go file.

Using Temporal

When using temporal as the workflow, the task queue must be provided as an Option in the start request struct with the key: task_queue

Associated Information

The following link to the workflow proposal will provide more information on this feature area: https://github.com/dapr/dapr/issues/4576

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("this component doesn't implement the current API operation")

Functions

This section is empty.

Types

type GetRequest

type GetRequest struct {
	InstanceID string `json:"instanceID"`
}

GetRequest is the struct describing a get workflow state request.

type Metadata

type Metadata struct {
	metadata.Base `json:",inline"`
}

Metadata represents a set of workflow specific properties.

type PauseRequest

type PauseRequest struct {
	InstanceID string `json:"instanceID"`
}

PauseRequest is the struct describing a pause workflow request.

type PurgeRequest

type PurgeRequest struct {
	InstanceID string `json:"instanceID"`
}

PurgeRequest is the object describing a Purge request.

type RaiseEventRequest

type RaiseEventRequest struct {
	InstanceID string `json:"instanceID"`
	EventName  string `json:"name"`
	EventData  []byte `json:"data"`
}

RaiseEventRequest is the struct describing a raise workflow event request.

type ResumeRequest

type ResumeRequest struct {
	InstanceID string `json:"instanceID"`
}

ResumeRequest is the struct describing a resume workflow request.

type StartRequest

type StartRequest struct {
	InstanceID    string            `json:"instanceID"`
	Options       map[string]string `json:"options"`
	WorkflowName  string            `json:"workflowName"`
	WorkflowInput []byte            `json:"workflowInput"`
}

StartRequest is the struct describing a start workflow request.

type StartResponse

type StartResponse struct {
	InstanceID string `json:"instanceID"`
}

type StateResponse

type StateResponse struct {
	Workflow *WorkflowState `json:"workflow"`
}

type TerminateRequest

type TerminateRequest struct {
	InstanceID string `json:"instanceID"`
}

TerminateRequest is the struct describing a terminate workflow request.

type Workflow

type Workflow interface {
	Init(metadata Metadata) error
	Start(ctx context.Context, req *StartRequest) (*StartResponse, error)
	Terminate(ctx context.Context, req *TerminateRequest) error
	Get(ctx context.Context, req *GetRequest) (*StateResponse, error)
	RaiseEvent(ctx context.Context, req *RaiseEventRequest) error
	Purge(ctx context.Context, req *PurgeRequest) error
	Pause(ctx context.Context, req *PauseRequest) error
	Resume(ctx context.Context, req *ResumeRequest) error
	GetComponentMetadata() map[string]string
}

Workflow is an interface to perform operations on Workflow.

type WorkflowState

type WorkflowState struct {
	InstanceID    string            `json:"instanceID"`
	WorkflowName  string            `json:"workflowName"`
	CreatedAt     time.Time         `json:"startedAt"`
	LastUpdatedAt time.Time         `json:"lastUpdatedAt"`
	RuntimeStatus string            `json:"runtimeStatus"`
	Properties    map[string]string `json:"properties"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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