Class AgentRuleFlow

java.lang.Object
com.xebialabs.xlrelease.agentrules.AgentRuleFlow

public final class AgentRuleFlow extends Object
The parsed "Then" half of an agent rule: author-defined outcome branches, each carrying an ordered action list. Persisted as one versioned JSON document in the rule's flow property, authored by the Agent Rules builder UI:

 {"v":1,"branches":[
   {"outcome":"transient","actions":[{"type":"retryTask","mode":"auto","params":{"comment":"{{summary}}"}}]},
   {"outcome":"otherwise","actions":[{"type":"comment","mode":"auto","params":{}}]}
 ]}
 

The author owns the outcome vocabulary: the dispatcher lists the branch names in the instruction so the agent classifies into them, and anything unrecognized lands on the OTHERWISE branch. A rule without a flow keeps the pre-flow behavior (the analysis lands as a comment), so existing rules are untouched.

  • Field Details

    • OTHERWISE

      public static final String OTHERWISE
      Reserved branch name: the default when the agent's outcome matches no named branch.
      See Also:
  • Method Details

    • parse

      public static AgentRuleFlow parse(String json, String ruleTitle)
      Parses the flow property. Returns null — meaning "no flow, default behavior" — for blank input, unparseable JSON, or a document without branches; a broken flow must degrade to the safe advise-only path, never to silence or to wrong actions.
    • namedOutcomes

      public List<String> namedOutcomes()
      The named outcomes the agent may answer with — the instruction contract; excludes OTHERWISE.
    • branchFor

      public AgentRuleFlow.Branch branchFor(String outcome)
      The branch for the agent's outcome, or the otherwise-branch, or null for neither.