Class: Fractor::Workflow::WorkflowValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/fractor/workflow/workflow_validator.rb

Overview

Validates workflow structure and configuration. Checks for cycles, missing dependencies, type compatibility, and proper entry/exit points.

This validator integrates JobDependencyValidator and TypeCompatibilityValidator to provide comprehensive validation with detailed error messages.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(workflow_class) ⇒ WorkflowValidator

Returns a new instance of WorkflowValidator.



15
16
17
# File 'lib/fractor/workflow/workflow_validator.rb', line 15

def initialize(workflow_class)
  @workflow_class = workflow_class
end

Instance Attribute Details

#workflow_classObject (readonly)

Returns the value of attribute workflow_class.



13
14
15
# File 'lib/fractor/workflow/workflow_validator.rb', line 13

def workflow_class
  @workflow_class
end

Instance Method Details

#validate!Object

Validate the workflow structure. Raises appropriate errors if validation fails.



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fractor/workflow/workflow_validator.rb', line 21

def validate!
  validate_basic_structure!
  apply_smart_defaults!
  auto_wire_job_inputs!

  # Use new validators for better error messages
  validate_dependencies_with_new_validator!
  validate_type_compatibility!

  validate_entry_exit_points! unless continuous_mode?
  validate_job_workers!
  validate_input_mappings!
end