public interface DocumentRoutingService
DocumentRoutes.| Modifier and Type | Method and Description |
|---|---|
void |
addRouteElementToRoute(DocumentRef parentDocumentRef,
int idx,
DocumentRouteElement routeElement,
CoreSession session)
Deprecated.
since 5.9.2 - Use only routes of type 'graph'
|
void |
addRouteElementToRoute(DocumentRef parentDocumentRef,
String sourceName,
DocumentRouteElement routeElement,
CoreSession session)
Deprecated.
since 5.9.2 - Use only routes of type 'graph'
|
void |
cancelTask(CoreSession session,
String taskId)
Cancels an open task.
|
boolean |
canUserValidateRoute(NuxeoPrincipal currentUser)
Deprecated.
use
canValidateRoute(DocumentModel, CoreSession)
instead. |
boolean |
canValidateRoute(DocumentModel documentRoute,
CoreSession coreSession)
Checks if the principal that created the client session can validate the
route
|
void |
cleanupDoneAndCanceledRouteInstances(String repositoryName,
int limit)
Query for the routes 'done' or 'canceled' and delete them.
|
void |
completeTask(String routeId,
String taskId,
Map<String,Object> data,
String status,
CoreSession session)
Completes a task on a give node.
|
DocumentRoute |
createNewInstance(DocumentRoute model,
List<String> documentIds,
CoreSession session)
Deprecated.
since 5.6, use other APIs
|
DocumentRoute |
createNewInstance(DocumentRoute model,
List<String> documentIds,
CoreSession session,
boolean startInstance)
Create a new
DocumentRoute instance from this
DocumentRoute model. |
DocumentRoute |
createNewInstance(DocumentRoute model,
String documentId,
CoreSession session)
Deprecated.
since 5.6, use other APIs
|
DocumentRoute |
createNewInstance(DocumentRoute model,
String documentId,
CoreSession session,
boolean startInstance)
Deprecated.
since 5.6, use other APIs
|
String |
createNewInstance(String routeModelId,
List<String> docIds,
CoreSession session,
boolean startInstance)
Creates a new route instance and optionally starts it.
|
String |
createNewInstance(String routeModelId,
List<String> docIds,
Map<String,Serializable> map,
CoreSession session,
boolean startInstance)
Creates a new route instance and optionally starts it.
|
void |
delegateTask(CoreSession session,
String taskId,
List<String> delegatedActors,
String comment)
Reassigns the given task to the list of actors.
|
int |
doCleanupDoneAndCanceledRouteInstances(String reprositoryName,
int limit)
Query for the routes 'done' or 'canceled' and delete them.
|
void |
endTask(CoreSession session,
Task task,
Map<String,Object> data,
String status)
Ends a task.
|
void |
finishTask(CoreSession session,
DocumentRoute route,
Task task,
boolean delete)
Deprecated.
// will be removed in 5.8, use completeTask instead
|
List<DocumentRoute> |
getAvailableDocumentRouteModel(CoreSession session)
Return the list of available
DocumentRoute model the user can
start. |
List<DocumentRoute> |
getDocumentRoutesForAttachedDocument(CoreSession session,
String attachedDocId) |
List<DocumentRoute> |
getDocumentRoutesForAttachedDocument(CoreSession session,
String attachedDocId,
List<DocumentRouteElement.ElementLifeCycleState> states)
Return the list of related
DocumentRoute in a state for a given
attached document. |
String |
getOperationChainId(String documentType)
Deprecated.
since 5.9.2 - Use only routes of type 'graph'
|
DocumentModelList |
getOrderedRouteElement(String routeElementId,
CoreSession session)
Deprecated.
since 5.9.2 - Use only routes of type 'graph'
|
List<DocumentRouteTableElement> |
getRouteElements(DocumentRoute route,
CoreSession session)
Computes the list of elements
DocumentRouteTableElement for this
DocumentRoute. |
String |
getRouteModelDocIdWithId(CoreSession session,
String id)
Returns the doc id of the route model with the given id
|
List<URL> |
getRouteModelTemplateResources()
Returns all the route models resource templates.
|
DocumentRoute |
getRouteModelWithId(CoreSession session,
String id)
Returns the route model with the given id
|
String |
getUndoFromDoneOperationChainId(String documentType)
Return the operation chain to undo a step when the step is in done state.
|
String |
getUndoFromRunningOperationChainId(String documentType)
Deprecated.
since 5.9.2 - Use only routes of type 'graph'
|
List<DocumentModel> |
getWorkflowInputDocuments(CoreSession session,
Task task)
Gets the documents following the workflow to which the given task belongs
|
void |
grantPermissionToTaskAssignees(CoreSession session,
String permission,
List<DocumentModel> docs,
Task task)
Grants on these documents the specified assignees permissions for this
task.
|
void |
grantPermissionToTaskDelegatedActors(CoreSession session,
String permission,
List<DocumentModel> docs,
Task task)
Grants on these documents the specified assignees permissions for this
task to the tasks delegated actors.
|
DocumentRoute |
importRouteModel(URL templateResource,
boolean overwrite,
CoreSession session)
Creates a route model in the root models folder defined by the current
persister.
|
void |
invalidateRouteModelsCache() |
boolean |
isLockedByCurrentUser(DocumentRoute routeModel,
CoreSession session)
Verify is this
DocumentRoute is already locked by the current
user. |
boolean |
isRoutable(DocumentModel doc)
Checks if the given document can be associated to a DocumentRoute.
|
void |
lockDocumentRoute(DocumentRoute routeModel,
CoreSession session)
Locks this
DocumentRoute if not already locked by the current
user. |
void |
makeRoutingTasks(CoreSession session,
List<Task> tasks)
Marks the tasks as Routing tasks.
|
void |
reassignTask(CoreSession session,
String taskId,
List<String> actors,
String comment)
Reassigns the given task to the list of actors.
|
void |
registerRouteResource(RouteModelResourceType resource,
org.nuxeo.runtime.model.RuntimeContext extensionContext)
Registers a new route model template to be imported at application
startup.
|
void |
removePermissionFromTaskAssignees(CoreSession session,
List<DocumentModel> docs,
Task task)
Removes on these documents the specified assignees permissions for this
task.
|
void |
removePermissionsForTaskActors(CoreSession session,
List<DocumentModel> docs,
String taskId)
Removes on these documents the specified assignees permissions for the task actors and also tasks delegated
actors if this task was delegated
|
void |
removePermissionsForTaskActors(CoreSession session,
List<DocumentModel> docs,
Task task)
Removes on these documents the specified assignees permissions for the
task actors and also tasks delegated actors if this task was delegated
|
void |
removeRouteElement(DocumentRouteElement routeElement,
CoreSession session)
Deprecated.
since 5.9.2 - Use only routes of type 'graph'
|
void |
resumeInstance(String routeId,
String nodeId,
Map<String,Object> data,
String status,
CoreSession session)
Resumes a route instance on a give node.
|
DocumentRoute |
saveRouteAsNewModel(DocumentRoute route,
CoreSession session)
Save a route instance as a new model of route.
|
List<DocumentModel> |
searchRouteModels(CoreSession session,
String searchString)
Returns the route models matching the
searchString. |
void |
startInstance(String routeInstanceId,
List<String> docIds,
Map<String,Serializable> map,
CoreSession session)
Starts an instance that was created with
createNewInstance(java.lang.String, java.util.List<java.lang.String>, java.util.Map<java.lang.String, java.io.Serializable>, org.nuxeo.ecm.core.api.CoreSession, boolean) but
with startInstance = false. |
void |
unlockDocumentRoute(DocumentRoute routeModel,
CoreSession session)
Unlocks this
DocumentRoute.If the document is not locked throws a
DocumentRouteNotLockedException |
DocumentRoute |
unlockDocumentRouteUnrestrictedSession(DocumentRoute routeModel,
CoreSession userSession)
Unlock the given
DocumentRoute model under unrestricted session. |
void |
updateRouteElement(DocumentRouteElement routeModel,
CoreSession session)
Update the given route element
|
DocumentRoute |
validateRouteModel(DocumentRoute routeModel,
CoreSession session)
Validates the given
DocumentRoute model by changing its lifecycle
state and setting it and all its children in ReadOnly. |
String createNewInstance(String routeModelId, List<String> docIds, Map<String,Serializable> map, CoreSession session, boolean startInstance)
If startInstance = false, then the route can be started later by
calling startInstance(java.lang.String, java.util.List<java.lang.String>, java.util.Map<java.lang.String, java.io.Serializable>, org.nuxeo.ecm.core.api.CoreSession).
routeModelId - the route model iddocIds - the list of document bound to the instancemap - the values to pass as initial workflow variablessession - the sessionstartInstance - if the route is automatically startedString createNewInstance(String routeModelId, List<String> docIds, CoreSession session, boolean startInstance)
If startInstance = false, then the route can be started later by
calling startInstance(java.lang.String, java.util.List<java.lang.String>, java.util.Map<java.lang.String, java.io.Serializable>, org.nuxeo.ecm.core.api.CoreSession).
routeModelId - the route model iddocIds - The list of document bound to the instance.session - the sessionstartInstance - if the route is automatically startedDocumentRoute createNewInstance(DocumentRoute model, List<String> documentIds, CoreSession session, boolean startInstance)
DocumentRoute instance from this
DocumentRoute model.model - The model used to create the instance.documentIds - The list of document bound to the instance.startInstance - if the DocumentRoute is automatically
started.DocumentRoute instance.@Deprecated DocumentRoute createNewInstance(DocumentRoute model, String documentId, CoreSession session, boolean startInstance)
@Deprecated DocumentRoute createNewInstance(DocumentRoute model, List<String> documentIds, CoreSession session)
@Deprecated DocumentRoute createNewInstance(DocumentRoute model, String documentId, CoreSession session)
void startInstance(String routeInstanceId, List<String> docIds, Map<String,Serializable> map, CoreSession session)
createNewInstance(java.lang.String, java.util.List<java.lang.String>, java.util.Map<java.lang.String, java.io.Serializable>, org.nuxeo.ecm.core.api.CoreSession, boolean) but
with startInstance = false.routeInstanceId - the route instance iddocIds - the list of document bound to the instancemap - the values to pass as initial workflow variablessession - the sessionvoid resumeInstance(String routeId, String nodeId, Map<String,Object> data, String status, CoreSession session)
routeId - the id of the route instancenodeId - the node id to resume ondata - the data coming from UI formstatus - the status coming from UI formsession - the sessionvoid completeTask(String routeId, String taskId, Map<String,Object> data, String status, CoreSession session)
routeId - the id of the route instancetaskId - the id of the taskdata - the data coming from UI formstatus - the status coming from UI formsession - the sessionDocumentRoute saveRouteAsNewModel(DocumentRoute route, CoreSession session)
DocumentRoutingPersister. The route instance should be in either
running, done or ready state. The new route model will be in draft state
and won't have any attached documents.route - the instance from which we create a new model.List<DocumentRoute> getAvailableDocumentRouteModel(CoreSession session)
DocumentRoute model the user can
start.session - The session of the user.DocumentRoute@Deprecated String getOperationChainId(String documentType)
chainsToType
extension point to contribute new mapping.documentType - The document type@Deprecated String getUndoFromRunningOperationChainId(String documentType)
chainsToType extension point to contribute new mapping.documentType - String getUndoFromDoneOperationChainId(String documentType)
chainsToType extension point to contribute new mapping.documentType - DocumentRoute validateRouteModel(DocumentRoute routeModel, CoreSession session) throws DocumentRouteNotLockedException, ClientException
DocumentRoute model by changing its lifecycle
state and setting it and all its children in ReadOnly.DocumentRouteNotLockedExceptionClientExceptionDocumentRoute unlockDocumentRouteUnrestrictedSession(DocumentRoute routeModel, CoreSession userSession) throws ClientException
DocumentRoute model under unrestricted session.routeModel - userSession - ClientExceptionList<DocumentRouteTableElement> getRouteElements(DocumentRoute route, CoreSession session)
DocumentRouteTableElement for this
DocumentRoute.routeDocument - DocumentRoute.session - The session used to query the DocumentRoute.A - list of DocumentRouteElementList<DocumentRoute> getDocumentRoutesForAttachedDocument(CoreSession session, String attachedDocId, List<DocumentRouteElement.ElementLifeCycleState> states)
DocumentRoute in a state for a given
attached document.session - The session used to query the DocumentRoute.states - the list of states.DocumentRouteList<DocumentRoute> getDocumentRoutesForAttachedDocument(CoreSession session, String attachedDocId)
session - attachedDocId - for
route running or ready.@Deprecated boolean canUserValidateRoute(NuxeoPrincipal currentUser)
canValidateRoute(DocumentModel, CoreSession)
instead.boolean canValidateRoute(DocumentModel documentRoute, CoreSession coreSession) throws ClientException
documentRoute - coreSession - ClientException@Deprecated void addRouteElementToRoute(DocumentRef parentDocumentRef, int idx, DocumentRouteElement routeElement, CoreSession session) throws DocumentRouteNotLockedException, ClientException
parentDocumentRef - The DocumentRef of the parent document.idx - The position of the document in its container.routeElement - The document to add.session - ClientExceptionDocumentRouteNotLockedException@Deprecated void addRouteElementToRoute(DocumentRef parentDocumentRef, String sourceName, DocumentRouteElement routeElement, CoreSession session) throws DocumentRouteNotLockedException, ClientException
parentDocumentRef - The DocumentRef of the parent document.sourceName - the name of the previous document in the container.routeElement - the document to add.session - ClientExceptionDocumentRouteNotLockedException@Deprecated void removeRouteElement(DocumentRouteElement routeElement, CoreSession session) throws DocumentRouteNotLockedException, ClientException
The - route element document.session - ClientExceptionDocumentRouteNotLockedException@Deprecated DocumentModelList getOrderedRouteElement(String routeElementId, CoreSession session) throws ClientException
stepFolderId - session - ClientExceptionvoid lockDocumentRoute(DocumentRoute routeModel, CoreSession session) throws DocumentRouteAlredayLockedException, ClientException
DocumentRoute if not already locked by the current
user. If the document is already locked by another user and
DocumentRouteAlredayLockedException is thrownrouteDocument - DocumentRoute.session - The session used to lock the DocumentRoute.ClientException{@link - DocumentRouteAlredayLockedException}DocumentRouteAlredayLockedExceptionvoid unlockDocumentRoute(DocumentRoute routeModel, CoreSession session) throws DocumentRouteNotLockedException, ClientException
DocumentRoute.If the document is not locked throws a
DocumentRouteNotLockedExceptionrouteDocument - DocumentRoute.session - The session used to lock the DocumentRoute.{@link - ClientException}DocumentRouteNotLockedExceptionClientExceptionvoid updateRouteElement(DocumentRouteElement routeModel, CoreSession session) throws DocumentRouteNotLockedException, ClientException
The - route element document.session - ClientExceptionDocumentRouteNotLockedExceptionboolean isLockedByCurrentUser(DocumentRoute routeModel, CoreSession session) throws ClientException
DocumentRoute is already locked by the current
user.routeDocument - DocumentRoute.session - ClientExceptionboolean isRoutable(DocumentModel doc)
doc - the documenttrue if the document can be routedDocumentRoute importRouteModel(URL templateResource, boolean overwrite, CoreSession session) throws ClientException
templateResource - overwrite - session - ClientExceptionvoid registerRouteResource(RouteModelResourceType resource, org.nuxeo.runtime.model.RuntimeContext extensionContext)
resource - the resourceList<URL> getRouteModelTemplateResources() throws ClientException
routeModelImporter extension point to contribute new
resources.ClientExceptionList<DocumentModel> searchRouteModels(CoreSession session, String searchString) throws ClientException
searchString.ClientExceptionDocumentRoute getRouteModelWithId(CoreSession session, String id) throws ClientException
ClientExceptionString getRouteModelDocIdWithId(CoreSession session, String id) throws ClientException
ClientExceptionvoid makeRoutingTasks(CoreSession session, List<Task> tasks) throws ClientException
This allows the related documents to be adapted to RoutingTask.
session - the sessiontasks - the tasksClientExceptionvoid endTask(CoreSession session, Task task, Map<String,Object> data, String status) throws ClientException
session - task - data - status - name of the button clicked to submit the task formClientExceptionvoid grantPermissionToTaskAssignees(CoreSession session, String permission, List<DocumentModel> docs, Task task) throws ClientException
session - the sessionpermission - the permissiondocs - the documentstask - the taskClientExceptionvoid removePermissionFromTaskAssignees(CoreSession session, List<DocumentModel> docs, Task task) throws ClientException
session - the sessiondocs - the documentstask - the taskClientExceptionList<DocumentModel> getWorkflowInputDocuments(CoreSession session, Task task) throws ClientException
session - task - ClientExceptionvoid finishTask(CoreSession session, DocumentRoute route, Task task, boolean delete) throws DocumentRouteException
completeTask method. Not executed using an
unrestricted session.session - route - task - delete - DocumentRouteExceptionvoid cancelTask(CoreSession session, String taskId) throws DocumentRouteException
completeTask method.session - task - delete - DocumentRouteExceptionvoid reassignTask(CoreSession session, String taskId, List<String> actors, String comment) throws DocumentRouteException
session - taskId - actors - comment - DocumentRouteExceptionvoid delegateTask(CoreSession session, String taskId, List<String> delegatedActors, String comment) throws DocumentRouteException
session - taskId - delegatedActors - comment - DocumentRouteExceptionvoid grantPermissionToTaskDelegatedActors(CoreSession session, String permission, List<DocumentModel> docs, Task task) throws ClientException
session - the sessionpermission - the permissiondocs - the documentstask - the taskClientExceptionvoid removePermissionsForTaskActors(CoreSession session, List<DocumentModel> docs, Task task) throws ClientException
session - the sessiondocs - the documentstask - the taskClientExceptionvoid removePermissionsForTaskActors(CoreSession session, List<DocumentModel> docs, String taskId) throws ClientException
session - the sessiondocs - the documentstaskId - the taskIdClientExceptionvoid cleanupDoneAndCanceledRouteInstances(String repositoryName, int limit) throws ClientException
ClientExceptionvoid invalidateRouteModelsCache()
int doCleanupDoneAndCanceledRouteInstances(String reprositoryName, int limit)
Copyright © 2019 Nuxeo SA. All rights reserved.