public interface TaskService extends Serializable, TaskProvider
Modifier and Type | Interface and Description |
---|---|
static class |
TaskService.VariableName
The variable used as process instance variables.
|
Modifier and Type | Field and Description |
---|---|
static String |
TASK_INSTANCE_EVENT_PROPERTIES_KEY
Property used to pass task in the notified events properties
|
Modifier and Type | Method and Description |
---|---|
String |
acceptTask(CoreSession coreSession,
NuxeoPrincipal principal,
Task task,
String comment)
Ends the task using event name
TaskEventNames.WORKFLOW_TASK_COMPLETED and marking the task as
validated. |
boolean |
canEndTask(NuxeoPrincipal principal,
Task task)
Returns true if user is an administrator, the initiator of the task, or
an actor of the task.
|
List<Task> |
createTask(CoreSession coreSession,
NuxeoPrincipal principal,
DocumentModel document,
String taskName,
List<String> prefixedActorIds,
boolean createOneTaskPerActor,
String directive,
String comment,
Date dueDate,
Map<String,String> taskVariables,
String parentPath)
Creates a task and starts it.
|
List<Task> |
createTask(CoreSession coreSession,
NuxeoPrincipal principal,
DocumentModel document,
String taskName,
String taskType,
String processId,
List<String> prefixedActorIds,
boolean createOneTaskPerActor,
String directive,
String comment,
Date dueDate,
Map<String,String> taskVariables,
String parentPath)
Creates a task and starts it.
|
List<Task> |
createTask(CoreSession coreSession,
NuxeoPrincipal principal,
DocumentModel document,
String taskDocumentType,
String taskName,
String taskType,
String processId,
List<String> prefixedActorIds,
boolean createOneTaskPerActor,
String directive,
String comment,
Date dueDate,
Map<String,String> taskVariables,
String parentPath,
Map<String,Serializable> eventInfo)
Creates a task of the given document type and starts it.
|
void |
deleteTask(CoreSession coreSession,
String taskId)
Remove the documentTask identified by the given taskId if coreSession's
principal has the Remove permission.
|
String |
endTask(CoreSession coreSession,
NuxeoPrincipal principal,
Task task,
String comment,
String eventName,
boolean isValidated)
Ends the task
|
DocumentModel |
getTargetDocumentModel(Task ti,
CoreSession coreSession) |
Task |
getTask(CoreSession coreSession,
String taskId) |
String |
getTaskRootParentPath(CoreSession coreSession)
Default value is /task-root
|
void |
reassignTask(CoreSession session,
String taskId,
List<String> actors,
String comment)
Reassign the given task to the list of actors.
|
String |
rejectTask(CoreSession coreSession,
NuxeoPrincipal principal,
Task task,
String comment)
Ends the task using event name
TaskEventNames.WORKFLOW_TASK_REJECTED and marking the task as not
validated. |
getAllTaskInstances, getAllTaskInstances, getAllTaskInstances, getAllTaskInstances, getCurrentTaskInstances, getCurrentTaskInstances, getTaskInstances, getTaskInstances
static final String TASK_INSTANCE_EVENT_PROPERTIES_KEY
List<Task> createTask(CoreSession coreSession, NuxeoPrincipal principal, DocumentModel document, String taskName, List<String> prefixedActorIds, boolean createOneTaskPerActor, String directive, String comment, Date dueDate, Map<String,String> taskVariables, String parentPath) throws ClientException
TaskEventNames.WORKFLOW_TASK_ASSIGNED
and
TaskEventNames.WORKFLOW_TASK_ASSIGNED
, passing the task in the
event properties using key TASK_INSTANCE_EVENT_PROPERTIES_KEY
coreSession
- the session to use when notifyingprincipal
- the principal marked as initiator of the task and used
when notifying.document
- the document to attach to the task.taskName
- the task name.prefixedActorIds
- the list of actor ids, prefixed with 'user:' or
'group:'.createOneTaskPerActor
- if true, one task will be created per actor,
else a single task will be assigned to all actors.directive
- the directive, put in the task variables.comment
- string added to the task comments and used as a
notification commentdueDate
- the due date, set on the task instancetaskVariables
- additional task variablesparentPath
- /task-root if nullClientException
List<Task> createTask(CoreSession coreSession, NuxeoPrincipal principal, DocumentModel document, String taskName, String taskType, String processId, List<String> prefixedActorIds, boolean createOneTaskPerActor, String directive, String comment, Date dueDate, Map<String,String> taskVariables, String parentPath) throws ClientException
TaskEventNames.WORKFLOW_TASK_ASSIGNED
and
TaskEventNames.WORKFLOW_TASK_ASSIGNED
, passing the task in the
event properties using key TASK_INSTANCE_EVENT_PROPERTIES_KEY
coreSession
- the session to use when notifyingprincipal
- the principal marked as initiator of the task and used
when notifying.document
- the document to attach to the task.taskName
- the task name.taskType
- the task type.processId
- the process ID linked to this task if any.prefixedActorIds
- the list of actor ids, prefixed with 'user:' or
'group:'.createOneTaskPerActor
- if true, one task will be created per actor,
else a single task will be assigned to all actors.directive
- the directive, put in the task variables.comment
- string added to the task comments and used as a
notification commentdueDate
- the due date, set on the task instancetaskVariables
- additional task variablesparentPath
- /task-root if nullClientException
List<Task> createTask(CoreSession coreSession, NuxeoPrincipal principal, DocumentModel document, String taskDocumentType, String taskName, String taskType, String processId, List<String> prefixedActorIds, boolean createOneTaskPerActor, String directive, String comment, Date dueDate, Map<String,String> taskVariables, String parentPath, Map<String,Serializable> eventInfo) throws ClientException
TaskEventNames.WORKFLOW_TASK_ASSIGNED
and
TaskEventNames.WORKFLOW_TASK_ASSIGNED
, passing the task in the
event properties using key TASK_INSTANCE_EVENT_PROPERTIES_KEY
Also the map eventInfo is passed in the event propertiescoreSession
- the session to use when notifyingprincipal
- the principal marked as initiator of the task and used
when notifying.document
- the document to attach to the task.the
- task document typetaskName
- the task name.taskType
- the task type.processId
- the process ID linked to this task if any.prefixedActorIds
- the list of actor ids, prefixed with 'user:' or
'group:'.createOneTaskPerActor
- if true, one task will be created per actor,
else a single task will be assigned to all actors.directive
- the directive, put in the task variables.comment
- string added to the task comments and used as a
notification commentdueDate
- the due date, set on the task instancetaskVariables
- additional task variablesparentPath
- /task-root if nulleventInfo
- ClientException
boolean canEndTask(NuxeoPrincipal principal, Task task) throws ClientException
ClientException
String acceptTask(CoreSession coreSession, NuxeoPrincipal principal, Task task, String comment) throws ClientException
TaskEventNames.WORKFLOW_TASK_COMPLETED
and marking the task as
validated.ClientException
endTask(CoreSession, NuxeoPrincipal, Task, String, String, boolean)
String rejectTask(CoreSession coreSession, NuxeoPrincipal principal, Task task, String comment) throws ClientException
TaskEventNames.WORKFLOW_TASK_REJECTED
and marking the task as not
validated.ClientException
endTask(CoreSession, NuxeoPrincipal, Task, String, String, boolean)
String endTask(CoreSession coreSession, NuxeoPrincipal principal, Task task, String comment, String eventName, boolean isValidated) throws ClientException
endTask
in interface TaskProvider
coreSession
- the session to use when notifying and resolving of
referenced document for notification.principal
- principal used when notifyingtask
- the instance to endcomment
- string added to the task comments and used as a
notification commenteventName
- the core event name to use when notifyingisValidated
- boolean marker to state if the task was validated or
rejectedClientException
- when trying to end a task without being granted
the right to do so (see
canEndTask(NuxeoPrincipal, Task)
), or when any other
error occursvoid deleteTask(CoreSession coreSession, String taskId) throws ClientException
coreSession
- taskId
- ClientException
DocumentModel getTargetDocumentModel(Task ti, CoreSession coreSession) throws ClientException
ti
- the task.user
- the user.ClientException
Task getTask(CoreSession coreSession, String taskId) throws ClientException
coreSession
- taskId
- ClientException
String getTaskRootParentPath(CoreSession coreSession)
void reassignTask(CoreSession session, String taskId, List<String> actors, String comment) throws ClientException
session
- taskId
- actors
- ClientException
Copyright © 2013 Nuxeo SA. All Rights Reserved.