Class: Ad::AgentArchitecture::Report::WorkflowDetailReport

Inherits:
Object
  • Object
show all
Includes:
KLog::Logging
Defined in:
lib/ad/agent_architecture/report/workflow_detail_report.rb

Overview

Print workflow details

Instance Method Summary collapse

Instance Method Details



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ad/agent_architecture/report/workflow_detail_report.rb', line 10

def print(workflow)
  log.section_heading 'Workflow Details Report'
  log.kv 'Name', workflow.name
  # log.kv 'Description', workflow.description

  workflow.sections.each do |section|
    log.section_heading "Section: #{section.name}"
    # log.kv 'Order', section.order
    section.steps.each do |step|
      log.section_heading "Step: #{step.name}"
      # log.kv 'Order', step.order
      # log.kv 'Prompt', step.prompt
      # puts step.input_attributes.first
      # An ERROR here means you have not configured an attribute name
      log.kv 'Input Attributes', step.input_attributes.map { |ia| ia.attribute.name }.join(', ')
      log.kv 'Output Attributes', step.output_attributes.map { |oa| oa.attribute&.name }.join(', ')
    end
  end
end