Class ReportBuilderActor
- All Implemented Interfaces:
com.scivicslab.pojoactor.core.CallableByActionName,AutoCloseable
This actor wraps a ReportBuilder POJO and provides workflow-callable
actions via @Action annotations.
Actions:
addWorkflowInfo- Add workflow metadata sectionaddJsonStateSection- Add actor's JsonState as YAMLreport- 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
ConstructorsConstructorDescriptionReportBuilderActor(String name, ReportBuilder builder) 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 TypeMethodDescriptioncom.scivicslab.pojoactor.core.ActionResultaddJsonStateSection(String args) Adds a JsonState section for the specified actor to the report.com.scivicslab.pojoactor.core.ActionResultaddWorkflowInfo(String args) Adds a workflow information section to the report.com.scivicslab.pojoactor.core.ActionResultBuilds the complete report and sends it to the output multiplexer.Methods inherited from class com.scivicslab.turingworkflow.workflow.IIActorRef
callByActionName, hasAnnotatedAction, invokeAnnotatedAction, parseFirstArgumentMethods 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
-
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.createChildfor dynamic instantiation.- Parameters:
actorName- the actor namesystem- the actor system
-
ReportBuilderActor
Constructs a new ReportBuilderActor.- Parameters:
name- the actor namebuilder- 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 namebuilder- the ReportBuilder POJO to wrapsystem- the actor system
-
-
Method Details
-
addWorkflowInfo
Adds a workflow information section to the report.Retrieves the workflow file path from the
nodeGroupactor, then reads the workflow YAML file to extract thenameanddescriptionfields. The resultingWorkflowInfoSectionis appended to the report.Expected args: unused (may be empty or null).
- Parameters:
args- unused- Returns:
- an
ActionResultindicating success or failure with a descriptive message
-
addJsonStateSection
Adds a JsonState section for the specified actor to the report.Retrieves the target actor's
JsonStateand converts it to YAML format. The resultingJsonStateSectionis 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
ActionResultindicating success or failure with a descriptive message
-
report
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 theoutputMultiplexeractor with source"report-builder"and type"plugin-result".Expected args: unused (may be empty or null).
- Parameters:
args- unused- Returns:
- an
ActionResultwithsuccess=trueand the full report content as the result string
-