Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenReturnStream ¶ added in v1.1.1032
func ListenReturnStream[T proto.Message, U proto.Message](con common.NatsConn, panicRecovery bool, subList *sync.Map, subject string, receiveAPIMiddleware []middleware.Receive, req T, fn func(ctx context.Context, req T, res chan<- U, errs chan<- error)) error
ListenReturnStream is a function that sets up a NATS subscription to handle streaming reply messages. It executes the provided function to process the request and send the response messages. The function runs in a separate goroutine that continuously listens for return messages and error messages, and publishes them to the reply inbox. the function exits when an error or cancellation occurs.
Types ¶
type Endpoints ¶ added in v1.1.1131
type Endpoints struct {
// contains filtered or unexported fields
}
Endpoints provides API endpoints for SHAR
func New ¶
func New(bpmnOperations *workflow.Operations, nc *natz.NatsConnConfiguration, options *option.ServerOptions) (*Endpoints, error)
New creates a new instance of the SHAR API server
type WorkflowEngine ¶ added in v1.1.1124
type WorkflowEngine interface {
CancelProcessInstance(ctx context.Context, state *model.WorkflowState) error
CompleteManualTask(ctx context.Context, job *model.WorkflowState, newVars []byte) error
CompleteSendMessageTask(ctx context.Context, job *model.WorkflowState, newVars []byte) error
CompleteServiceTask(ctx context.Context, job *model.WorkflowState, newVars []byte) error
CompleteUserTask(ctx context.Context, job *model.WorkflowState, newVars []byte) error
DeprecateTaskSpec(ctx context.Context, uid []string) error
GetCompensationInputVariables(ctx context.Context, processInstanceId string, trackingID string) ([]byte, error)
GetCompensationOutputVariables(ctx context.Context, processInstanceId string, trackingID string) ([]byte, error)
GetExecution(ctx context.Context, executionID string) (*model.Execution, error)
GetJob(ctx context.Context, trackingID string) (*model.WorkflowState, error)
GetOldState(ctx context.Context, id string) (*model.WorkflowState, error)
GetProcessHistory(ctx context.Context, processInstanceId string, wch chan<- *model.ProcessHistoryEntry, errs chan<- error)
GetProcessIdFor(ctx context.Context, startEventMessageName string) (string, error)
GetProcessInstance(ctx context.Context, processInstanceID string) (*model.ProcessInstance, error)
GetProcessInstanceStatus(ctx context.Context, id string, wch chan<- *model.WorkflowState, errs chan<- error)
GetTaskSpecByUID(ctx context.Context, uid string) (*model.TaskSpec, error)
GetTaskSpecUsage(ctx context.Context, uid []string) (*model.TaskSpecUsageReport, error)
GetTaskSpecVersions(ctx context.Context, name string) (*model.TaskSpecVersions, error)
GetUserTaskIDs(ctx context.Context, owner string) (*model.UserTasks, error)
GetWorkflow(ctx context.Context, workflowID string) (*model.Workflow, error)
GetWorkflowVersions(ctx context.Context, workflowName string, wch chan<- *model.WorkflowVersion, errs chan<- error)
HandleWorkflowError(ctx context.Context, errorCode string, message string, vars []byte, job *model.WorkflowState) error
Heartbeat(ctx context.Context, req *model.HeartbeatRequest) error
Launch(ctx context.Context, processName string, vars []byte) (string, string, error)
ListExecutableProcesses(ctx context.Context, wch chan<- *model.ListExecutableProcessesItem, errs chan<- error)
ListExecutionProcesses(ctx context.Context, id string) ([]string, error)
ListExecutions(ctx context.Context, workflowName string, wch chan<- *model.ListExecutionItem, errs chan<- error)
ListTaskSpecUIDs(ctx context.Context, deprecated bool) ([]string, error)
ListWorkflows(ctx context.Context, res chan<- *model.ListWorkflowResponse, errs chan<- error)
LoadWorkflow(ctx context.Context, model *model.Workflow) (string, error)
Log(ctx context.Context, req *model.LogRequest) error
OwnerID(ctx context.Context, name string) (string, error)
ProcessServiceTasks(ctx context.Context, wf *model.Workflow, svcTaskConsFn workflow.ServiceTaskConsumerFn, wfProcessMappingFn workflow.WorkflowProcessMappingFn) error
PublishMsg(ctx context.Context, subject string, sharMsg proto.Message) error
PublishWorkflowState(ctx context.Context, stateName string, state *model.WorkflowState, opts ...workflow.PublishOpt) error
PutTaskSpec(ctx context.Context, spec *model.TaskSpec) (string, error)
SignalFatalError(ctx context.Context, state *model.WorkflowState, log *slog.Logger)
Shutdown()
Start(ctx context.Context) error
}
WorkflowEngine represents an interface for executing and managing workflow processes. It provides methods for various tasks such as canceling process instances, completing tasks, retrieving workflow-related information, and managing workflow execution.