Class ReportBuilder

java.lang.Object
com.scivicslab.turingworkflow.plugins.report.ReportBuilder
All Implemented Interfaces:
com.scivicslab.pojoactor.core.CallableByActionName, com.scivicslab.turingworkflow.workflow.ActorSystemAware, com.scivicslab.turingworkflow.workflow.IIActorRefAware

public class ReportBuilder extends Object implements com.scivicslab.pojoactor.core.CallableByActionName, com.scivicslab.turingworkflow.workflow.ActorSystemAware, com.scivicslab.turingworkflow.workflow.IIActorRefAware
Section-based workflow report builder.

Assembles report sections from two sources:

  1. Legacy sections - Added via addWorkflowInfo and addJsonStateSection
  2. Child actor sections - SectionBuilder actors created as children

Actions:

  • addWorkflowInfo - Add workflow metadata section (legacy)
  • addJsonStateSection - Add actor's JsonState as YAML (legacy)
  • report - Build and output the report to outputMultiplexer
Since:
2.15.0
Author:
devteam@scivicslab.com
  • Constructor Details

    • ReportBuilder

      public ReportBuilder()
      Default constructor for use with loader.createChild.
  • Method Details

    • setActorSystem

      public void setActorSystem(com.scivicslab.turingworkflow.workflow.IIActorSystem system)

      Stores the actor system reference for accessing other actors (e.g., nodeGroup, outputMultiplexer) at report build time.

      Specified by:
      setActorSystem in interface com.scivicslab.turingworkflow.workflow.ActorSystemAware
    • setIIActorRef

      public void setIIActorRef(com.scivicslab.turingworkflow.workflow.IIActorRef<?> actorRef)

      Stores a reference to this actor's own IIActorRef so that child actor sections can be discovered at report build time.

      Specified by:
      setIIActorRef in interface com.scivicslab.turingworkflow.workflow.IIActorRefAware
    • callByActionName

      public com.scivicslab.pojoactor.core.ActionResult callByActionName(String actionName, String args)

      Dispatches to one of the following actions:

      • addWorkflowInfo - adds workflow metadata section
      • addJsonStateSection - adds an actor's JsonState as YAML
      • report - builds and outputs the complete report
      Specified by:
      callByActionName in interface com.scivicslab.pojoactor.core.CallableByActionName
      Parameters:
      actionName - the action to invoke
      args - JSON-formatted arguments (action-specific)
      Returns:
      the action result indicating success or failure
    • addSection

      public void addSection(ReportSection section)
      Adds a section to the report.
      Parameters:
      section - the section to add
    • build

      public String build()
      Builds the report string.

      Collects sections from two sources in order:

      1. Legacy sections added via addWorkflowInfo and addJsonStateSection
      2. Child actor sections implementing SectionBuilder (in creation order)
      Returns:
      the formatted report string