models

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateAndWaitRequest added in v1.0.11

type CreateAndWaitRequest struct {
	CreateWorkflowRequest CreateWorkflowRequest `json:"createWorkflowRequest"`
	WaitSeconds           int                   `json:"waitSeconds"`
	CheckSeconds          int                   `json:"checkSeconds"`
	WaitForStates         []string              `json:"waitForStates"`
}

CreateAndWaitRequest is the payload for creating a workflow then waiting the number of seconds for the workflow to reach the given states. otherwise it times out

type CreateWorkflowRequest added in v1.0.11

type CreateWorkflowRequest struct {
	ExternalID    string            `json:"externalId"`
	ExecutorGroup string            `json:"executorGroup"`
	WorkflowType  string            `json:"workflowType"`
	BusinessKey   string            `json:"businessKey"`
	StateVars     map[string]string `json:"stateVars"`
	// Optional scheduling inputs
	NextActivation       *time.Time `json:"nextActivation,omitempty"`
	NextActivationOffset string     `json:"nextActivationOffset,omitempty"`
}

CreateWorkflowRequest is the payload for creating a workflow.

type NextState

type NextState struct {
	Name                string    // Name of the state
	ActionLog           string    // Additional information about the state
	NextExecution       time.Time //specific time set by the code
	NextExecutionOffset string    // a  human friendly time string sent to the database ie 10 minutes
}

type RetryConfig

type RetryConfig struct {
	MaxRetryCount    int
	RetryIntervalMin time.Duration
	RetryIntervalMax time.Duration
}

func (*RetryConfig) SlidingInterval

func (rc *RetryConfig) SlidingInterval(retryNum int) time.Duration

create a function that is a sliding scale between the min and max based on the number of retries SlidingInterval returns a retry interval between min and max based on the current retry attempt.

type SearchWorkflowRequest

type SearchWorkflowRequest struct {
	ID            int64  `json:"id"`
	ExternalID    string `json:"externalId"`
	ExecutorGroup string `json:"executorGroup"`
	WorkflowType  string `json:"workflowType"`
	BusinessKey   string `json:"businessKey"`
	State         string `json:"state"`
	Status        string `json:"status"`
	Limit         int64  `json:"limit"`
	Offset        int64  `json:"offset"`
}

type SearchWorkflowResponse

type SearchWorkflowResponse struct {
	Results   int               `json:"results"`
	Workflows []domain.Workflow `json:"workflows"`
	Offset    int64             `json:"offset"`
}

type StateType

type StateType string
const (
	StateStart  StateType = "Start"  // Initial state
	StateNormal StateType = "Normal" // Normal state
	StateManual StateType = "Manual" // Manual state
	StateError  StateType = "Error"  // Error state
	StateEnd    StateType = "End"    // End state
)

type UpdateStateVarRequest added in v1.0.11

type UpdateStateVarRequest struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type UpdateStateVarResponse added in v1.0.11

type UpdateStateVarResponse struct {
	OK bool `json:"ok"`
}

type UpdateWorkflowStateAndWaitRequest added in v1.0.11

type UpdateWorkflowStateAndWaitRequest struct {
	UpdateWorkflowStateRequest UpdateWorkflowStateRequest `json:"updateWorkflowStateRequest"`
	UpdateStateVarRequest      UpdateStateVarRequest      `json:"updateStateVarRequest"`
	WaitSeconds                int                        `json:"waitSeconds"`
	CheckSeconds               int                        `json:"checkSeconds"`
	FromStates                 []string                   `json:"fromStates"`
	WaitForStates              []string                   `json:"waitForStates"`
}

type UpdateWorkflowStateRequest added in v1.0.11

type UpdateWorkflowStateRequest struct {
	State          string     `json:"state"`
	NextActivation *time.Time `json:"nextActivation,omitempty"`
}

type UpdateWorkflowStateResponse added in v1.0.11

type UpdateWorkflowStateResponse struct {
	OK bool `json:"ok"`
}

type WorkflowApiResponse added in v1.0.11

type WorkflowApiResponse struct {
	ID             int64             `json:"id"`
	Status         string            `json:"status"`
	ExecutionCount int               `json:"executionCount"`
	RetryCount     int               `json:"retryCount"`
	Created        time.Time         `json:"created"`
	Modified       time.Time         `json:"modified"`
	NextActivation time.Time         `json:"nextActivation,omitempty"`
	Started        time.Time         `json:"started,omitempty"`
	ExecutorID     string            `json:"executorId,omitempty"`
	ExecutorGroup  string            `json:"executorGroup"`
	WorkflowType   string            `json:"workflowType"`
	ExternalID     string            `json:"externalId"`
	BusinessKey    string            `json:"businessKey"`
	State          string            `json:"state"`
	StateVars      map[string]string `json:"stateVars,omitempty"`
}

WorkflowApiResponse represents the API response for a workflow.

type WorkflowState

type WorkflowState struct {
	Name      string    // Name of the state
	StateType StateType // Type of the state (e.g., Start, Normal, End)
}

Jump to

Keyboard shortcuts

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