Class Vertex
java.lang.Object
com.scivicslab.pojoactor.workflow.Vertex
Represents a single vertex in the workflow graph.
Each vertex defines a state transition with associated actions. The states list typically contains two elements: the current state and the next state. The actions can be represented in two ways:
- Legacy format: List of string lists [actorName, actionName, argument]
- New format: List of Action objects with execution mode support
This class is designed to be populated from YAML, JSON, or XML workflow definitions using deserialization frameworks like SnakeYAML or Jackson.
- Author:
- devteam@scivics-lab.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of Action objects for this vertex.Returns the list of states for this vertex.Returns the vertex name.voidsetActions(List<Action> actions) Sets the list of actions for this vertex.voidSets the list of states for this vertex.voidsetVertexName(String vertexName) Sets the vertex name.toYamlString(int maxLines) Returns a YAML-formatted string representation of this vertex.
-
Constructor Details
-
Vertex
public Vertex()
-
-
Method Details
-
getActions
Returns the list of Action objects for this vertex.- Returns:
- a list of Action objects
-
getStates
Returns the list of states for this vertex.Typically contains two elements: [currentState, nextState]
- Returns:
- a list of state identifiers
-
setActions
Sets the list of actions for this vertex.- Parameters:
actions- a list of Action objects
-
setStates
Sets the list of states for this vertex.- Parameters:
list- a list of state identifiers
-
getVertexName
Returns the vertex name.The vertex name is used as a stable identifier for overlay matching. When applying patches, vertices are matched by this name rather than by states or array index.
- Returns:
- the vertex name, or null if not set
- Since:
- 2.9.0
-
setVertexName
Sets the vertex name.- Parameters:
vertexName- the vertex name identifier- Since:
- 2.9.0
-
toYamlString
Returns a YAML-formatted string representation of this vertex.This method reconstructs a YAML-like format from the parsed data, useful for debugging and visualization. The output shows the first N lines of the vertex definition.
Example output:
- states: ["0", "1"] actions: - actor: node method: executeCommand arguments: ["ls -la"]- Parameters:
maxLines- maximum number of lines to include (0 for unlimited)- Returns:
- YAML-formatted string representation
- Since:
- 2.9.0
-