Class: Lyra::Verification::WorkflowGenerator
- Inherits:
-
Object
- Object
- Lyra::Verification::WorkflowGenerator
- Defined in:
- lib/lyra/verification/workflow_generator.rb
Overview
Generates Petri net workflows by introspecting Lyra's actual implementation. Uses metaprogramming to analyze callbacks, modes, and model configurations.
Constant Summary collapse
- AVAILABLE_MODES =
[:monitor, :hijack, :es_sync, :es_async].freeze
Instance Attribute Summary collapse
-
#analysis ⇒ Object
readonly
Returns the value of attribute analysis.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#generate!(mode: nil) ⇒ Object
Analyze Lyra implementation and generate workflow.
-
#initialize(options = {}) ⇒ WorkflowGenerator
constructor
A new instance of WorkflowGenerator.
Constructor Details
#initialize(options = {}) ⇒ WorkflowGenerator
Returns a new instance of WorkflowGenerator.
12 13 14 15 16 17 18 19 20 |
# File 'lib/lyra/verification/workflow_generator.rb', line 12 def initialize( = {}) @options = @analysis = { modes: [], callbacks: {}, models: [], event_types: [] } end |
Instance Attribute Details
#analysis ⇒ Object (readonly)
Returns the value of attribute analysis.
8 9 10 |
# File 'lib/lyra/verification/workflow_generator.rb', line 8 def analysis @analysis end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/lyra/verification/workflow_generator.rb', line 8 def @options end |
Instance Method Details
#generate!(mode: nil) ⇒ Object
Analyze Lyra implementation and generate workflow
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/lyra/verification/workflow_generator.rb', line 24 def generate!(mode: nil) analyze_modes analyze_callbacks analyze_monitored_models analyze_event_types result = { lifecycle_workflow: generate_lifecycle_workflow, analysis: @analysis } if mode # Generate workflow for specific mode validate_mode!(mode) result[:mode_workflow] = generate_workflow_for_mode(mode) else # Generate workflows for all modes result[:mode_workflows] = generate_all_mode_workflows end result end |