Class IaCStreamingAccumulator

java.lang.Object
com.scivicslab.pojoactor.core.accumulator.StreamingAccumulator
com.scivicslab.actoriac.IaCStreamingAccumulator
All Implemented Interfaces:
com.scivicslab.pojoactor.core.accumulator.Accumulator

public class IaCStreamingAccumulator extends com.scivicslab.pojoactor.core.accumulator.StreamingAccumulator
StreamingAccumulator with cowsay display support for actor-IaC.

This accumulator extends StreamingAccumulator to add cowsay ASCII art visualization for workflow step transitions. The cowfile (character) can be customized to show different ASCII art animals.

Example Usage

IaCStreamingAccumulator acc = new IaCStreamingAccumulator();
acc.setCowfile("tux");  // Use Linux penguin
acc.cowsay("my-workflow", "- states: [\"0\", \"1\"]\n  actions: ...");

Available Cowfiles

44 cowfiles are available including: tux, dragon, stegosaurus, kitty, bunny, turtle, elephant, ghostbusters, vader, and many more.

Since:
2.12.0
Author:
devteam@scivicslab.com
  • Field Details

    • cowfile

      private String cowfile
      Cowfile name for cowsay output. When null, uses the default cow.
  • Constructor Details

    • IaCStreamingAccumulator

      Constructs an IaCStreamingAccumulator with default settings.
  • Method Details

    • setCowfile

      public void setCowfile(String cowfile)
      Sets the cowfile name for cowsay output.

      Available cowfiles include: tux, dragon, stegosaurus, kitty, bunny, turtle, elephant, ghostbusters, vader, and many more (44 total).

      Parameters:
      cowfile - the cowfile name (e.g., "tux", "dragon"), or null for default cow
    • getCowfile

      public String getCowfile()
      Gets the cowfile name for cowsay output.
      Returns:
      the cowfile name, or null if using default cow
    • renderCowsay

      public String renderCowsay(String workflowName, String stepYaml)
      Renders a workflow step as cowsay ASCII art and returns the result.

      This method formats the workflow name and step YAML into a cowsay message with the configured cowfile character. The rendered ASCII art is returned as a string instead of being printed directly, allowing the caller to send it to the output multiplexer.

      Parameters:
      workflowName - the name of the workflow
      stepYaml - the YAML representation of the step (first 10 lines recommended)
      Returns:
      the rendered cowsay ASCII art string
    • listCowfiles

      public static String[] listCowfiles()
      Lists all available cowfile names.
      Returns:
      array of available cowfile names