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> |
getAvailableDocumentRoute(CoreSession session)
Return the list of available
DocumentRoute document route. |
List<DocumentRoute> |
getAvailableDocumentRouteModel(CoreSession session)
Return the list of available
DocumentRoute model the user can start. |
List<DocumentRoute> |
getDocumentRelatedWorkflows(DocumentModel document,
CoreSession session) |
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
|
List<DocumentRoute> |
getRunningWorkflowInstancesLaunchedByCurrentUser(CoreSession session) |
List<DocumentRoute> |
getRunningWorkflowInstancesLaunchedByCurrentUser(CoreSession session,
String worflowModelName) |
List<Task> |
getTasks(DocumentModel document,
String actorId,
String workflowInstanceId,
String workflowModelName,
CoreSession session) |
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.
|
void |
importAllRouteModels(CoreSession session)
Imports all the route models resource templates.
|
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.
|
boolean |
isWorkflowModel(DocumentRoute documentRoute)
Returns true id the document route is a model, false if it is just an instance i.e.
|
void |
lockDocumentRoute(DocumentRoute routeModel,
CoreSession session)
Locks this
DocumentRoute if not already locked by the current user. |
void |
makeRoutingTasks(CoreSession session,
List<Task> tasks)
Deprecated.
The facet RoutingTask is statically attached to the new
RoutingTask Document type since 7.1
|
void |
reassignTask(CoreSession session,
String taskId,
List<String> actors,
String comment)
Reassigns the given task to the list of actors.
|
void |
registerRouteResource(RouteModelResourceType resource,
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
List<DocumentRoute> getAvailableDocumentRoute(CoreSession session)
DocumentRoute
document route.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
DocumentRoute
model by changing its lifecycle state and setting it and all its
children in ReadOnly.DocumentRouteNotLockedException
DocumentRoute unlockDocumentRouteUnrestrictedSession(DocumentRoute routeModel, CoreSession userSession)
DocumentRoute
model under unrestricted session.routeModel
- userSession
- List<DocumentRouteTableElement> getRouteElements(DocumentRoute route, CoreSession session)
DocumentRouteTableElement
for this DocumentRoute
.routeDocument
- DocumentRoute
.session
- The session used to query the DocumentRoute
.A
- list of DocumentRouteElement
List<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.DocumentRoute
List<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)
documentRoute
- coreSession
- @Deprecated void addRouteElementToRoute(DocumentRef parentDocumentRef, int idx, DocumentRouteElement routeElement, CoreSession session) throws DocumentRouteNotLockedException
parentDocumentRef
- The DocumentRef of the parent document.idx
- The position of the document in its container.routeElement
- The document to add.session
- DocumentRouteNotLockedException
@Deprecated void addRouteElementToRoute(DocumentRef parentDocumentRef, String sourceName, DocumentRouteElement routeElement, CoreSession session) throws DocumentRouteNotLockedException
parentDocumentRef
- The DocumentRef of the parent document.sourceName
- the name of the previous document in the container.routeElement
- the document to add.session
- DocumentRouteNotLockedException
@Deprecated void removeRouteElement(DocumentRouteElement routeElement, CoreSession session) throws DocumentRouteNotLockedException
The
- route element document.session
- DocumentRouteNotLockedException
@Deprecated DocumentModelList getOrderedRouteElement(String routeElementId, CoreSession session)
stepFolderId
- session
- void lockDocumentRoute(DocumentRoute routeModel, CoreSession session) throws DocumentRouteAlredayLockedException
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
.{@link
- DocumentRouteAlredayLockedException}DocumentRouteAlredayLockedException
void unlockDocumentRoute(DocumentRoute routeModel, CoreSession session) throws DocumentRouteNotLockedException
DocumentRoute
.If the document is not locked throws a DocumentRouteNotLockedException
routeDocument
- DocumentRoute
.session
- The session used to lock the DocumentRoute
.DocumentRouteNotLockedException
void updateRouteElement(DocumentRouteElement routeModel, CoreSession session) throws DocumentRouteNotLockedException
The
- route element document.session
- DocumentRouteNotLockedException
boolean isLockedByCurrentUser(DocumentRoute routeModel, CoreSession session)
DocumentRoute
is already locked by the current user.routeDocument
- DocumentRoute
.session
- boolean isRoutable(DocumentModel doc)
doc
- the documenttrue
if the document can be routedvoid importAllRouteModels(CoreSession session)
session
- the core session to useDocumentRoute importRouteModel(URL templateResource, boolean overwrite, CoreSession session)
templateResource
- overwrite
- session
- void registerRouteResource(RouteModelResourceType resource, RuntimeContext extensionContext)
resource
- the resourceList<URL> getRouteModelTemplateResources()
routeModelImporter
extension point to
contribute new resources.List<DocumentModel> searchRouteModels(CoreSession session, String searchString)
searchString
.DocumentRoute getRouteModelWithId(CoreSession session, String id)
String getRouteModelDocIdWithId(CoreSession session, String id)
@Deprecated void makeRoutingTasks(CoreSession session, List<Task> tasks)
This allows the related documents to be adapted to RoutingTask
.
session
- the sessiontasks
- the tasksvoid endTask(CoreSession session, Task task, Map<String,Object> data, String status)
session
- task
- data
- status
- name of the button clicked to submit the task formvoid grantPermissionToTaskAssignees(CoreSession session, String permission, List<DocumentModel> docs, Task task)
session
- the sessionpermission
- the permissiondocs
- the documentstask
- the taskvoid removePermissionFromTaskAssignees(CoreSession session, List<DocumentModel> docs, Task task)
session
- the sessiondocs
- the documentstask
- the taskList<DocumentModel> getWorkflowInputDocuments(CoreSession session, Task task)
session
- task
- void finishTask(CoreSession session, DocumentRoute route, Task task, boolean delete) throws DocumentRouteException
completeTask
method. Not executed using an unrestricted
session.session
- route
- task
- delete
- DocumentRouteException
void cancelTask(CoreSession session, String taskId) throws DocumentRouteException
completeTask
method.session
- task
- delete
- DocumentRouteException
void reassignTask(CoreSession session, String taskId, List<String> actors, String comment) throws DocumentRouteException
session
- taskId
- actors
- comment
- DocumentRouteException
void delegateTask(CoreSession session, String taskId, List<String> delegatedActors, String comment) throws DocumentRouteException
session
- taskId
- delegatedActors
- comment
- DocumentRouteException
void grantPermissionToTaskDelegatedActors(CoreSession session, String permission, List<DocumentModel> docs, Task task)
session
- the sessionpermission
- the permissiondocs
- the documentstask
- the taskvoid removePermissionsForTaskActors(CoreSession session, List<DocumentModel> docs, Task task)
session
- the sessiondocs
- the documentstask
- the taskvoid removePermissionsForTaskActors(CoreSession session, List<DocumentModel> docs, String taskId)
session
- the sessiondocs
- the documentstaskId
- the taskIdvoid cleanupDoneAndCanceledRouteInstances(String repositoryName, int limit)
void invalidateRouteModelsCache()
int doCleanupDoneAndCanceledRouteInstances(String reprositoryName, int limit)
List<Task> getTasks(DocumentModel document, String actorId, String workflowInstanceId, String workflowModelName, CoreSession session)
userId
- workflowInstanceId
- session
- List<DocumentRoute> getDocumentRelatedWorkflows(DocumentModel document, CoreSession session)
document
- session
- List<DocumentRoute> getRunningWorkflowInstancesLaunchedByCurrentUser(CoreSession session)
List<DocumentRoute> getRunningWorkflowInstancesLaunchedByCurrentUser(CoreSession session, String worflowModelName)
boolean isWorkflowModel(DocumentRoute documentRoute)
Copyright © 2015 Nuxeo SA. All rights reserved.