Class ReportBuilderActor

java.lang.Object
com.scivicslab.pojoactor.core.ActorRef<ReportBuilder>
com.scivicslab.turingworkflow.workflow.IIActorRef<ReportBuilder>
com.scivicslab.turingworkflow.plugins.report.ReportBuilderActor
All Implemented Interfaces:
com.scivicslab.pojoactor.core.CallableByActionName, AutoCloseable

public class ReportBuilderActor extends com.scivicslab.turingworkflow.workflow.IIActorRef<ReportBuilder>
Actor for building and outputting workflow reports.

This actor wraps a ReportBuilder POJO and provides workflow-callable actions via @Action annotations.

Actions:

  • addWorkflowInfo - Add workflow metadata section
  • addJsonStateSection - Add actor's JsonState as YAML
  • report - Build and output the report
Since:
2.15.0
Author:
devteam@scivicslab.com
  • Field Summary

    Fields inherited from class com.scivicslab.pojoactor.core.ActorRef

    actorName, actorSystem, object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new ReportBuilderActor.
    ReportBuilderActor(String name, ReportBuilder builder, com.scivicslab.turingworkflow.workflow.IIActorSystem system)
    Constructs a new ReportBuilderActor with actor system.
    ReportBuilderActor(String actorName, com.scivicslab.turingworkflow.workflow.IIActorSystem system)
    Constructs a new ReportBuilderActor with a new POJO instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.scivicslab.pojoactor.core.ActionResult
    Adds a JsonState section for the specified actor to the report.
    com.scivicslab.pojoactor.core.ActionResult
    Adds a workflow information section to the report.
    com.scivicslab.pojoactor.core.ActionResult
    report(String args)
    Builds the complete report and sends it to the output multiplexer.

    Methods inherited from class com.scivicslab.turingworkflow.workflow.IIActorRef

    callByActionName, hasAnnotatedAction, invokeAnnotatedAction, parseFirstArgument

    Methods inherited from class com.scivicslab.pojoactor.core.ActorRef

    ask, ask, askNow, clearJsonState, clearPendingMessages, close, createChild, expandVariables, getJsonBoolean, getJsonInt, getJsonString, getJsonString, getLastResult, getName, getNamesOfChildren, getParentName, hasJson, hasJsonState, initLogger, isAlive, json, putJson, setLastResult, setParentName, system, tell, tell, tellNow, toStringOfJson, toStringOfYaml

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ReportBuilderActor

      public ReportBuilderActor(String actorName, com.scivicslab.turingworkflow.workflow.IIActorSystem system)
      Constructs a new ReportBuilderActor with a new POJO instance.

      Required by loader.createChild for dynamic instantiation.

      Parameters:
      actorName - the actor name
      system - the actor system
    • ReportBuilderActor

      public ReportBuilderActor(String name, ReportBuilder builder)
      Constructs a new ReportBuilderActor.
      Parameters:
      name - the actor name
      builder - the ReportBuilder POJO to wrap
    • ReportBuilderActor

      public ReportBuilderActor(String name, ReportBuilder builder, com.scivicslab.turingworkflow.workflow.IIActorSystem system)
      Constructs a new ReportBuilderActor with actor system.
      Parameters:
      name - the actor name
      builder - the ReportBuilder POJO to wrap
      system - the actor system
  • Method Details

    • addWorkflowInfo

      public com.scivicslab.pojoactor.core.ActionResult addWorkflowInfo(String args)
      Adds a workflow information section to the report.

      Retrieves the workflow file path from the nodeGroup actor, then reads the workflow YAML file to extract the name and description fields. The resulting WorkflowInfoSection is appended to the report.

      Expected args: unused (may be empty or null).

      Parameters:
      args - unused
      Returns:
      an ActionResult indicating success or failure with a descriptive message
    • addJsonStateSection

      public com.scivicslab.pojoactor.core.ActionResult addJsonStateSection(String args)
      Adds a JsonState section for the specified actor to the report.

      Retrieves the target actor's JsonState and converts it to YAML format. The resulting JsonStateSection is appended to the report.

      Expected args format (JSON):

      {"actor": "<actorName>", "path": "<optional JSON path>"}
      Parameters:
      args - JSON string with "actor" (required) and "path" (optional) fields
      Returns:
      an ActionResult indicating success or failure with a descriptive message
    • report

      public com.scivicslab.pojoactor.core.ActionResult report(String args)
      Builds the complete report and sends it to the output multiplexer.

      Delegates to ReportBuilder.build() to assemble all sections (both legacy and child actor sections), then forwards the result to the outputMultiplexer actor with source "report-builder" and type "plugin-result".

      Expected args: unused (may be empty or null).

      Parameters:
      args - unused
      Returns:
      an ActionResult with success=true and the full report content as the result string