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:
- Legacy sections - Added via
addWorkflowInfoandaddJsonStateSection - Child actor sections -
SectionBuilderactors 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSection(ReportSection section) Adds a section to the report.build()Builds the report string.com.scivicslab.pojoactor.core.ActionResultcallByActionName(String actionName, String args) voidsetActorSystem(com.scivicslab.turingworkflow.workflow.IIActorSystem system) voidsetIIActorRef(com.scivicslab.turingworkflow.workflow.IIActorRef<?> actorRef)
-
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:
setActorSystemin interfacecom.scivicslab.turingworkflow.workflow.ActorSystemAware
-
setIIActorRef
public void setIIActorRef(com.scivicslab.turingworkflow.workflow.IIActorRef<?> actorRef) Stores a reference to this actor's own
IIActorRefso that child actor sections can be discovered at report build time.- Specified by:
setIIActorRefin interfacecom.scivicslab.turingworkflow.workflow.IIActorRefAware
-
callByActionName
Dispatches to one of the following actions:
addWorkflowInfo- adds workflow metadata sectionaddJsonStateSection- adds an actor's JsonState as YAMLreport- builds and outputs the complete report
- Specified by:
callByActionNamein interfacecom.scivicslab.pojoactor.core.CallableByActionName- Parameters:
actionName- the action to invokeargs- JSON-formatted arguments (action-specific)- Returns:
- the action result indicating success or failure
-
addSection
Adds a section to the report.- Parameters:
section- the section to add
-
build
Builds the report string.Collects sections from two sources in order:
- Legacy sections added via
addWorkflowInfoandaddJsonStateSection - Child actor sections implementing
SectionBuilder(in creation order)
- Returns:
- the formatted report string
- Legacy sections added via
-