Class JsonStateSectionIIAR
java.lang.Object
com.scivicslab.pojoactor.core.ActorRef<JsonStateSection>
com.scivicslab.pojoactor.workflow.IIActorRef<JsonStateSection>
com.scivicslab.actoriac.report.sections.basic.JsonStateSectionIIAR
- All Implemented Interfaces:
com.scivicslab.pojoactor.core.CallableByActionName, AutoCloseable
public class JsonStateSectionIIAR
extends com.scivicslab.pojoactor.workflow.IIActorRef<JsonStateSection>
IIAR wrapper for
JsonStateSection.
Exposes the POJO's methods as actions via @Action annotations.
Retrieves JsonState from a target actor and formats it as YAML.
Usage in workflow YAML:
The actor name encodes the target actor using ":" separator:
- actor: loader
method: createChild
arguments: ["reportBuilder", "state:nodeGroup", "...JsonStateSectionIIAR"]
This creates a section that outputs nodeGroup's JsonState.
Optional JSON path can be specified after another ":":
- actor: loader
method: createChild
arguments: ["reportBuilder", "state:nodeGroup:cluster.nodes", "...JsonStateSectionIIAR"]
This outputs only the "cluster.nodes" path from nodeGroup's JsonState.
- Since:
- 2.16.0
- Author:
- devteam@scivicslab.com
-
Field Summary
FieldsFields inherited from class com.scivicslab.pojoactor.core.ActorRef
actorName, actorSystem, object -
Constructor Summary
ConstructorsConstructorDescriptionJsonStateSectionIIAR(String actorName, com.scivicslab.pojoactor.workflow.IIActorSystem system) Constructs the IIAR with a new POJO instance. -
Method Summary
Modifier and TypeMethodDescriptioncom.scivicslab.pojoactor.core.ActionResultcom.scivicslab.pojoactor.core.ActionResultprivate voidparseActorName(String actorName) Parses the actor name to extract target actor and optional path.private voidRefreshes the YAML content from the target actor's JsonState.com.scivicslab.pojoactor.core.ActionResultsetJsonPath(String args) Sets the JSON path filter dynamically.com.scivicslab.pojoactor.core.ActionResultsetTargetActor(String args) Sets the target actor name dynamically.Methods inherited from class com.scivicslab.pojoactor.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
-
Field Details
-
logger
-
targetActorName
-
jsonPath
-
-
Constructor Details
-
JsonStateSectionIIAR
public JsonStateSectionIIAR(String actorName, com.scivicslab.pojoactor.workflow.IIActorSystem system) Constructs the IIAR with a new POJO instance.The actor name is parsed to extract target actor and optional path:
- "state:nodeGroup" → target=nodeGroup, path=null
- "state:nodeGroup:cluster.nodes" → target=nodeGroup, path=cluster.nodes
- "myState" → target=myState, path=null (no ":" prefix)
- Parameters:
actorName- the actor name (may encode target actor)system- the actor system
-
-
Method Details
-
parseActorName
Parses the actor name to extract target actor and optional path. -
refreshContent
Refreshes the YAML content from the target actor's JsonState.Called automatically before generate() to ensure fresh data.
-
generate
-
getTitle
-
setTargetActor
Sets the target actor name dynamically.- Parameters:
args- the target actor name- Returns:
- action result
-
setJsonPath
Sets the JSON path filter dynamically.- Parameters:
args- the JSON path- Returns:
- action result
-