java.lang.Object
com.scivicslab.turingworkflow.plugins.report.sections.basic.JsonStateSection
All Implemented Interfaces:
SectionBuilder

public class JsonStateSection extends Object implements SectionBuilder
POJO section builder that outputs an actor's JsonState in YAML format.

Pure business logic - no CallableByActionName. Use JsonStateSectionActor to expose as an actor.

Since:
2.16.0
Author:
devteam@scivicslab.com
  • Constructor Details

    • JsonStateSection

      public JsonStateSection()
  • Method Details

    • setActorName

      public void setActorName(String actorName)
      Sets the actor name (for display in title).
      Parameters:
      actorName - the actor name
    • setYamlContent

      public void setYamlContent(String yamlContent)
      Sets the YAML content to output.
      Parameters:
      yamlContent - the YAML-formatted JsonState content
    • setJsonPath

      public void setJsonPath(String jsonPath)
      Sets the JSON path filter (optional).
      Parameters:
      jsonPath - the JSON path filter, or null for entire state
    • generate

      public String generate()
      Generates the section content.

      Generates a [JsonState: <actorName>] block containing the YAML content. If a JSON path filter is set, it is appended to the title as (path: <jsonPath>). Returns an empty string if no YAML content has been set.

      Specified by:
      generate in interface SectionBuilder
      Returns:
      the formatted JsonState section content, or empty string if no content
    • getTitle

      public String getTitle()
      Returns the section title.

      If null or empty, the section content is output without a title line.

      Always returns null because the title is embedded within the generated content.

      Specified by:
      getTitle in interface SectionBuilder
      Returns:
      the section title, or null for no title