com.googlecode.sarasvati
Interface Graph

All Superinterfaces:
HasEventQueue
All Known Implementing Classes:
AbstractGraph, HibGraph, MemGraph

public interface Graph
extends HasEventQueue

A Graph corresponds to a process definition. It has a set of Nodes, which correspond to actions that need to be taken for the process to complete. It also has a set of Arcs which define the relationships between the Nodes.

Author:
Paul Lorenz

Method Summary
 List<Arc> getArcs()
          Returns a list of all arcs in the graph.
 String getCustomId()
          Users may associate custom ids with a graph.
 List<Arc> getInputArcs(Node node)
          Returns a list of arcs which have the given node as an end point.
 List<Arc> getInputArcs(Node node, String arcName)
          Returns a list of arcs which have the given node as an end point and which have the given name.
 String getName()
          Returns the graph name, which should be unique.
 List<Node> getNodes()
          Returns a list of all nodes in the graph.
 List<Arc> getOutputArcs(Node node)
          Returns a list of arcs which have the given node as a starting point.
 List<Arc> getOutputArcs(Node node, String arcName)
          Returns a list of arcs which have the given node as a starting point and which have the given name.
 List<Node> getStartNodes()
          Returns a list of the nodes at which nodes should be placed to start a workflow process.
 int getVersion()
          Returns the version number of the graph.
 
Methods inherited from interface com.googlecode.sarasvati.event.HasEventQueue
getEventQueue
 

Method Detail

getName

String getName()
Returns the graph name, which should be unique. Different versions with the same name may exist, but each of these should have a unique version number.

Returns:
The name of the graph

getVersion

int getVersion()
Returns the version number of the graph. Multiple versions of a graph may exists. Newer versions of the graph should have higher version numbers than older versions. A graph can be uniquely identified by name and version number.

Returns:
The version of the graph

getCustomId

String getCustomId()
Users may associate custom ids with a graph. This may be used to aid in determining if a graph has changed. For example, it may store a hash of the process definition file. Or it might be a version number set and incremented by an editor.

Returns:
The custom id (if any) associated with the graph

getArcs

List<Arc> getArcs()
Returns a list of all arcs in the graph.

Returns:
A list of arcs

getInputArcs

List<Arc> getInputArcs(Node node)
Returns a list of arcs which have the given node as an end point. The list may be empty, but will never be null.

Parameters:
node - A node belonging to this graph
Returns:
A list of arcs

getInputArcs

List<Arc> getInputArcs(Node node,
                       String arcName)
Returns a list of arcs which have the given node as an end point and which have the given name. The list may be empty but will never be null.

Parameters:
node - A node belonging to this graph
Returns:
A list of arcs

getOutputArcs

List<Arc> getOutputArcs(Node node)
Returns a list of arcs which have the given node as a starting point. The list may be empty but will never be null.

Parameters:
node - A node belonging to this graph
Returns:
A list of arcs

getOutputArcs

List<Arc> getOutputArcs(Node node,
                        String arcName)
Returns a list of arcs which have the given node as a starting point and which have the given name. The list may be empty but will never be null.

Parameters:
node - A node belonging to this graph
Returns:
A list of arcs

getStartNodes

List<Node> getStartNodes()
Returns a list of the nodes at which nodes should be placed to start a workflow process.

Returns:
A list of nodes

getNodes

List<Node> getNodes()
Returns a list of all nodes in the graph.

Returns:
A list of nodes