Documentation
¶
Overview ¶
Package handlers provides workflow handling capabilities
Package handlers provides workflow handling capabilities
Index ¶
- Constants
- Variables
- func CreateMockApplication() modular.Application
- func FixEventHandlerGetService(app modular.Application, name string) interface{}
- func FixHTTPHandlerService(app modular.Application, name string) interface{}
- func FixMessagingHandlerServices(app modular.Application) map[string]interface{}
- func GetEventProcessor(app modular.Application) interface{}
- func GetService(app modular.Application, name string) interface{}
- func NewServiceRegistryAdapter(app modular.Application) *applicationServiceRegistryAdapter
- func RegisterEventProcessor(app modular.Application, processor *module.EventProcessor) error
- type ApplicationHelper
- type EventAdapterConfig
- type EventHandlerConfig
- type EventPatternConfig
- type EventProcessorAdapter
- type EventWorkflowConfig
- type EventWorkflowHandler
- func (h *EventWorkflowHandler) CanHandle(workflowType string) bool
- func (h *EventWorkflowHandler) ConfigureWorkflow(app modular.Application, workflowConfig interface{}) error
- func (h *EventWorkflowHandler) ExecuteWorkflow(ctx context.Context, workflowType string, action string, ...) (map[string]interface{}, error)
- type HTTPRouteConfig
- type HTTPWorkflowHandler
- func (h *HTTPWorkflowHandler) CanHandle(workflowType string) bool
- func (h *HTTPWorkflowHandler) ConfigureWorkflow(app modular.Application, workflowConfig interface{}) error
- func (h *HTTPWorkflowHandler) ExecuteWorkflow(ctx context.Context, workflowType string, action string, ...) (map[string]interface{}, error)
- type IntegrationConnector
- type IntegrationStep
- type IntegrationWorkflowConfig
- type IntegrationWorkflowHandler
- func (h *IntegrationWorkflowHandler) CanHandle(workflowType string) bool
- func (h *IntegrationWorkflowHandler) ConfigureWorkflow(app modular.Application, workflowConfig interface{}) error
- func (h *IntegrationWorkflowHandler) ExecuteIntegrationWorkflow(ctx context.Context, registry module.IntegrationRegistry, ...) (map[string]interface{}, error)
- func (h *IntegrationWorkflowHandler) ExecuteWorkflow(ctx context.Context, workflowType string, action string, ...) (map[string]interface{}, error)
- func (h *IntegrationWorkflowHandler) Init(registry modular.ServiceRegistry) error
- func (h *IntegrationWorkflowHandler) Name() string
- func (h *IntegrationWorkflowHandler) Start(ctx context.Context) error
- func (h *IntegrationWorkflowHandler) Stop(ctx context.Context) error
- type MessagingWorkflowHandler
- func (h *MessagingWorkflowHandler) CanHandle(workflowType string) bool
- func (h *MessagingWorkflowHandler) ConfigureWorkflow(app modular.Application, workflowConfig interface{}) error
- func (h *MessagingWorkflowHandler) ExecuteWorkflow(ctx context.Context, workflowType string, action string, ...) (map[string]interface{}, error)
- func (h *MessagingWorkflowHandler) Name() string
- type MockEngine
- func (e *MockEngine) AddModuleType(name string, creator interface{})
- func (e *MockEngine) BuildFromConfig(cfg interface{}) error
- func (e *MockEngine) RegisterHandler(name string, handler interface{})
- func (e *MockEngine) Start(ctx context.Context) error
- func (e *MockEngine) Stop(ctx context.Context) error
- type ScheduledJobConfig
- type SchedulerTestHelper
- type SchedulerWorkflowHandler
- func (h *SchedulerWorkflowHandler) CanHandle(workflowType string) bool
- func (h *SchedulerWorkflowHandler) ConfigureWorkflow(app modular.Application, workflowConfig interface{}) error
- func (h *SchedulerWorkflowHandler) ExecuteWorkflow(ctx context.Context, workflowType string, action string, ...) (map[string]interface{}, error)
- type ServiceAccessor
- type ServiceHelper
- func (s *ServiceHelper) GetService(name string, dest interface{}) error
- func (s *ServiceHelper) Init() error
- func (s *ServiceHelper) RegisterService(name string, service interface{}) error
- func (s *ServiceHelper) Service(name string) interface{}
- func (s *ServiceHelper) Services() map[string]interface{}
- func (s *ServiceHelper) SvcRegistry() map[string]interface{}
- type StateMachineDefinition
- type StateMachineHookConfig
- type StateMachineState
- type StateMachineTransition
- type StateMachineWorkflowConfig
- type StateMachineWorkflowHandler
- func (h *StateMachineWorkflowHandler) CanHandle(workflowType string) bool
- func (h *StateMachineWorkflowHandler) ConfigureWorkflow(app modular.Application, workflowConfig interface{}) error
- func (h *StateMachineWorkflowHandler) ExecuteWorkflow(ctx context.Context, workflowType string, action string, ...) (map[string]interface{}, error)
- func (h *StateMachineWorkflowHandler) Name() string
- type TestJob
- type TestServiceRegistry
- func (t *TestServiceRegistry) ConfigProvider() modular.ConfigProvider
- func (t *TestServiceRegistry) ConfigSections() map[string]modular.ConfigProvider
- func (t *TestServiceRegistry) GetConfigSection(section string) (modular.ConfigProvider, error)
- func (t *TestServiceRegistry) GetService(name string, dest interface{}) error
- func (t *TestServiceRegistry) Init() error
- func (t *TestServiceRegistry) IsVerboseConfig() bool
- func (t *TestServiceRegistry) Logger() modular.Logger
- func (t *TestServiceRegistry) RegisterConfigSection(name string, config modular.ConfigProvider)
- func (t *TestServiceRegistry) RegisterModule(module modular.Module)
- func (t *TestServiceRegistry) RegisterService(name string, service interface{}) error
- func (t *TestServiceRegistry) Run() error
- func (t *TestServiceRegistry) SetLogger(logger modular.Logger)
- func (t *TestServiceRegistry) SetMockConfig(config modular.ConfigProvider)
- func (t *TestServiceRegistry) SetMockLogger(logger modular.Logger)
- func (t *TestServiceRegistry) SetVerboseConfig(enabled bool)
- func (t *TestServiceRegistry) Start() error
- func (t *TestServiceRegistry) Stop() error
- func (t *TestServiceRegistry) SvcRegistry() modular.ServiceRegistry
- type TopicHandlerConfig
Constants ¶
const (
IntegrationWorkflowHandlerName = "workflow.handler.integration"
)
Standard handler name constants
const (
MessagingWorkflowHandlerName = "workflow.handler.messaging"
)
Standard handler name constants
const (
StateMachineWorkflowHandlerName = "workflow.handler.statemachine"
)
Standard handler name
Variables ¶
var PatchAppServiceCalls = func(app modular.Application) {
}
PatchAppServiceCalls patches common calls in the application's handler functions This is a temporary solution until the handlers are updated to use the new API
Functions ¶
func CreateMockApplication ¶
func CreateMockApplication() modular.Application
CreateMockApplication creates a mock application for testing
func FixEventHandlerGetService ¶
func FixEventHandlerGetService(app modular.Application, name string) interface{}
FixEventHandlerGetService fixes the GetService calls in events.go
func FixHTTPHandlerService ¶
func FixHTTPHandlerService(app modular.Application, name string) interface{}
FixHTTPHandlerService fixes app.Service calls in http.go
func FixMessagingHandlerServices ¶
func FixMessagingHandlerServices(app modular.Application) map[string]interface{}
FixMessagingHandlerServices fixes app.Services calls in messaging.go
func GetEventProcessor ¶
func GetEventProcessor(app modular.Application) interface{}
GetEventProcessor is a utility function to get the event processor service
func GetService ¶
func GetService(app modular.Application, name string) interface{}
GetService is a utility function to get services from an application
func NewServiceRegistryAdapter ¶
func NewServiceRegistryAdapter(app modular.Application) *applicationServiceRegistryAdapter
NewServiceRegistryAdapter creates an adapter for service registry operations
func RegisterEventProcessor ¶
func RegisterEventProcessor(app modular.Application, processor *module.EventProcessor) error
RegisterEventProcessor creates and registers an EventProcessorAdapter for the given event processor
Types ¶
type ApplicationHelper ¶
type ApplicationHelper struct {
// contains filtered or unexported fields
}
ApplicationHelper extends the modular.Application with useful service methods
func NewApplicationHelper ¶
func NewApplicationHelper(app modular.Application) *ApplicationHelper
NewApplicationHelper creates a helper for application service access
func WithHelper ¶
func WithHelper(app modular.Application) *ApplicationHelper
WithHelper returns the helper or creates one if needed
func (*ApplicationHelper) Service ¶
func (h *ApplicationHelper) Service(name string) interface{}
Service provides access to a named service
func (*ApplicationHelper) Services ¶
func (h *ApplicationHelper) Services() map[string]interface{}
Services returns all cached services
type EventAdapterConfig ¶
type EventAdapterConfig struct {
Broker string `json:"broker" yaml:"broker"`
Topics []string `json:"topics" yaml:"topics"`
EventType string `json:"eventType" yaml:"eventType"`
SourceIdKey string `json:"sourceIdKey,omitempty" yaml:"sourceIdKey,omitempty"`
CorrelIdKey string `json:"correlIdKey,omitempty" yaml:"correlIdKey,omitempty"`
}
EventAdapterConfig represents an adapter between message broker and event processor
type EventHandlerConfig ¶
type EventHandlerConfig struct {
PatternID string `json:"patternId" yaml:"patternId"`
Handler string `json:"handler" yaml:"handler"`
Config map[string]interface{} `json:"config,omitempty" yaml:"config,omitempty"`
}
EventHandlerConfig represents event handler configuration
type EventPatternConfig ¶
type EventPatternConfig struct {
PatternID string `json:"patternId" yaml:"patternId"`
EventTypes []string `json:"eventTypes" yaml:"eventTypes"`
WindowTime string `json:"windowTime" yaml:"windowTime"`
Condition string `json:"condition" yaml:"condition"`
MinOccurs int `json:"minOccurs" yaml:"minOccurs"`
MaxOccurs int `json:"maxOccurs" yaml:"maxOccurs"`
OrderMatters bool `json:"orderMatters" yaml:"orderMatters"`
ExtraParams map[string]interface{} `json:"extraParams,omitempty" yaml:"extraParams,omitempty"`
}
EventPatternConfig represents event pattern configuration
type EventProcessorAdapter ¶
type EventProcessorAdapter struct {
Processor *module.EventProcessor
}
EventProcessorAdapter adapts an EventProcessor to ensure interface compatibility
func (*EventProcessorAdapter) HandleEvent ¶
func (a *EventProcessorAdapter) HandleEvent(ctx context.Context, event interface{}) error
HandleEvent implements the expected interface for EventProcessor
type EventWorkflowConfig ¶
type EventWorkflowConfig struct {
Processor string `json:"processor" yaml:"processor"`
Patterns []EventPatternConfig `json:"patterns" yaml:"patterns"`
Handlers []EventHandlerConfig `json:"handlers" yaml:"handlers"`
Adapters []EventAdapterConfig `json:"adapters,omitempty" yaml:"adapters,omitempty"`
}
EventWorkflowConfig represents event workflow configuration
type EventWorkflowHandler ¶
type EventWorkflowHandler struct{}
EventWorkflowHandler handles event-driven workflows with complex event processing
func NewEventWorkflowHandler ¶
func NewEventWorkflowHandler() *EventWorkflowHandler
NewEventWorkflowHandler creates a new event workflow handler
func (*EventWorkflowHandler) CanHandle ¶
func (h *EventWorkflowHandler) CanHandle(workflowType string) bool
CanHandle returns true if this handler can process the given workflow type
func (*EventWorkflowHandler) ConfigureWorkflow ¶
func (h *EventWorkflowHandler) ConfigureWorkflow(app modular.Application, workflowConfig interface{}) error
ConfigureWorkflow sets up the workflow from configuration
func (*EventWorkflowHandler) ExecuteWorkflow ¶
func (h *EventWorkflowHandler) ExecuteWorkflow(ctx context.Context, workflowType string, action string, data map[string]interface{}) (map[string]interface{}, error)
ExecuteWorkflow executes a workflow with the given action and input data
type HTTPRouteConfig ¶
type HTTPRouteConfig struct {
Method string `json:"method" yaml:"method"`
Path string `json:"path" yaml:"path"`
Handler string `json:"handler" yaml:"handler"`
Middlewares []string `json:"middlewares,omitempty" yaml:"middlewares,omitempty"`
Config map[string]interface{} `json:"config,omitempty" yaml:"config,omitempty"`
}
HTTPRouteConfig represents a route configuration in HTTP workflow
type HTTPWorkflowHandler ¶
type HTTPWorkflowHandler struct{}
HTTPWorkflowHandler handles HTTP-based workflows
func NewHTTPWorkflowHandler ¶
func NewHTTPWorkflowHandler() *HTTPWorkflowHandler
NewHTTPWorkflowHandler creates a new HTTP workflow handler
func (*HTTPWorkflowHandler) CanHandle ¶
func (h *HTTPWorkflowHandler) CanHandle(workflowType string) bool
CanHandle returns true if this handler can process the given workflow type
func (*HTTPWorkflowHandler) ConfigureWorkflow ¶
func (h *HTTPWorkflowHandler) ConfigureWorkflow(app modular.Application, workflowConfig interface{}) error
ConfigureWorkflow sets up the workflow from configuration
func (*HTTPWorkflowHandler) ExecuteWorkflow ¶
func (h *HTTPWorkflowHandler) ExecuteWorkflow(ctx context.Context, workflowType string, action string, data map[string]interface{}) (map[string]interface{}, error)
ExecuteWorkflow executes a workflow with the given action and input data
type IntegrationConnector ¶
type IntegrationConnector struct {
Name string `json:"name" yaml:"name"`
Type string `json:"type" yaml:"type"`
Config map[string]interface{} `json:"config" yaml:"config"`
}
IntegrationConnector represents a connector configuration
type IntegrationStep ¶
type IntegrationStep struct {
Name string `json:"name" yaml:"name"`
Connector string `json:"connector" yaml:"connector"`
Action string `json:"action" yaml:"action"`
Input map[string]interface{} `json:"input,omitempty" yaml:"input,omitempty"`
Transform string `json:"transform,omitempty" yaml:"transform,omitempty"`
OnSuccess string `json:"onSuccess,omitempty" yaml:"onSuccess,omitempty"`
OnError string `json:"onError,omitempty" yaml:"onError,omitempty"`
RetryCount int `json:"retryCount,omitempty" yaml:"retryCount,omitempty"`
RetryDelay string `json:"retryDelay,omitempty" yaml:"retryDelay,omitempty"`
}
IntegrationStep represents a step in an integration workflow
type IntegrationWorkflowConfig ¶
type IntegrationWorkflowConfig struct {
Registry string `json:"registry" yaml:"registry"`
Connectors []IntegrationConnector `json:"connectors" yaml:"connectors"`
Steps []IntegrationStep `json:"steps" yaml:"steps"`
}
IntegrationWorkflowConfig represents an integration workflow configuration
type IntegrationWorkflowHandler ¶
type IntegrationWorkflowHandler struct {
// contains filtered or unexported fields
}
IntegrationWorkflowHandler handles integration workflows
func NewIntegrationWorkflowHandler ¶
func NewIntegrationWorkflowHandler() *IntegrationWorkflowHandler
NewIntegrationWorkflowHandler creates a new integration workflow handler
func NewIntegrationWorkflowHandlerWithNamespace ¶
func NewIntegrationWorkflowHandlerWithNamespace(namespace module.ModuleNamespaceProvider) *IntegrationWorkflowHandler
NewIntegrationWorkflowHandlerWithNamespace creates a new integration workflow handler with namespace support
func (*IntegrationWorkflowHandler) CanHandle ¶
func (h *IntegrationWorkflowHandler) CanHandle(workflowType string) bool
CanHandle returns true if this handler can process the given workflow type
func (*IntegrationWorkflowHandler) ConfigureWorkflow ¶
func (h *IntegrationWorkflowHandler) ConfigureWorkflow(app modular.Application, workflowConfig interface{}) error
ConfigureWorkflow sets up the workflow from configuration
func (*IntegrationWorkflowHandler) ExecuteIntegrationWorkflow ¶
func (h *IntegrationWorkflowHandler) ExecuteIntegrationWorkflow( ctx context.Context, registry module.IntegrationRegistry, steps []IntegrationStep, initialContext map[string]interface{}, ) (map[string]interface{}, error)
ExecuteIntegrationWorkflow executes a sequence of integration steps
func (*IntegrationWorkflowHandler) ExecuteWorkflow ¶
func (h *IntegrationWorkflowHandler) ExecuteWorkflow(ctx context.Context, workflowType string, action string, data map[string]interface{}) (map[string]interface{}, error)
ExecuteWorkflow executes a workflow with the given action and input data
func (*IntegrationWorkflowHandler) Init ¶
func (h *IntegrationWorkflowHandler) Init(registry modular.ServiceRegistry) error
Init initializes the handler
func (*IntegrationWorkflowHandler) Name ¶
func (h *IntegrationWorkflowHandler) Name() string
Name returns the name of this handler
type MessagingWorkflowHandler ¶
type MessagingWorkflowHandler struct {
// contains filtered or unexported fields
}
MessagingWorkflowHandler handles message-based workflows
func NewMessagingWorkflowHandler ¶
func NewMessagingWorkflowHandler() *MessagingWorkflowHandler
NewMessagingWorkflowHandler creates a new messaging workflow handler
func NewMessagingWorkflowHandlerWithNamespace ¶
func NewMessagingWorkflowHandlerWithNamespace(namespace workflowmodule.ModuleNamespaceProvider) *MessagingWorkflowHandler
NewMessagingWorkflowHandlerWithNamespace creates a messaging workflow handler with namespace support
func (*MessagingWorkflowHandler) CanHandle ¶
func (h *MessagingWorkflowHandler) CanHandle(workflowType string) bool
CanHandle returns true if this handler can process the given workflow type
func (*MessagingWorkflowHandler) ConfigureWorkflow ¶
func (h *MessagingWorkflowHandler) ConfigureWorkflow(app modular.Application, workflowConfig interface{}) error
ConfigureWorkflow sets up the workflow from configuration
func (*MessagingWorkflowHandler) ExecuteWorkflow ¶
func (h *MessagingWorkflowHandler) ExecuteWorkflow(ctx context.Context, workflowType string, action string, data map[string]interface{}) (map[string]interface{}, error)
ExecuteWorkflow executes a workflow with the given action and input data
func (*MessagingWorkflowHandler) Name ¶
func (h *MessagingWorkflowHandler) Name() string
Name returns the name of this handler
type MockEngine ¶
type MockEngine struct {
// contains filtered or unexported fields
}
MockEngine is a simplified engine for testing
func NewTestEngine ¶
func NewTestEngine(app modular.Application) *MockEngine
NewTestEngine creates a workflow engine for testing
func (*MockEngine) AddModuleType ¶
func (e *MockEngine) AddModuleType(name string, creator interface{})
AddModuleType adds a module type to the mock engine
func (*MockEngine) BuildFromConfig ¶
func (e *MockEngine) BuildFromConfig(cfg interface{}) error
BuildFromConfig simulates building a workflow from config
func (*MockEngine) RegisterHandler ¶
func (e *MockEngine) RegisterHandler(name string, handler interface{})
RegisterHandler registers a handler with the mock engine
type ScheduledJobConfig ¶
type ScheduledJobConfig struct {
Scheduler string `json:"scheduler" yaml:"scheduler"`
Job string `json:"job" yaml:"job"`
Config map[string]interface{} `json:"config,omitempty" yaml:"config,omitempty"`
}
ScheduledJobConfig represents a job scheduler configuration
type SchedulerTestHelper ¶
type SchedulerTestHelper struct {
App modular.Application
}
SchedulerTestHelper contains utilities for testing schedulers
func NewSchedulerTestHelper ¶
func NewSchedulerTestHelper(app modular.Application) *SchedulerTestHelper
NewSchedulerTestHelper creates a new scheduler test helper
func (*SchedulerTestHelper) RegisterTestJob ¶
func (h *SchedulerTestHelper) RegisterTestJob(name string, fn func(ctx context.Context) error) *TestJob
RegisterTestJob registers a test job with the application
func (*SchedulerTestHelper) TriggerJobExecution ¶
func (h *SchedulerTestHelper) TriggerJobExecution(ctx context.Context, jobName string) error
TriggerJobExecution manually triggers execution of a job
type SchedulerWorkflowHandler ¶
type SchedulerWorkflowHandler struct{}
SchedulerWorkflowHandler handles scheduler-based workflows
func NewSchedulerWorkflowHandler ¶
func NewSchedulerWorkflowHandler() *SchedulerWorkflowHandler
NewSchedulerWorkflowHandler creates a new scheduler workflow handler
func (*SchedulerWorkflowHandler) CanHandle ¶
func (h *SchedulerWorkflowHandler) CanHandle(workflowType string) bool
CanHandle returns true if this handler can process the given workflow type
func (*SchedulerWorkflowHandler) ConfigureWorkflow ¶
func (h *SchedulerWorkflowHandler) ConfigureWorkflow(app modular.Application, workflowConfig interface{}) error
ConfigureWorkflow sets up the workflow from configuration
func (*SchedulerWorkflowHandler) ExecuteWorkflow ¶
func (h *SchedulerWorkflowHandler) ExecuteWorkflow(ctx context.Context, workflowType string, action string, data map[string]interface{}) (map[string]interface{}, error)
ExecuteWorkflow executes a workflow with the given action and input data
type ServiceAccessor ¶
type ServiceAccessor interface {
Service(name string) interface{}
Services() map[string]interface{}
}
ServiceAccessor provides methods for accessing services
type ServiceHelper ¶
type ServiceHelper struct {
App modular.Application
}
ServiceHelper helps with service access in handlers
func GetServiceHelper ¶
func GetServiceHelper(app modular.Application) *ServiceHelper
GetServiceHelper returns a helper for an application
func New ¶
func New(app modular.Application) *ServiceHelper
New creates a new service helper for an application
func (*ServiceHelper) GetService ¶
func (s *ServiceHelper) GetService(name string, dest interface{}) error
GetService implements the GetService method
func (*ServiceHelper) Init ¶
func (s *ServiceHelper) Init() error
Init initializes the service helper
func (*ServiceHelper) RegisterService ¶
func (s *ServiceHelper) RegisterService(name string, service interface{}) error
RegisterService implements the RegisterService method
func (*ServiceHelper) Service ¶
func (s *ServiceHelper) Service(name string) interface{}
Service retrieves a service by name
func (*ServiceHelper) Services ¶
func (s *ServiceHelper) Services() map[string]interface{}
Services returns all services in the application
func (*ServiceHelper) SvcRegistry ¶
func (s *ServiceHelper) SvcRegistry() map[string]interface{}
SvcRegistry implements the SvcRegistry method
type StateMachineDefinition ¶
type StateMachineDefinition struct {
Name string `json:"name" yaml:"name"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
InitialState string `json:"initialState" yaml:"initialState"`
States map[string]StateMachineState `json:"states" yaml:"states"`
Transitions map[string]StateMachineTransition `json:"transitions" yaml:"transitions"`
}
StateMachineDefinition represents a state machine definition
type StateMachineHookConfig ¶
type StateMachineHookConfig struct {
WorkflowType string `json:"workflowType" yaml:"workflowType"`
Transitions []string `json:"transitions,omitempty" yaml:"transitions,omitempty"`
FromStates []string `json:"fromStates,omitempty" yaml:"fromStates,omitempty"`
ToStates []string `json:"toStates,omitempty" yaml:"toStates,omitempty"`
Handler string `json:"handler" yaml:"handler"`
}
StateMachineHookConfig represents a hook configuration for state transitions
type StateMachineState ¶
type StateMachineState struct {
Name string `json:"name" yaml:"name"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
IsFinal bool `json:"isFinal" yaml:"isFinal"`
IsError bool `json:"isError" yaml:"isError"`
Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"`
}
StateMachineState represents a workflow state
type StateMachineTransition ¶
type StateMachineTransition struct {
FromState string `json:"fromState" yaml:"fromState"`
ToState string `json:"toState" yaml:"toState"`
Condition string `json:"condition,omitempty" yaml:"condition,omitempty"`
AutoTransform bool `json:"autoTransform" yaml:"autoTransform"`
Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"`
}
StateMachineTransition represents a transition between states
type StateMachineWorkflowConfig ¶
type StateMachineWorkflowConfig struct {
Engine string `json:"engine" yaml:"engine"`
Definitions []StateMachineDefinition `json:"definitions" yaml:"definitions"`
Hooks []StateMachineHookConfig `json:"hooks,omitempty" yaml:"hooks,omitempty"`
}
StateMachineWorkflowConfig represents a state machine workflow configuration
type StateMachineWorkflowHandler ¶
type StateMachineWorkflowHandler struct {
// contains filtered or unexported fields
}
StateMachineWorkflowHandler handles state machine workflows
func NewStateMachineWorkflowHandler ¶
func NewStateMachineWorkflowHandler() *StateMachineWorkflowHandler
NewStateMachineWorkflowHandler creates a new state machine workflow handler
func NewStateMachineWorkflowHandlerWithNamespace ¶
func NewStateMachineWorkflowHandlerWithNamespace(namespace module.ModuleNamespaceProvider) *StateMachineWorkflowHandler
NewStateMachineWorkflowHandlerWithNamespace creates a state machine workflow handler with namespace support
func (*StateMachineWorkflowHandler) CanHandle ¶
func (h *StateMachineWorkflowHandler) CanHandle(workflowType string) bool
CanHandle returns true if this handler can process the given workflow type
func (*StateMachineWorkflowHandler) ConfigureWorkflow ¶
func (h *StateMachineWorkflowHandler) ConfigureWorkflow(app modular.Application, workflowConfig interface{}) error
ConfigureWorkflow sets up the workflow from configuration
func (*StateMachineWorkflowHandler) ExecuteWorkflow ¶
func (h *StateMachineWorkflowHandler) ExecuteWorkflow(ctx context.Context, workflowType string, action string, data map[string]interface{}) (map[string]interface{}, error)
ExecuteWorkflow executes a workflow with the given action and input data
func (*StateMachineWorkflowHandler) Name ¶
func (h *StateMachineWorkflowHandler) Name() string
Name returns the name of this handler
type TestJob ¶
TestJob is a simple job implementation for testing
func NewTestJob ¶
NewTestJob creates a new test job
type TestServiceRegistry ¶
type TestServiceRegistry struct {
// contains filtered or unexported fields
}
TestServiceRegistry provides a simple service registry for testing
func NewTestServiceRegistry ¶
func NewTestServiceRegistry() *TestServiceRegistry
NewTestServiceRegistry creates a new test service registry
func (*TestServiceRegistry) ConfigProvider ¶
func (t *TestServiceRegistry) ConfigProvider() modular.ConfigProvider
ConfigProvider returns the config provider
func (*TestServiceRegistry) ConfigSections ¶
func (t *TestServiceRegistry) ConfigSections() map[string]modular.ConfigProvider
ConfigSections returns configuration sections
func (*TestServiceRegistry) GetConfigSection ¶
func (t *TestServiceRegistry) GetConfigSection(section string) (modular.ConfigProvider, error)
GetConfigSection returns a config section
func (*TestServiceRegistry) GetService ¶
func (t *TestServiceRegistry) GetService(name string, dest interface{}) error
GetService implements service retrieval for testing
func (*TestServiceRegistry) Init ¶
func (t *TestServiceRegistry) Init() error
Init initializes the test registry
func (*TestServiceRegistry) IsVerboseConfig ¶
func (t *TestServiceRegistry) IsVerboseConfig() bool
IsVerboseConfig returns whether verbose config debugging is enabled
func (*TestServiceRegistry) Logger ¶
func (t *TestServiceRegistry) Logger() modular.Logger
Logger returns a logger
func (*TestServiceRegistry) RegisterConfigSection ¶
func (t *TestServiceRegistry) RegisterConfigSection(name string, config modular.ConfigProvider)
RegisterConfigSection registers a config section
func (*TestServiceRegistry) RegisterModule ¶
func (t *TestServiceRegistry) RegisterModule(module modular.Module)
RegisterModule registers a module in the test registry
func (*TestServiceRegistry) RegisterService ¶
func (t *TestServiceRegistry) RegisterService(name string, service interface{}) error
RegisterService implements service registration for testing
func (*TestServiceRegistry) Run ¶
func (t *TestServiceRegistry) Run() error
Run simulates application run
func (*TestServiceRegistry) SetLogger ¶
func (t *TestServiceRegistry) SetLogger(logger modular.Logger)
SetLogger sets the application's logger
func (*TestServiceRegistry) SetMockConfig ¶
func (t *TestServiceRegistry) SetMockConfig(config modular.ConfigProvider)
SetMockConfig sets a custom config provider
func (*TestServiceRegistry) SetMockLogger ¶
func (t *TestServiceRegistry) SetMockLogger(logger modular.Logger)
SetMockLogger sets a custom logger
func (*TestServiceRegistry) SetVerboseConfig ¶
func (t *TestServiceRegistry) SetVerboseConfig(enabled bool)
SetVerboseConfig sets verbose config debugging (no-op for tests)
func (*TestServiceRegistry) Start ¶
func (t *TestServiceRegistry) Start() error
Start simulates application start
func (*TestServiceRegistry) Stop ¶
func (t *TestServiceRegistry) Stop() error
Stop simulates application stop
func (*TestServiceRegistry) SvcRegistry ¶
func (t *TestServiceRegistry) SvcRegistry() modular.ServiceRegistry
SvcRegistry returns the services map as modular.ServiceRegistry
type TopicHandlerConfig ¶
type TopicHandlerConfig struct {
Topic string `json:"topic" yaml:"topic"`
Handler string `json:"handler" yaml:"handler"`
Config map[string]interface{} `json:"config,omitempty" yaml:"config,omitempty"`
}
TopicHandlerConfig represents a topic handler configuration in messaging workflow