Documentation
¶
Index ¶
- Constants
- Variables
- func ParseTaskSpec(taskSpec string) (*model.TaskSpec, error)
- func ParseTaskSpecFromFile(path string) (*model.TaskSpec, error)
- func RegisterTaskWithSpec[T, U any](ctx context.Context, c *Client, spec *model.TaskSpec, ...) error
- func RegisterTaskWithSpecFile[T, U any](ctx context.Context, c *Client, specFile string, ...) error
- type Client
- func (c *Client) AbandonUserTask(ctx context.Context, taskID string, keepData bool) error
- func (c *Client) CancelProcessInstance(ctx context.Context, processInstanceId string) error
- func (c *Client) CompleteUserTask(ctx context.Context, taskID string) error
- func (c *Client) DeprecateTaskSpec(ctx context.Context, name string) error
- func (c *Client) Dial(ctx context.Context, natsURL string, opts ...ConnectOption) error
- func (c *Client) DisableWorkflowExecution(ctx context.Context, workflowName string) error
- func (c *Client) DisableWorkflowExecutionWithPartition(ctx context.Context, workflowName string, partition string) error
- func (c *Client) EnableWorkflowExecution(ctx context.Context, workflowName string) error
- func (c *Client) EnableWorkflowExecutionWithPartition(ctx context.Context, workflowName string, partition string) error
- func (c *Client) GetFatalErrors(ctx context.Context, wfName string, workflowId string, executionId string, ...) ([]*model.FatalError, error)
- func (c *Client) GetFatalErrorsForPartition(ctx context.Context, wfName string, workflowId string, executionId string, ...) ([]*model.FatalError, error)
- func (c *Client) GetJob(ctx context.Context, id string) (*model.WorkflowState, error)
- func (c *Client) GetProcessHistory(ctx context.Context, processInstanceId string) ([]*model.ProcessHistoryEntry, error)
- func (c *Client) GetProcessInstanceHeaders(ctx context.Context, processInstanceID string) (LaunchHeaders, error)
- func (c *Client) GetProcessInstanceStatus(ctx context.Context, id string) ([]*model.ProcessHistoryEntry, error)
- func (c *Client) GetServerVersion(ctx context.Context) (*version.Version, error)
- func (c *Client) GetServerVersionInfo(ctx context.Context) (*model.GetVersionInfoResponse, error)
- func (c *Client) GetTaskSpecByUID(ctx context.Context, uid string) (*model.TaskSpec, error)
- func (c *Client) GetTaskSpecUsage(ctx context.Context, id string) (*model.TaskSpecUsageReport, error)
- func (c *Client) GetTaskSpecVersions(ctx context.Context, name string) ([]string, error)
- func (c *Client) GetTaskUIDFromSpec(spec *model.TaskSpec) (string, error)
- func (c *Client) GetWorkflow(ctx context.Context, id string) (*model.Workflow, error)
- func (c *Client) GetWorkflowVersions(ctx context.Context, name string) ([]*model.WorkflowVersion, error)
- func (c *Client) GetWorkflowVersionsForPartition(ctx context.Context, name string, partition string) ([]*model.WorkflowVersion, error)
- func (c *Client) HasWorkflowDefinitionChanged(ctx context.Context, name string, b []byte) (bool, error)
- func (c *Client) HasWorkflowDefinitionChangedWithPartition(ctx context.Context, name string, partition string, b []byte) (bool, error)
- func (c *Client) LaunchProcess(ctx context.Context, launchParams LaunchParams) (executionId string, workflowId string, er error)
- func (c *Client) ListExecutableProcesses(ctx context.Context) ([]*model.ListExecutableProcessesItem, error)
- func (c *Client) ListExecution(ctx context.Context, name string) ([]*model.ListExecutionItem, error)
- func (c *Client) ListExecutionProcesses(ctx context.Context, id string) (*model.ListExecutionProcessesResponse, error)
- func (c *Client) ListExecutionWithPartition(ctx context.Context, name string, partition string) ([]*model.ListExecutionItem, error)
- func (c *Client) ListNamespaces(ctx context.Context) ([]string, error)
- func (c *Client) ListTaskSpecs(ctx context.Context, includeDeprecated bool) ([]*model.TaskSpec, error)
- func (c *Client) ListUserTasks(ctx context.Context, query *UserTaskQuery) ([]UserTaskInstance, error)
- func (c *Client) ListWorkflows(ctx context.Context) ([]*model.ListWorkflowResponse, error)
- func (c *Client) ListWorkflowsForPartition(ctx context.Context, partition string) ([]*model.ListWorkflowResponse, error)
- func (c *Client) Listen(ctx context.Context) error
- func (c *Client) LoadBPMNWorkflowFromBytes(ctx context.Context, loadParams LoadWorkflowParams) (string, error)
- func (c *Client) LoadBundleBytes(ctx context.Context, b io.Reader) error
- func (c *Client) OpenUserTask(ctx context.Context, taskID string, opts ...OpenUserTaskOpts) (spec *model.TaskSpec, state model.Vars, err error)
- func (c *Client) PauseServiceTask(ctx context.Context, uid string) error
- func (c *Client) PruneWorkflowVersions(ctx context.Context, workflowName string) ([]string, error)
- func (c *Client) PruneWorkflowVersionsForPartition(ctx context.Context, workflowName string, partition string) ([]string, error)
- func (c *Client) RegisterFatalErrorListener(processId string, fatalErrListener task2.FatalErrorListenerFn)
- func (c *Client) RegisterMessageSender(ctx context.Context, workflowName string, messageName string, ...) error
- func (c *Client) RegisterMessageSenderWithPartition(ctx context.Context, partition string, workflowName string, messageName string, ...) error
- func (c *Client) RegisterTaskFunction(ctx context.Context, spec *model.TaskSpec, fn task2.ServiceFn) error
- func (c *Client) ResolveWorkflow(ctx context.Context, workflow *model.Workflow) (*model.Workflow, error)
- func (c *Client) ResumeServiceTask(ctx context.Context, uid string) error
- func (c *Client) Retry(ctx context.Context, processInstanceId string, elementId string, vars []byte) error
- func (c *Client) RetryFromPriorElement(ctx context.Context, processInstanceId string, elementId string, vars []byte, ...) error
- func (c *Client) SaveUserTaskState(ctx context.Context, taskID string, state model.Vars, overwrite bool) error
- func (c *Client) SendMessage(ctx context.Context, messageName string, key any, mvars model.Vars) error
- func (c *Client) SendMessageWithPartition(ctx context.Context, partition string, messageName string, key any, ...) error
- func (c *Client) Shutdown()
- func (c *Client) StoreTask(ctx context.Context, spec *model.TaskSpec) error
- type ConfigurationOption
- func WithConcurrency(n int) ConfigurationOption
- func WithEphemeralStorage() ConfigurationOption
- func WithLogger(logger *slog.Logger) ConfigurationOption
- func WithNamespace(name string) ConfigurationOption
- func WithNoOSSig() ConfigurationOption
- func WithNoRecovery() ConfigurationOption
- func WithOTELService(name string, version string) ConfigurationOption
- func WithOpenTelemetry() ConfigurationOption
- func WithZone(name string) ConfigurationOption
- type ConnectOption
- type ConnectOptions
- type ErrTaskInUse
- type FixedIDOption
- type LaunchHeaders
- type LaunchParams
- type LoadWorkflowParams
- type OpenUserTaskOpts
- type RegOpt
- type Result
- type TaskSpecOption
- type UserTaskInstance
- type UserTaskQuery
Constants ¶
const HeartBeatInterval = 1 * time.Second
HeartBeatInterval defines the time between client heartbeats.
Variables ¶
var ErrIndexNotReady = errors.New("index not ready")
ErrIndexNotReady indicates that an operation cannot be completed because the index is not ready.
Functions ¶
func ParseTaskSpec ¶ added in v1.1.1139
ParseTaskSpec parses a yaml task spec string into a task spec proto.
func ParseTaskSpecFromFile ¶ added in v1.1.1139
ParseTaskSpecFromFile reads a task specification from a file and parses it into a *model.TaskSpec. It returns the parsed task specification or an error if the file cannot be read or the task specification cannot be parsed.
func RegisterTaskWithSpec ¶ added in v1.1.1139
func RegisterTaskWithSpec[T, U any](ctx context.Context, c *Client, spec *model.TaskSpec, fn func(context.Context, task.JobClient, T) (U, error)) error
RegisterTaskWithSpec registers a task with the provided task specification and function. It takes a context, a *Client, a *model.TaskSpec, and a function as parameters. The function fn takes a context, a task.JobClient, and a parameter of type T, and returns a result of type U and an error. The function should handle the task execution logic. Before registering the task function, it validates the function parameters against the task specification. It returns an error if there is any validation error or if the task function registration fails.
func RegisterTaskWithSpecFile ¶ added in v1.1.1139
func RegisterTaskWithSpecFile[T, U any](ctx context.Context, c *Client, specFile string, fn func(context.Context, task.JobClient, T) (U, error)) error
RegisterTaskWithSpecFile reads a task specification from a file, parses it into a *model.TaskSpec, and registers a task with the parsed specification and a function. It takes a context, a *Client, a specFile string, and a function as parameters. The function fn takes a context, a task.JobClient, and a parameter of type T, and returns a result of type U. The function returns an error if there is an error parsing the task specification from the file, registering the task, or any other error that occurs. This function is a wrapper around the ParseTaskSpecFromFile and RegisterTaskWithSpec functions. The specFile parameter is the path to the file containing the task specification. The fn parameter is the function to be executed for the registered task. The context parameter is used for passing cancellation signals and deadlines between function calls.
Types ¶
type Client ¶
type Client struct {
SvcTasks map[string]*task2.FnDef `json:"svc_tasks,omitempty"`
MsgSender map[string]*task2.FnDef `json:"msg_sender,omitempty"`
ExpectedCompatibleServerVersion *version.Version `json:"expected_compatible_server_version,omitempty"`
ExpectedServerVersion *version.Version `json:"expected_server_version,omitempty"`
SendMiddleware []middleware2.Send `json:"send_middleware,omitempty"`
ReceiveMiddleware []middleware2.Receive `json:"receive_middleware,omitempty"`
// contains filtered or unexported fields
}
Client implements a SHAR client capable of listening for service task activations, listening for Workflow Messages, and integrating with the API
func (*Client) AbandonUserTask ¶ added in v1.1.1492
AbandonUserTask abandons a user task, releasing it back to the available task list.
func (*Client) CancelProcessInstance ¶ added in v1.0.645
CancelProcessInstance cancels a running Process Instance.
func (*Client) CompleteUserTask ¶
CompleteUserTask completes a user task, with the current stored state.
func (*Client) DeprecateTaskSpec ¶ added in v1.1.670
DeprecateTaskSpec deprecates a task spec by name.
func (*Client) DisableWorkflowExecution ¶ added in v1.1.1460
DisableWorkflowExecution will stop the workflow with the name from being executed
func (*Client) DisableWorkflowExecutionWithPartition ¶ added in v1.1.2115
func (c *Client) DisableWorkflowExecutionWithPartition(ctx context.Context, workflowName string, partition string) error
DisableWorkflowExecutionWithPartition will stop the workflow with the name and partition from being executed
func (*Client) EnableWorkflowExecution ¶ added in v1.1.1460
EnableWorkflowExecution will enable the workflow with the name to be executed
func (*Client) EnableWorkflowExecutionWithPartition ¶ added in v1.1.2115
func (c *Client) EnableWorkflowExecutionWithPartition(ctx context.Context, workflowName string, partition string) error
EnableWorkflowExecutionWithPartition will enable the workflow with the name and partition to be executed
func (*Client) GetFatalErrors ¶ added in v1.1.1377
func (c *Client) GetFatalErrors(ctx context.Context, wfName string, workflowId string, executionId string, processInstanceId string) ([]*model.FatalError, error)
GetFatalErrors calls the api endpoint to retrieve FatalErrors given a key prefix of <workflowName>.<executionId>.<processInstanceId>
func (*Client) GetFatalErrorsForPartition ¶ added in v1.1.2115
func (c *Client) GetFatalErrorsForPartition(ctx context.Context, wfName string, workflowId string, executionId string, processInstanceId string, partition string) ([]*model.FatalError, error)
GetFatalErrorsForPartition calls the api endpoint to retrieve FatalErrors given a key prefix of <partition>.<workflowName>.<executionId>.<processInstanceId>
func (*Client) GetProcessHistory ¶ added in v1.0.477
func (c *Client) GetProcessHistory(ctx context.Context, processInstanceId string) ([]*model.ProcessHistoryEntry, error)
GetProcessHistory gets the history for a process.
func (*Client) GetProcessInstanceHeaders ¶ added in v1.1.1323
func (c *Client) GetProcessInstanceHeaders(ctx context.Context, processInstanceID string) (LaunchHeaders, error)
GetProcessInstanceHeaders retrieves the headers attached to a specific process instance. It takes a context and the ID of the process instance as input. It returns a map of string headers (LaunchHeaders) and an error. The LaunchHeaders type represents a map of string headers that can be attached to a process when it is launched,
func (*Client) GetProcessInstanceStatus ¶ added in v1.0.427
func (c *Client) GetProcessInstanceStatus(ctx context.Context, id string) ([]*model.ProcessHistoryEntry, error)
GetProcessInstanceStatus lists the current workflow states for a process instance.
func (*Client) GetServerVersion ¶ added in v1.0.514
GetServerVersion returns the current server version, erroring if it is not compatible.
func (*Client) GetServerVersionInfo ¶ added in v1.1.2003
GetServerVersionInfo returns the current server version information.
func (*Client) GetTaskSpecByUID ¶ added in v1.0.623
GetTaskSpecByUID gets a versioned task spec by its UID
func (*Client) GetTaskSpecUsage ¶ added in v1.1.670
func (c *Client) GetTaskSpecUsage(ctx context.Context, id string) (*model.TaskSpecUsageReport, error)
GetTaskSpecUsage returns a report outlining task spec usage in executable and executing workflows.
func (*Client) GetTaskSpecVersions ¶ added in v1.1.670
GetTaskSpecVersions returns the version IDs associated with the named task spec.
func (*Client) GetTaskUIDFromSpec ¶ added in v1.1.1026
GetTaskUIDFromSpec returns a UID (string) based on a deterministic algorithm from a TaskSpec.
func (*Client) GetWorkflow ¶ added in v1.0.366
GetWorkflow - retrieves a workflow model given its ID
func (*Client) GetWorkflowVersions ¶ added in v1.0.366
func (c *Client) GetWorkflowVersions(ctx context.Context, name string) ([]*model.WorkflowVersion, error)
GetWorkflowVersions - returns a list of versions for a given workflow.
func (*Client) GetWorkflowVersionsForPartition ¶ added in v1.1.2115
func (c *Client) GetWorkflowVersionsForPartition(ctx context.Context, name string, partition string) ([]*model.WorkflowVersion, error)
GetWorkflowVersionsForPartition - returns a list of versions for a given workflow name and partition.
func (*Client) HasWorkflowDefinitionChanged ¶ added in v1.0.366
func (c *Client) HasWorkflowDefinitionChanged(ctx context.Context, name string, b []byte) (bool, error)
HasWorkflowDefinitionChanged - given a workflow name and a BPMN xml, return true if the resulting definition is different.
func (*Client) HasWorkflowDefinitionChangedWithPartition ¶ added in v1.1.2115
func (c *Client) HasWorkflowDefinitionChangedWithPartition(ctx context.Context, name string, partition string, b []byte) (bool, error)
HasWorkflowDefinitionChangedWithPartition - given a workflow name and partition and a BPMN xml, return true if the resulting definition is different.
func (*Client) LaunchProcess ¶ added in v1.0.645
func (c *Client) LaunchProcess(ctx context.Context, launchParams LaunchParams) (executionId string, workflowId string, er error)
LaunchProcess launches a new process within a workflow/BPMN definition. It returns the execution Id of the launched process and the workflow id of the BPMN definition containing the process
func (*Client) ListExecutableProcesses ¶ added in v1.1.1032
func (c *Client) ListExecutableProcesses(ctx context.Context) ([]*model.ListExecutableProcessesItem, error)
ListExecutableProcesses gets a list of executable processes.
func (*Client) ListExecution ¶ added in v1.0.645
func (c *Client) ListExecution(ctx context.Context, name string) ([]*model.ListExecutionItem, error)
ListExecution gets a list of running executions by workflow name.
func (*Client) ListExecutionProcesses ¶ added in v1.0.645
func (c *Client) ListExecutionProcesses(ctx context.Context, id string) (*model.ListExecutionProcessesResponse, error)
ListExecutionProcesses lists the current process IDs for an Execution.
func (*Client) ListExecutionWithPartition ¶ added in v1.1.2115
func (c *Client) ListExecutionWithPartition(ctx context.Context, name string, partition string) ([]*model.ListExecutionItem, error)
ListExecutionWithPartition gets a list of running executions by workflow name and partition.
func (*Client) ListNamespaces ¶ added in v1.1.2055
ListNamespaces retrieves a list of all available namespaces from the server and returns them as a slice of strings.
func (*Client) ListTaskSpecs ¶ added in v1.1.725
func (c *Client) ListTaskSpecs(ctx context.Context, includeDeprecated bool) ([]*model.TaskSpec, error)
ListTaskSpecs lists active and optionally deprecated task specs.
func (*Client) ListUserTasks ¶ added in v1.1.1492
func (c *Client) ListUserTasks(ctx context.Context, query *UserTaskQuery) ([]UserTaskInstance, error)
ListUserTasks lists tasks for the matching query or for the current user if query is nil.
func (*Client) ListWorkflows ¶
ListWorkflows gets a list of launchable workflow in SHAR.
func (*Client) ListWorkflowsForPartition ¶ added in v1.1.2115
func (c *Client) ListWorkflowsForPartition(ctx context.Context, partition string) ([]*model.ListWorkflowResponse, error)
ListWorkflowsForPartition gets a list of launchable workflow in SHAR for the given partition.
func (*Client) LoadBPMNWorkflowFromBytes ¶
func (c *Client) LoadBPMNWorkflowFromBytes(ctx context.Context, loadParams LoadWorkflowParams) (string, error)
LoadBPMNWorkflowFromBytes loads, parses, and stores a BPMN workflow in SHAR. Returns the uuid uniquely identifying the workflow.
func (*Client) LoadBundleBytes ¶ added in v1.1.1566
LoadBundleBytes loads a BPMN and tasks as a bundle from a tar.gz archive using a manifest.
func (*Client) OpenUserTask ¶ added in v1.1.1492
func (c *Client) OpenUserTask(ctx context.Context, taskID string, opts ...OpenUserTaskOpts) (spec *model.TaskSpec, state model.Vars, err error)
OpenUserTask locks a task to the current user, and returns its specification and state
func (*Client) PauseServiceTask ¶ added in v1.1.1796
PauseServiceTask pauses a service task ided by uid
func (*Client) PruneWorkflowVersions ¶ added in v1.1.2024
PruneWorkflowVersions deletes inactive workflow versions
func (*Client) PruneWorkflowVersionsForPartition ¶ added in v1.1.2115
func (c *Client) PruneWorkflowVersionsForPartition(ctx context.Context, workflowName string, partition string) ([]string, error)
PruneWorkflowVersionsForPartition deletes inactive workflow versions for a particular partition
func (*Client) RegisterFatalErrorListener ¶ added in v1.1.1547
func (c *Client) RegisterFatalErrorListener(processId string, fatalErrListener task2.FatalErrorListenerFn)
RegisterFatalErrorListener registers a fatal err callback fn
func (*Client) RegisterMessageSender ¶
func (c *Client) RegisterMessageSender(ctx context.Context, workflowName string, messageName string, sender task2.SenderFn) error
RegisterMessageSender registers a function that requires support for sending Workflow Messages
func (*Client) RegisterMessageSenderWithPartition ¶ added in v1.1.2115
func (c *Client) RegisterMessageSenderWithPartition(ctx context.Context, partition string, workflowName string, messageName string, sender task2.SenderFn) error
RegisterMessageSenderWithPartition registers a function that requires support for sending Workflow Messages for the given partition name
func (*Client) RegisterTaskFunction ¶ added in v1.1.947
func (c *Client) RegisterTaskFunction(ctx context.Context, spec *model.TaskSpec, fn task2.ServiceFn) error
RegisterTaskFunction registers a service task function. If the service task spec has no UID then it will be calculated and written to the Metadata.Uid field.
func (*Client) ResolveWorkflow ¶ added in v1.1.927
func (c *Client) ResolveWorkflow(ctx context.Context, workflow *model.Workflow) (*model.Workflow, error)
ResolveWorkflow - returns a list of versions for a given workflow.
func (*Client) ResumeServiceTask ¶ added in v1.1.1796
ResumeServiceTask resumes a service task ided by uid
func (*Client) Retry ¶ added in v1.1.1377
func (c *Client) Retry(ctx context.Context, processInstanceId string, elementId string, vars []byte) error
Retry will attempt re-execution of the fatally errored service task with elementId in the processInstanceId
func (*Client) RetryFromPriorElement ¶ added in v1.1.1547
func (c *Client) RetryFromPriorElement(ctx context.Context, processInstanceId string, elementId string, vars []byte, priorElementId string) error
RetryFromPriorElement will attempt re-execution of the fatally errored service task with elementId in the processInstanceId from the priorElementId
func (*Client) SaveUserTaskState ¶ added in v1.1.1492
func (c *Client) SaveUserTaskState(ctx context.Context, taskID string, state model.Vars, overwrite bool) error
SaveUserTaskState saves variable state into the current task. Additive unless overwrite is set.
func (*Client) SendMessage ¶
func (c *Client) SendMessage(ctx context.Context, messageName string, key any, mvars model.Vars) error
SendMessage sends a Workflow Message to a specific workflow instance
func (*Client) SendMessageWithPartition ¶ added in v1.1.2115
func (c *Client) SendMessageWithPartition(ctx context.Context, partition string, messageName string, key any, mvars model.Vars) error
SendMessageWithPartition sends a Workflow Message to a specific workflow instance for a partition
type ConfigurationOption ¶ added in v1.1.848
type ConfigurationOption func(*Client)
ConfigurationOption represents an interface for configuring a client.
func WithConcurrency ¶ added in v1.0.320
func WithConcurrency(n int) ConfigurationOption
WithConcurrency specifies the number of threads to process each service task.
func WithEphemeralStorage ¶ added in v0.1.175
func WithEphemeralStorage() ConfigurationOption
WithEphemeralStorage specifies a client store the result of all operations in memory.
func WithLogger ¶ added in v1.1.1500
func WithLogger(logger *slog.Logger) ConfigurationOption
WithLogger uses the passed logger for logging in the shar client
func WithNamespace ¶ added in v1.1.835
func WithNamespace(name string) ConfigurationOption
WithNamespace applies a client namespace.
func WithNoOSSig ¶ added in v1.1.731
func WithNoOSSig() ConfigurationOption
WithNoOSSig disables SIGINT and SIGKILL processing within the client.
func WithNoRecovery ¶ added in v1.1.677
func WithNoRecovery() ConfigurationOption
WithNoRecovery disables panic recovery for debugging.
func WithOTELService ¶ added in v1.1.1687
func WithOTELService(name string, version string) ConfigurationOption
WithOTELService applies a open telemetry service and version.
func WithOpenTelemetry ¶ added in v1.1.848
func WithOpenTelemetry() ConfigurationOption
WithOpenTelemetry enables the flow of Open Telemetry Trace and Span IDs.
func WithZone ¶ added in v1.1.1977
func WithZone(name string) ConfigurationOption
WithZone specifies the receive zone this client is bound to
type ConnectOption ¶ added in v1.1.1327
type ConnectOption func(*ConnectOptions)
ConnectOption is a function type that modifies a ConnectOptions struct.
func WithJetStreamDomain ¶ added in v1.1.1327
func WithJetStreamDomain(domain string) ConnectOption
WithJetStreamDomain sets the JetStream domain for ConnectOptions.
func WithNatsOption ¶ added in v1.1.1327
func WithNatsOption(opt nats.Option) ConnectOption
WithNatsOption allows nats options to be provided to a connection
type ConnectOptions ¶ added in v1.1.1327
type ConnectOptions struct {
// contains filtered or unexported fields
}
ConnectOptions represents the options for connecting to a NATS server. It includes the NATS options and the JetStream domain.
type ErrTaskInUse ¶ added in v1.1.670
type ErrTaskInUse struct {
Err error
Usage *model.TaskSpecUsageReport
}
ErrTaskInUse is returned when an operation failed because it was attempted on a task in use.
func (ErrTaskInUse) Error ¶ added in v1.1.670
func (e ErrTaskInUse) Error() string
Error returns the string version of the ErrWorkflowFatal error
type FixedIDOption ¶ added in v1.0.514
type FixedIDOption struct {
// contains filtered or unexported fields
}
FixedIDOption contains a fixed ID which will be used to register a task
func WithFixedID ¶ added in v1.0.514
func WithFixedID(id string) FixedIDOption
WithFixedID is a modifier which returns a FixedIDOption containing the specified ID.
type LaunchHeaders ¶ added in v1.1.1323
LaunchHeaders represents a map of string headers that can be attached to a process when it is launched. The keys are the header names and the values are the header values.
type LaunchParams ¶ added in v1.1.1323
type LaunchParams struct {
LaunchHeaders
ProcessID string // Process ID to start.
Partition string // Partition to launch process in
Vars model.Vars // Variables to launch the process with
}
LaunchParams represents the parameters for launching a new process within a workflow/BPMN definition.
type LoadWorkflowParams ¶ added in v1.1.1323
type LoadWorkflowParams struct {
LaunchHeaders
Name string // Name of the workflow to load.
Partition string // Partition this goes into that optionally differentiates/isolates workflows with the same name
WorkflowBPMN []byte // WorkflowBPMN - byte array containing a valid BPMN XML workflow.
}
LoadWorkflowParams represents the parameters for loading a workflow. It includes a `WithLaunchHeaders` field that represents the headers to attach to a process when it is launched, and a `Name` field that specifies the name of the workflow to load.
type OpenUserTaskOpts ¶ added in v1.1.1492
type OpenUserTaskOpts func(opts *openUserTaskOptions)
OpenUserTaskOpts are functional options for configuring parameters when opening a user task.
func WithLockDuration ¶ added in v1.1.1492
func WithLockDuration(d time.Duration) OpenUserTaskOpts
WithLockDuration sets the lock duration for the user task.
type RegOpt ¶ added in v1.0.514
type RegOpt interface {
// contains filtered or unexported methods
}
RegOpt represents an option that can be passed to the task register function.
type Result ¶ added in v1.1.1913
Result is a generic result type that carries an error and a value of type T.
type TaskSpecOption ¶ added in v1.0.514
type TaskSpecOption struct {
// contains filtered or unexported fields
}
TaskSpecOption contains the task specification.
func WithSpec ¶ added in v1.0.514
func WithSpec(spec *model.TaskSpec) TaskSpecOption
WithSpec allows the client to define a task specification to SHAR.
type UserTaskInstance ¶ added in v1.1.1492
type UserTaskInstance interface {
ID() string // ID - the ID of the task
Spec() (*model.TaskSpec, error) // Spec - the task specification for the task.
State() (model.Vars, error) // State - the current variable state of the task.
LockedBy() (string, error) // LockedBy - return the task's owner.
}
UserTaskInstance represents a task assigned to a user.
type UserTaskQuery ¶ added in v1.1.1492
type UserTaskQuery struct {
UserID string // UserID to return tasks for either provide this or GroupID.
GroupID string // GroupID to return tasks for either provide this or UserID.
IncludeLocked bool // Include tasks locked to other users.
}
UserTaskQuery represents the criteria for querying user tasks.