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

    Fields
    Modifier and Type
    Field
    Description
    private String
     
    private static final Logger
     
    private String
     

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

    actorName, actorSystem, object
  • Constructor Summary

    Constructors
    Constructor
    Description
    JsonStateSectionIIAR(String actorName, com.scivicslab.pojoactor.workflow.IIActorSystem system)
    Constructs the IIAR with a new POJO instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.scivicslab.pojoactor.core.ActionResult
     
    com.scivicslab.pojoactor.core.ActionResult
     
    private void
    Parses the actor name to extract target actor and optional path.
    private void
    Refreshes the YAML content from the target actor's JsonState.
    com.scivicslab.pojoactor.core.ActionResult
    Sets the JSON path filter dynamically.
    com.scivicslab.pojoactor.core.ActionResult
    Sets the target actor name dynamically.

    Methods inherited from class com.scivicslab.pojoactor.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 Object

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

  • 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

      private void parseActorName(String actorName)
      Parses the actor name to extract target actor and optional path.
    • refreshContent

      private void refreshContent()
      Refreshes the YAML content from the target actor's JsonState.

      Called automatically before generate() to ensure fresh data.

    • generate

      public com.scivicslab.pojoactor.core.ActionResult generate(String args)
    • getTitle

      public com.scivicslab.pojoactor.core.ActionResult getTitle(String args)
    • setTargetActor

      public com.scivicslab.pojoactor.core.ActionResult setTargetActor(String args)
      Sets the target actor name dynamically.
      Parameters:
      args - the target actor name
      Returns:
      action result
    • setJsonPath

      public com.scivicslab.pojoactor.core.ActionResult setJsonPath(String args)
      Sets the JSON path filter dynamically.
      Parameters:
      args - the JSON path
      Returns:
      action result