commands

package
v0.0.0-...-e3dca73 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultJobTimeout     = 5 * time.Minute
	DefaultJobTimeoutInMs = int64(DefaultJobTimeout / time.Millisecond)
	DefaultJobWorkerName  = "default"
)
View Source
const (
	DefaultJobRetries = 3
)
View Source
const LatestVersion = -1

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivateJobsCommand

type ActivateJobsCommand struct {
	Command
	// contains filtered or unexported fields
}

func (*ActivateJobsCommand) FetchVariables

func (cmd *ActivateJobsCommand) FetchVariables(fetchVariables ...string) ActivateJobsCommandStep3

func (*ActivateJobsCommand) JobType

func (cmd *ActivateJobsCommand) JobType(jobType string) ActivateJobsCommandStep2

func (*ActivateJobsCommand) MaxJobsToActivate

func (cmd *ActivateJobsCommand) MaxJobsToActivate(maxJobsToActivate int32) ActivateJobsCommandStep3

func (*ActivateJobsCommand) Send

func (cmd *ActivateJobsCommand) Send(ctx context.Context) ([]entities.Job, error)

func (*ActivateJobsCommand) Timeout

func (*ActivateJobsCommand) WorkerName

func (cmd *ActivateJobsCommand) WorkerName(workerName string) ActivateJobsCommandStep3

type ActivateJobsCommandStep1

type ActivateJobsCommandStep1 interface {
	JobType(string) ActivateJobsCommandStep2
}

func NewActivateJobsCommand

func NewActivateJobsCommand(gateway pb.GatewayClient, pred retryPredicate) ActivateJobsCommandStep1

type ActivateJobsCommandStep2

type ActivateJobsCommandStep2 interface {
	MaxJobsToActivate(int32) ActivateJobsCommandStep3
}

type ActivateJobsCommandStep3

type ActivateJobsCommandStep3 interface {
	DispatchActivateJobsCommand

	Timeout(time.Duration) ActivateJobsCommandStep3
	WorkerName(string) ActivateJobsCommandStep3
	FetchVariables(...string) ActivateJobsCommandStep3
}

type CancelInstanceStep1

type CancelInstanceStep1 interface {
	WorkflowInstanceKey(int64) DispatchCancelWorkflowInstanceCommand
}

func NewCancelInstanceCommand

func NewCancelInstanceCommand(gateway pb.GatewayClient, pred retryPredicate) CancelInstanceStep1

type CancelWorkflowInstanceCommand

type CancelWorkflowInstanceCommand struct {
	Command
	// contains filtered or unexported fields
}

func (CancelWorkflowInstanceCommand) Send

func (CancelWorkflowInstanceCommand) WorkflowInstanceKey

type Command

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

type CompleteJobCommand

type CompleteJobCommand struct {
	Command
	// contains filtered or unexported fields
}

func (*CompleteJobCommand) JobKey

func (cmd *CompleteJobCommand) JobKey(jobKey int64) CompleteJobCommandStep2

func (*CompleteJobCommand) Send

func (*CompleteJobCommand) VariablesFromMap

func (cmd *CompleteJobCommand) VariablesFromMap(variables map[string]interface{}) (DispatchCompleteJobCommand, error)

func (*CompleteJobCommand) VariablesFromObject

func (cmd *CompleteJobCommand) VariablesFromObject(variables interface{}) (DispatchCompleteJobCommand, error)

func (*CompleteJobCommand) VariablesFromObjectIgnoreOmitempty

func (cmd *CompleteJobCommand) VariablesFromObjectIgnoreOmitempty(variables interface{}) (DispatchCompleteJobCommand, error)

func (*CompleteJobCommand) VariablesFromString

func (cmd *CompleteJobCommand) VariablesFromString(variables string) (DispatchCompleteJobCommand, error)

func (*CompleteJobCommand) VariablesFromStringer

func (cmd *CompleteJobCommand) VariablesFromStringer(variables fmt.Stringer) (DispatchCompleteJobCommand, error)

type CompleteJobCommandStep1

type CompleteJobCommandStep1 interface {
	JobKey(int64) CompleteJobCommandStep2
}

func NewCompleteJobCommand

func NewCompleteJobCommand(gateway pb.GatewayClient, pred retryPredicate) CompleteJobCommandStep1

type CompleteJobCommandStep2

type CompleteJobCommandStep2 interface {
	DispatchCompleteJobCommand

	VariablesFromString(string) (DispatchCompleteJobCommand, error)
	VariablesFromStringer(fmt.Stringer) (DispatchCompleteJobCommand, error)
	VariablesFromMap(map[string]interface{}) (DispatchCompleteJobCommand, error)
	VariablesFromObject(interface{}) (DispatchCompleteJobCommand, error)
	VariablesFromObjectIgnoreOmitempty(interface{}) (DispatchCompleteJobCommand, error)
}

type CreateInstanceCommand

type CreateInstanceCommand struct {
	Command
	// contains filtered or unexported fields
}

func (*CreateInstanceCommand) BPMNProcessId

func (*CreateInstanceCommand) LatestVersion

func (*CreateInstanceCommand) Send

func (*CreateInstanceCommand) VariablesFromMap

func (cmd *CreateInstanceCommand) VariablesFromMap(variables map[string]interface{}) (CreateInstanceCommandStep3, error)

func (*CreateInstanceCommand) VariablesFromObject

func (cmd *CreateInstanceCommand) VariablesFromObject(variables interface{}) (CreateInstanceCommandStep3, error)

func (*CreateInstanceCommand) VariablesFromObjectIgnoreOmitempty

func (cmd *CreateInstanceCommand) VariablesFromObjectIgnoreOmitempty(variables interface{}) (CreateInstanceCommandStep3, error)

func (*CreateInstanceCommand) VariablesFromString

func (cmd *CreateInstanceCommand) VariablesFromString(variables string) (CreateInstanceCommandStep3, error)

func (*CreateInstanceCommand) VariablesFromStringer

func (cmd *CreateInstanceCommand) VariablesFromStringer(variables fmt.Stringer) (CreateInstanceCommandStep3, error)

func (*CreateInstanceCommand) Version

func (*CreateInstanceCommand) WithResult

func (*CreateInstanceCommand) WorkflowKey

type CreateInstanceCommandStep1

type CreateInstanceCommandStep1 interface {
	BPMNProcessId(string) CreateInstanceCommandStep2
	WorkflowKey(int64) CreateInstanceCommandStep3
}

func NewCreateInstanceCommand

func NewCreateInstanceCommand(gateway pb.GatewayClient, pred retryPredicate) CreateInstanceCommandStep1

type CreateInstanceCommandStep2

type CreateInstanceCommandStep2 interface {
	Version(int32) CreateInstanceCommandStep3
	LatestVersion() CreateInstanceCommandStep3
}

type CreateInstanceCommandStep3

type CreateInstanceCommandStep3 interface {
	DispatchCreateInstanceCommand

	// Expected to be valid JSON string
	VariablesFromString(string) (CreateInstanceCommandStep3, error)

	// Expected to construct a valid JSON string
	VariablesFromStringer(fmt.Stringer) (CreateInstanceCommandStep3, error)

	// Expected that object is JSON serializable
	VariablesFromObject(interface{}) (CreateInstanceCommandStep3, error)
	VariablesFromObjectIgnoreOmitempty(interface{}) (CreateInstanceCommandStep3, error)
	VariablesFromMap(map[string]interface{}) (CreateInstanceCommandStep3, error)

	WithResult() CreateInstanceWithResultCommandStep1
}

type CreateInstanceWithResultCommand

type CreateInstanceWithResultCommand struct {
	Command
	// contains filtered or unexported fields
}

func (*CreateInstanceWithResultCommand) FetchVariables

func (cmd *CreateInstanceWithResultCommand) FetchVariables(variableNames ...string) CreateInstanceWithResultCommandStep1

func (*CreateInstanceWithResultCommand) Send

type CreateInstanceWithResultCommandStep1

type CreateInstanceWithResultCommandStep1 interface {
	DispatchCreateInstanceWithResultCommand

	FetchVariables(variableNames ...string) CreateInstanceWithResultCommandStep1
}

type DeployCommand

type DeployCommand struct {
	Command
	// contains filtered or unexported fields
}

func NewDeployCommand

func NewDeployCommand(gateway pb.GatewayClient, pred retryPredicate) *DeployCommand

func (*DeployCommand) AddResource

func (cmd *DeployCommand) AddResource(definition []byte, name string, resourceType pb.WorkflowRequestObject_ResourceType) *DeployCommand

func (*DeployCommand) AddResourceFile

func (cmd *DeployCommand) AddResourceFile(path string) *DeployCommand

func (*DeployCommand) Send

type DispatchActivateJobsCommand

type DispatchActivateJobsCommand interface {
	Send(ctx context.Context) ([]entities.Job, error)
}

type DispatchCancelWorkflowInstanceCommand

type DispatchCancelWorkflowInstanceCommand interface {
	Send(context.Context) (*pb.CancelWorkflowInstanceResponse, error)
}

type DispatchCompleteJobCommand

type DispatchCompleteJobCommand interface {
	Send(context.Context) (*pb.CompleteJobResponse, error)
}

type DispatchCreateInstanceCommand

type DispatchCreateInstanceCommand interface {
	Send(context.Context) (*pb.CreateWorkflowInstanceResponse, error)
}

type DispatchCreateInstanceWithResultCommand

type DispatchCreateInstanceWithResultCommand interface {
	Send(context.Context) (*pb.CreateWorkflowInstanceWithResultResponse, error)
}

type DispatchFailJobCommand

type DispatchFailJobCommand interface {
	Send(context.Context) (*pb.FailJobResponse, error)
}

type DispatchPublishMessageCommand

type DispatchPublishMessageCommand interface {
	Send(context.Context) (*pb.PublishMessageResponse, error)
}

type DispatchResolveIncidentCommand

type DispatchResolveIncidentCommand interface {
	Send(context.Context) (*pb.ResolveIncidentResponse, error)
}

type DispatchSetVariablesCommand

type DispatchSetVariablesCommand interface {
	Local(bool) DispatchSetVariablesCommand
	Send(context.Context) (*pb.SetVariablesResponse, error)
}

type DispatchThrowErrorCommand

type DispatchThrowErrorCommand interface {
	ErrorMessage(string) DispatchThrowErrorCommand
	Send(context.Context) (*pb.ThrowErrorResponse, error)
}

type DispatchUpdateJobRetriesCommand

type DispatchUpdateJobRetriesCommand interface {
	Send(context.Context) (*pb.UpdateJobRetriesResponse, error)
}

type FailJobCommand

type FailJobCommand struct {
	Command
	// contains filtered or unexported fields
}

func (*FailJobCommand) ErrorMessage

func (cmd *FailJobCommand) ErrorMessage(errorMessage string) FailJobCommandStep3

func (*FailJobCommand) JobKey

func (cmd *FailJobCommand) JobKey(jobKey int64) FailJobCommandStep2

func (*FailJobCommand) Retries

func (cmd *FailJobCommand) Retries(retries int32) FailJobCommandStep3

func (*FailJobCommand) Send

type FailJobCommandStep1

type FailJobCommandStep1 interface {
	JobKey(int64) FailJobCommandStep2
}

func NewFailJobCommand

func NewFailJobCommand(gateway pb.GatewayClient, pred retryPredicate) FailJobCommandStep1

type FailJobCommandStep2

type FailJobCommandStep2 interface {
	Retries(int32) FailJobCommandStep3
}

type FailJobCommandStep3

type FailJobCommandStep3 interface {
	DispatchFailJobCommand
	ErrorMessage(string) FailJobCommandStep3
}

type PublishMessageCommand

type PublishMessageCommand struct {
	Command
	// contains filtered or unexported fields
}

func (*PublishMessageCommand) CorrelationKey

func (cmd *PublishMessageCommand) CorrelationKey(key string) PublishMessageCommandStep3

func (*PublishMessageCommand) MessageId

func (cmd *PublishMessageCommand) MessageId(messageId string) PublishMessageCommandStep3

func (*PublishMessageCommand) MessageName

func (*PublishMessageCommand) Send

func (*PublishMessageCommand) TimeToLive

func (*PublishMessageCommand) VariablesFromMap

func (cmd *PublishMessageCommand) VariablesFromMap(variables map[string]interface{}) (PublishMessageCommandStep3, error)

func (*PublishMessageCommand) VariablesFromObject

func (cmd *PublishMessageCommand) VariablesFromObject(variables interface{}) (PublishMessageCommandStep3, error)

func (*PublishMessageCommand) VariablesFromObjectIgnoreOmitempty

func (cmd *PublishMessageCommand) VariablesFromObjectIgnoreOmitempty(variables interface{}) (PublishMessageCommandStep3, error)

func (*PublishMessageCommand) VariablesFromString

func (cmd *PublishMessageCommand) VariablesFromString(variables string) (PublishMessageCommandStep3, error)

func (*PublishMessageCommand) VariablesFromStringer

func (cmd *PublishMessageCommand) VariablesFromStringer(variables fmt.Stringer) (PublishMessageCommandStep3, error)

type PublishMessageCommandStep1

type PublishMessageCommandStep1 interface {
	MessageName(string) PublishMessageCommandStep2
}

func NewPublishMessageCommand

func NewPublishMessageCommand(gateway pb.GatewayClient, pred retryPredicate) PublishMessageCommandStep1

type PublishMessageCommandStep2

type PublishMessageCommandStep2 interface {
	CorrelationKey(string) PublishMessageCommandStep3
}

type PublishMessageCommandStep3

type PublishMessageCommandStep3 interface {
	DispatchPublishMessageCommand

	MessageId(string) PublishMessageCommandStep3
	TimeToLive(duration time.Duration) PublishMessageCommandStep3

	// Expected to be valid JSON string
	VariablesFromString(string) (PublishMessageCommandStep3, error)

	// Expected to construct a valid JSON string
	VariablesFromStringer(fmt.Stringer) (PublishMessageCommandStep3, error)

	// Expected that object is JSON serializable
	VariablesFromObject(interface{}) (PublishMessageCommandStep3, error)
	VariablesFromObjectIgnoreOmitempty(interface{}) (PublishMessageCommandStep3, error)
	VariablesFromMap(map[string]interface{}) (PublishMessageCommandStep3, error)
}

type ResolveIncidentCommand

type ResolveIncidentCommand struct {
	Command
	// contains filtered or unexported fields
}

func (*ResolveIncidentCommand) IncidentKey

func (cmd *ResolveIncidentCommand) IncidentKey(incidentKey int64) ResolveIncidentCommandStep2

func (*ResolveIncidentCommand) Send

type ResolveIncidentCommandStep1

type ResolveIncidentCommandStep1 interface {
	IncidentKey(int64) ResolveIncidentCommandStep2
}

func NewResolveIncidentCommand

func NewResolveIncidentCommand(gateway pb.GatewayClient, pred retryPredicate) ResolveIncidentCommandStep1

type ResolveIncidentCommandStep2

type ResolveIncidentCommandStep2 interface {
	DispatchResolveIncidentCommand
}

type SetVariablesCommand

type SetVariablesCommand struct {
	Command
	// contains filtered or unexported fields
}

func (*SetVariablesCommand) ElementInstanceKey

func (cmd *SetVariablesCommand) ElementInstanceKey(elementInstanceKey int64) SetVariablesCommandStep2

func (*SetVariablesCommand) Local

func (*SetVariablesCommand) Send

func (*SetVariablesCommand) VariablesFromMap

func (cmd *SetVariablesCommand) VariablesFromMap(variables map[string]interface{}) (DispatchSetVariablesCommand, error)

func (*SetVariablesCommand) VariablesFromObject

func (cmd *SetVariablesCommand) VariablesFromObject(variables interface{}) (DispatchSetVariablesCommand, error)

func (*SetVariablesCommand) VariablesFromObjectIgnoreOmitempty

func (cmd *SetVariablesCommand) VariablesFromObjectIgnoreOmitempty(variables interface{}) (DispatchSetVariablesCommand, error)

func (*SetVariablesCommand) VariablesFromString

func (cmd *SetVariablesCommand) VariablesFromString(variables string) (DispatchSetVariablesCommand, error)

func (*SetVariablesCommand) VariablesFromStringer

func (cmd *SetVariablesCommand) VariablesFromStringer(variables fmt.Stringer) (DispatchSetVariablesCommand, error)

type SetVariablesCommandStep1

type SetVariablesCommandStep1 interface {
	ElementInstanceKey(int64) SetVariablesCommandStep2
}

func NewSetVariablesCommand

func NewSetVariablesCommand(gateway pb.GatewayClient, pred retryPredicate) SetVariablesCommandStep1

type SetVariablesCommandStep2

type SetVariablesCommandStep2 interface {
	VariablesFromString(string) (DispatchSetVariablesCommand, error)
	VariablesFromStringer(fmt.Stringer) (DispatchSetVariablesCommand, error)
	VariablesFromMap(map[string]interface{}) (DispatchSetVariablesCommand, error)
	VariablesFromObject(interface{}) (DispatchSetVariablesCommand, error)
	VariablesFromObjectIgnoreOmitempty(interface{}) (DispatchSetVariablesCommand, error)
}

type ThrowErrorCommand

type ThrowErrorCommand struct {
	Command
	// contains filtered or unexported fields
}

func (*ThrowErrorCommand) ErrorCode

func (c *ThrowErrorCommand) ErrorCode(errorCode string) DispatchThrowErrorCommand

func (*ThrowErrorCommand) ErrorMessage

func (c *ThrowErrorCommand) ErrorMessage(errorMsg string) DispatchThrowErrorCommand

func (*ThrowErrorCommand) JobKey

func (*ThrowErrorCommand) Send

type ThrowErrorCommandStep1

type ThrowErrorCommandStep1 interface {
	JobKey(int64) ThrowErrorCommandStep2
}

func NewThrowErrorCommand

func NewThrowErrorCommand(gateway pb.GatewayClient, pred retryPredicate) ThrowErrorCommandStep1

type ThrowErrorCommandStep2

type ThrowErrorCommandStep2 interface {
	ErrorCode(string) DispatchThrowErrorCommand
}

type TopologyCommand

type TopologyCommand struct {
	Command
}

func NewTopologyCommand

func NewTopologyCommand(gateway pb.GatewayClient, pred retryPredicate) *TopologyCommand

func (*TopologyCommand) Send

type UpdateJobRetriesCommand

type UpdateJobRetriesCommand struct {
	Command
	// contains filtered or unexported fields
}

func (*UpdateJobRetriesCommand) JobKey

func (*UpdateJobRetriesCommand) Retries

func (*UpdateJobRetriesCommand) Send

type UpdateJobRetriesCommandStep1

type UpdateJobRetriesCommandStep1 interface {
	JobKey(int64) UpdateJobRetriesCommandStep2
}

func NewUpdateJobRetriesCommand

func NewUpdateJobRetriesCommand(gateway pb.GatewayClient, pred retryPredicate) UpdateJobRetriesCommandStep1

type UpdateJobRetriesCommandStep2

type UpdateJobRetriesCommandStep2 interface {
	DispatchUpdateJobRetriesCommand

	Retries(int32) DispatchUpdateJobRetriesCommand
}

Jump to

Keyboard shortcuts

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