Class ActionHistoryExporter

java.lang.Object
io.github.jspinak.brobot.tools.actionhistory.ActionHistoryExporter

@Component public class ActionHistoryExporter extends Object
Exports ActionHistory data to various formats for analysis and reporting.

This class provides export functionality for ActionHistory data, supporting multiple formats including CSV, HTML, and summary reports. It's useful for analyzing automation performance, debugging issues, and generating documentation.

Features:

  • Export to CSV for spreadsheet analysis
  • Generate HTML reports with visualizations
  • Create summary statistics
  • Export filtered data based on criteria
  • Batch export multiple histories
Since:
1.1.0
  • Constructor Details

    • ActionHistoryExporter

      public ActionHistoryExporter()
  • Method Details

    • exportToCSV

      public void exportToCSV(ActionHistory history, String filename) throws IOException
      Export ActionHistory to CSV format.
      Parameters:
      history - the ActionHistory to export
      filename - the output filename
      Throws:
      IOException - if unable to write file
    • exportToCSV

      public void exportToCSV(ActionHistory history, String filename, String directory) throws IOException
      Export ActionHistory to CSV format with custom path.
      Parameters:
      history - the ActionHistory to export
      filename - the output filename
      directory - the output directory
      Throws:
      IOException - if unable to write file
    • exportToHTML

      public void exportToHTML(ActionHistory history, String filename) throws IOException
      Export ActionHistory to HTML report.
      Parameters:
      history - the ActionHistory to export
      filename - the output filename
      Throws:
      IOException - if unable to write file
    • exportToHTML

      public void exportToHTML(ActionHistory history, String filename, String directory) throws IOException
      Export ActionHistory to HTML report with custom path.
      Parameters:
      history - the ActionHistory to export
      filename - the output filename
      directory - the output directory
      Throws:
      IOException - if unable to write file
    • generateSummary

      public Map<String,Object> generateSummary(ActionHistory history)
      Generate a summary report of ActionHistory.
      Parameters:
      history - the ActionHistory to analyze
      Returns:
      summary statistics as a map
    • filterHistory

      public ActionHistory filterHistory(ActionHistory history, boolean successOnly, long minDuration, long maxDuration)
      Export filtered ActionHistory based on criteria.
      Parameters:
      history - the ActionHistory to filter
      successOnly - include only successful actions
      minDuration - minimum duration in milliseconds
      maxDuration - maximum duration in milliseconds
      Returns:
      filtered ActionHistory
    • batchExport

      public void batchExport(Map<String,ActionHistory> histories, String filename, ActionHistoryExporter.ExportFormat format) throws IOException
      Batch export multiple histories to a single report.
      Parameters:
      histories - map of name to ActionHistory
      filename - output filename
      format - export format (csv or html)
      Throws:
      IOException - if unable to write file