Class DocumentRouteElementImpl
java.lang.Object
org.nuxeo.ecm.platform.routing.core.impl.DocumentRouteElementImpl
- All Implemented Interfaces:
Serializable
,DocumentRouteElement
,DocumentRouteStep
- Direct Known Subclasses:
DocumentRouteStepsContainerImpl
,GraphNodeImpl
public class DocumentRouteElementImpl
extends Object
implements DocumentRouteElement, DocumentRouteStep
- Author:
- arussel
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
protected class
Nested classes/interfaces inherited from interface org.nuxeo.ecm.platform.routing.api.DocumentRouteElement
DocumentRouteElement.ElementLifeCycleState, DocumentRouteElement.ElementLifeCycleTransistion
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
backToReady
(CoreSession session) Set the step back to the ready state from running or done.void
cancel
(CoreSession session) Cancel this element.boolean
canDeleteStep
(CoreSession session) If this session can delete this step.boolean
canUndoStep
(CoreSession session) If this step can be undone.boolean
canUpdateStep
(CoreSession session) If this session can update this step.boolean
canValidateStep
(CoreSession session) If this session can validate the step.protected boolean
void
followTransition
(DocumentRouteElement.ElementLifeCycleTransistion transition, CoreSession session, boolean recursive) make this element follow a transition.getAttachedDocuments
(CoreSession session) Return the list of documents that this route processes.the description of this element.Get the underlying document representing this element.getDocumentRoute
(CoreSession session) Return the DocumentRoute this element is part of.getName()
The name of this element.protected Object
getProperty
(String propertyName) getTitle()
protected boolean
hasPermissionOnDocument
(CoreSession session, String permission) boolean
boolean
isDone()
if this route is done.boolean
isDraft()
if this route is draft.boolean
boolean
isReady()
if this element is ready.boolean
if this route is running.boolean
if the route this element is part of has been validated.void
Resumes execution on a route node.void
run
(CoreSession session) Execute this element.void
run
(CoreSession session, Map<String, Serializable> map) Execute this element.void
save
(CoreSession session) save the document representing this DocumentRoute.void
setCanceled
(CoreSession session) Set the step to a cancel step.void
setCanDeleteStep
(CoreSession session, String userOrGroup) make this user or group step deleter.void
setCanReadStep
(CoreSession session, String userOrGroup) make this user or group a step reader.void
setCanUpdateStep
(CoreSession session, String userOrGroup) make this user or group a step updater.void
setCanValidateStep
(CoreSession session, String userOrGroup) make this user or group a validator for this step.void
setDone
(CoreSession session) set this element as done.protected void
setPermissionOnDocument
(CoreSession session, String userOrGroup, String permission) void
setReadOnly
(CoreSession session) remove write rights to everyone but the administrators.void
setReady
(CoreSession session) set this element as ready.void
setRunning
(CoreSession session) set this element as running.void
setValidated
(CoreSession session) set this element as validated.void
validate
(CoreSession session) Set this element to the validate state and put it in read only mode.
-
Field Details
-
document
-
runner
-
-
Constructor Details
-
DocumentRouteElementImpl
-
-
Method Details
-
getAttachedDocuments
Description copied from interface:DocumentRouteElement
Return the list of documents that this route processes.- Specified by:
getAttachedDocuments
in interfaceDocumentRouteElement
- Parameters:
session
- the session used to fetch the documents
-
run
Description copied from interface:DocumentRouteElement
Execute this element. If this is a step, it will run the operation, if this is a containter it will run its children.- Specified by:
run
in interfaceDocumentRouteElement
-
run
Description copied from interface:DocumentRouteElement
Execute this element. If this is a step, it will run the operation, if this is a container it will run its children.- Specified by:
run
in interfaceDocumentRouteElement
map
- the values to pass as initial workflow variables
-
resume
public void resume(CoreSession session, String nodeId, String taskId, Map<String, Object> data, String status) Description copied from interface:DocumentRouteElement
Resumes execution on a route node.- Specified by:
resume
in interfaceDocumentRouteElement
- Parameters:
session
- the sessionnodeId
- the node id to resume ontaskId
- the task iddata
- the data coming from UI formstatus
- the id of the button clicked to submit the related task form
-
getDocumentRoute
Description copied from interface:DocumentRouteElement
Return the DocumentRoute this element is part of.- Specified by:
getDocumentRoute
in interfaceDocumentRouteElement
- Parameters:
session
- The session use to fetch the route.
-
getDocument
Description copied from interface:DocumentRouteElement
Get the underlying document representing this element.- Specified by:
getDocument
in interfaceDocumentRouteElement
-
getProperty
-
getName
Description copied from interface:DocumentRouteElement
The name of this element.- Specified by:
getName
in interfaceDocumentRouteElement
-
getTitle
- Specified by:
getTitle
in interfaceDocumentRouteElement
- Since:
- 7.2
-
isValidated
public boolean isValidated()Description copied from interface:DocumentRouteElement
if the route this element is part of has been validated.- Specified by:
isValidated
in interfaceDocumentRouteElement
-
isReady
public boolean isReady()Description copied from interface:DocumentRouteElement
if this element is ready.- Specified by:
isReady
in interfaceDocumentRouteElement
-
isDone
public boolean isDone()Description copied from interface:DocumentRouteElement
if this route is done.- Specified by:
isDone
in interfaceDocumentRouteElement
-
checkLifeCycleState
-
getDescription
Description copied from interface:DocumentRouteElement
the description of this element.- Specified by:
getDescription
in interfaceDocumentRouteElement
-
isRunning
public boolean isRunning()Description copied from interface:DocumentRouteElement
if this route is running.- Specified by:
isRunning
in interfaceDocumentRouteElement
-
isCanceled
public boolean isCanceled()- Specified by:
isCanceled
in interfaceDocumentRouteElement
-
isDraft
public boolean isDraft()Description copied from interface:DocumentRouteElement
if this route is draft.- Specified by:
isDraft
in interfaceDocumentRouteElement
-
setRunning
Description copied from interface:DocumentRouteElement
set this element as running.- Specified by:
setRunning
in interfaceDocumentRouteElement
-
followTransition
public void followTransition(DocumentRouteElement.ElementLifeCycleTransistion transition, CoreSession session, boolean recursive) Description copied from interface:DocumentRouteElement
make this element follow a transition.- Specified by:
followTransition
in interfaceDocumentRouteElement
- Parameters:
transition
- the followed transition.session
- the session used to follow the transition.recursive
- If this element has children, do we recurse the follow transition.- See Also:
-
save
Description copied from interface:DocumentRouteElement
save the document representing this DocumentRoute.- Specified by:
save
in interfaceDocumentRouteElement
-
setDone
Description copied from interface:DocumentRouteElement
set this element as done.- Specified by:
setDone
in interfaceDocumentRouteElement
-
setValidated
Description copied from interface:DocumentRouteElement
set this element as validated.- Specified by:
setValidated
in interfaceDocumentRouteElement
-
setReady
Description copied from interface:DocumentRouteElement
set this element as ready.- Specified by:
setReady
in interfaceDocumentRouteElement
-
validate
Description copied from interface:DocumentRouteElement
Set this element to the validate state and put it in read only mode.- Specified by:
validate
in interfaceDocumentRouteElement
-
setReadOnly
Description copied from interface:DocumentRouteElement
remove write rights to everyone but the administrators.- Specified by:
setReadOnly
in interfaceDocumentRouteElement
-
canValidateStep
Description copied from interface:DocumentRouteElement
If this session can validate the step.- Specified by:
canValidateStep
in interfaceDocumentRouteElement
-
hasPermissionOnDocument
-
setCanValidateStep
Description copied from interface:DocumentRouteElement
make this user or group a validator for this step.- Specified by:
setCanValidateStep
in interfaceDocumentRouteElement
-
setPermissionOnDocument
-
canUpdateStep
Description copied from interface:DocumentRouteElement
If this session can update this step.- Specified by:
canUpdateStep
in interfaceDocumentRouteElement
-
setCanUpdateStep
Description copied from interface:DocumentRouteElement
make this user or group a step updater.- Specified by:
setCanUpdateStep
in interfaceDocumentRouteElement
-
setCanReadStep
Description copied from interface:DocumentRouteElement
make this user or group a step reader.- Specified by:
setCanReadStep
in interfaceDocumentRouteElement
-
canDeleteStep
Description copied from interface:DocumentRouteElement
If this session can delete this step.- Specified by:
canDeleteStep
in interfaceDocumentRouteElement
-
setCanDeleteStep
Description copied from interface:DocumentRouteElement
make this user or group step deleter.- Specified by:
setCanDeleteStep
in interfaceDocumentRouteElement
-
backToReady
Description copied from interface:DocumentRouteElement
Set the step back to the ready state from running or done. This method only modify the step state, it does not run any other action (such as undoing the step action)- Specified by:
backToReady
in interfaceDocumentRouteElement
-
canUndoStep
Description copied from interface:DocumentRouteElement
If this step can be undone. Default is to allow undoing only if the parent folder is running.- Specified by:
canUndoStep
in interfaceDocumentRouteElement
-
cancel
Description copied from interface:DocumentRouteElement
Cancel this element.- Specified by:
cancel
in interfaceDocumentRouteElement
-
setCanceled
Description copied from interface:DocumentRouteElement
Set the step to a cancel step. This method only modify the state of this element and does not run any other action.- Specified by:
setCanceled
in interfaceDocumentRouteElement
-
isModifiable
public boolean isModifiable()- Specified by:
isModifiable
in interfaceDocumentRouteElement
- Returns:
- true
-