Class GraphRouteImpl
- java.lang.Object
-
- org.nuxeo.ecm.platform.routing.core.impl.DocumentRouteElementImpl
-
- org.nuxeo.ecm.platform.routing.core.impl.DocumentRouteStepsContainerImpl
-
- org.nuxeo.ecm.platform.routing.core.impl.DocumentRouteImpl
-
- org.nuxeo.ecm.platform.routing.core.impl.GraphRouteImpl
-
- All Implemented Interfaces:
Serializable
,DocumentRoute
,DocumentRouteElement
,DocumentRouteStep
,DocumentRouteStepsContainer
,GraphRoute
public class GraphRouteImpl extends DocumentRouteImpl implements GraphRoute
- Since:
- 5.6
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.nuxeo.ecm.platform.routing.core.impl.DocumentRouteElementImpl
DocumentRouteElementImpl.GetIsParentRunningUnrestricted, DocumentRouteElementImpl.SetDocumentOnReadOnlyUnrestrictedSessionRunner
-
Nested classes/interfaces inherited from interface org.nuxeo.ecm.platform.routing.api.DocumentRouteElement
DocumentRouteElement.ElementLifeCycleState, DocumentRouteElement.ElementLifeCycleTransistion
-
-
Field Summary
Fields Modifier and Type Field Description protected List<GraphNode>
nodes
To be used through getter.protected Map<String,GraphNode>
nodesById
To be used through getter.-
Fields inherited from class org.nuxeo.ecm.platform.routing.core.impl.DocumentRouteElementImpl
document, runner
-
Fields inherited from interface org.nuxeo.ecm.platform.routing.core.impl.GraphRoute
PROP_AVAILABILITY_FILTER, PROP_PARENT_NODE, PROP_PARENT_ROUTE, PROP_VARIABLES_FACET
-
-
Constructor Summary
Constructors Constructor Description GraphRouteImpl(DocumentModel doc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
compute()
protected void
computeLoopTransitions(String startNodeId)
Finds which transitions are re-looping (feedback arc set).protected String
computeNodes()
protected void
computeTransitions()
Deduce input transitions from output transitions.DocumentModelList
getAttachedDocumentModels()
Gets the attached documents.String
getAvailabilityFilter()
Returns the availability filter name for this graph.Map<String,Serializable>
getJsonVariables()
Gets the Json formatted graph variables.GraphNode
getNode(String id)
Gets the node with the given id.Collection<GraphNode>
getNodes()
Gets a collection of the route nodesGraphNode
getStartNode()
Gets the start node for this graph.List<GraphNode>
getSuspendedNodes()
Get the list of nodes of which the State is suspended.Map<String,Serializable>
getVariables()
Gets the graph variables.boolean
hasParentRoute()
Checks if this graph instance has been started from another graph.void
resumeParentRoute(CoreSession session)
Resumes execution of the parent route from which this graph was started.void
setJSONVariables(Map<String,String> map)
Sets the variables of the workflow based on their JSON representation (especially for scalar lists).void
setVariables(Map<String,Serializable> map)
Sets the graph variables.String
toString()
-
Methods inherited from class org.nuxeo.ecm.platform.routing.core.impl.DocumentRouteImpl
canUndoStep, fireWorkflowCompletionEvent, getInitiator, getModelId, getModelName, setDone
-
Methods inherited from class org.nuxeo.ecm.platform.routing.core.impl.DocumentRouteStepsContainerImpl
getAttachedDocuments, setAttachedDocuments, validate
-
Methods inherited from class org.nuxeo.ecm.platform.routing.core.impl.DocumentRouteElementImpl
backToReady, cancel, canDeleteStep, canUpdateStep, canValidateStep, checkLifeCycleState, followTransition, getAttachedDocuments, getDescription, getDocument, getDocumentRoute, getName, getProperty, getTitle, hasPermissionOnDocument, isCanceled, isDone, isDraft, isModifiable, isReady, isRunning, isValidated, resume, run, run, save, setCanceled, setCanDeleteStep, setCanReadStep, setCanUpdateStep, setCanValidateStep, setPermissionOnDocument, setReadOnly, setReady, setRunning, setValidated, undo
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.platform.routing.api.DocumentRoute
getAttachedDocuments, getInitiator, getModelId, getModelName, setAttachedDocuments
-
Methods inherited from interface org.nuxeo.ecm.platform.routing.api.DocumentRouteElement
backToReady, cancel, canDeleteStep, canUndoStep, canUpdateStep, canValidateStep, followTransition, getAttachedDocuments, getDescription, getDocument, getDocumentRoute, getName, getTitle, isCanceled, isDone, isDraft, isModifiable, isReady, isRunning, isValidated, resume, run, run, save, setCanceled, setCanDeleteStep, setCanReadStep, setCanUpdateStep, setCanValidateStep, setDone, setReadOnly, setReady, setRunning, setValidated, validate
-
-
-
-
Constructor Detail
-
GraphRouteImpl
public GraphRouteImpl(DocumentModel doc)
-
-
Method Detail
-
getNodes
public Collection<GraphNode> getNodes()
Description copied from interface:GraphRoute
Gets a collection of the route nodes- Specified by:
getNodes
in interfaceGraphRoute
-
compute
protected void compute()
-
computeNodes
protected String computeNodes()
-
computeTransitions
protected void computeTransitions() throws DocumentRouteException
Deduce input transitions from output transitions.- Throws:
DocumentRouteException
-
computeLoopTransitions
protected void computeLoopTransitions(String startNodeId) throws DocumentRouteException
Finds which transitions are re-looping (feedback arc set).- Throws:
DocumentRouteException
-
getStartNode
public GraphNode getStartNode() throws DocumentRouteException
Description copied from interface:GraphRoute
Gets the start node for this graph.- Specified by:
getStartNode
in interfaceGraphRoute
- Returns:
- the start node
- Throws:
DocumentRouteException
-
getNode
public GraphNode getNode(String id)
Description copied from interface:GraphRoute
Gets the node with the given id.- Specified by:
getNode
in interfaceGraphRoute
- Returns:
- the node
-
getVariables
public Map<String,Serializable> getVariables()
Description copied from interface:GraphRoute
Gets the graph variables.- Specified by:
getVariables
in interfaceGraphRoute
- Returns:
- the map of variables
-
getJsonVariables
public Map<String,Serializable> getJsonVariables()
Description copied from interface:GraphRoute
Gets the Json formatted graph variables.- Specified by:
getJsonVariables
in interfaceGraphRoute
- Returns:
- the map of variables
-
setVariables
public void setVariables(Map<String,Serializable> map)
Description copied from interface:GraphRoute
Sets the graph variables.- Specified by:
setVariables
in interfaceGraphRoute
- Parameters:
map
- the map of variables
-
setJSONVariables
public void setJSONVariables(Map<String,String> map)
Description copied from interface:GraphRoute
Sets the variables of the workflow based on their JSON representation (especially for scalar lists). For example:Map<String, String> map = new HashMap<String, String>(); map.put("contributors","[\"John Doe\", \"John Smith\"]"); map.put("title","Test Title");
- Specified by:
setJSONVariables
in interfaceGraphRoute
- Parameters:
map
- the map of variables
-
getAttachedDocumentModels
public DocumentModelList getAttachedDocumentModels()
Description copied from interface:GraphRoute
Gets the attached documents.- Specified by:
getAttachedDocumentModels
in interfaceGraphRoute
- Returns:
- a list of document
-
getAvailabilityFilter
public String getAvailabilityFilter()
Description copied from interface:GraphRoute
Returns the availability filter name for this graph.- Specified by:
getAvailabilityFilter
in interfaceGraphRoute
-
hasParentRoute
public boolean hasParentRoute()
Description copied from interface:GraphRoute
Checks if this graph instance has been started from another graph.- Specified by:
hasParentRoute
in interfaceGraphRoute
- Returns:
true
if this is a sub-route instance
-
resumeParentRoute
public void resumeParentRoute(CoreSession session)
Description copied from interface:GraphRoute
Resumes execution of the parent route from which this graph was started.- Specified by:
resumeParentRoute
in interfaceGraphRoute
- Parameters:
session
- the session
-
getSuspendedNodes
public List<GraphNode> getSuspendedNodes()
Description copied from interface:GraphRoute
Get the list of nodes of which the State is suspended.- Specified by:
getSuspendedNodes
in interfaceGraphRoute
-
-