public class TaskServiceImpl extends DefaultComponent implements TaskService
| Modifier and Type | Class and Description |
|---|---|
class |
TaskServiceImpl.GetTaskRootParentPathUnrestricted |
TaskService.VariableName| Modifier and Type | Field and Description |
|---|---|
static ComponentName |
NAME |
TASK_INSTANCE_EVENT_PROPERTIES_KEY| Constructor and Description |
|---|
TaskServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
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. |
void |
activate(ComponentContext context)
Activates the component.
|
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> actorIds,
boolean createOneTaskPerActor,
String directive,
String comment,
Date dueDate,
Map<String,String> taskVariables,
String parentPath)
Creates a task and starts it.
|
void |
deactivate(ComponentContext context)
Deactivates the component.
|
void |
deleteTaskInstance(CoreSession coreSession,
String taskId)
Remove the documentTask identified by the given taskId if coreSession's
principal has the Remove permission.
|
void |
endTask(CoreSession coreSession,
NuxeoPrincipal principal,
Task task,
String comment,
String eventName,
boolean isValidated)
Ends the task
|
List<Task> |
getCurrentTaskInstances(CoreSession coreSession) |
List<Task> |
getCurrentTaskInstances(List<String> actors,
CoreSession coreSession)
Returns a list of task instances assigned to one of the actors in the
list or to its pool.
|
DocumentModel |
getTargetDocumentModel(Task task,
CoreSession coreSession) |
Task |
getTask(CoreSession coreSession,
String taskId) |
List<Task> |
getTaskInstances(DocumentModel dm,
List<String> actors,
CoreSession coreSession)
Returns the list of task instances associated with this document assigned
to one of the actor in the list or its pool.
|
List<Task> |
getTaskInstances(DocumentModel dm,
NuxeoPrincipal user,
CoreSession coreSession)
Returns the list of task instances associated with this document for
which the user is the actor or belongs to the pooled actor list.
|
String |
getTaskRootParentPath(CoreSession coreSession)
Default value is /task-root
|
void |
notifyEventListeners(String name,
String comment,
String[] recipients,
CoreSession session,
NuxeoPrincipal principal,
DocumentModel doc)
Notify the event producer on the machine the jbpm service is.
|
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
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. |
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
applicationStarted, getAdapter, registerExtension, unregisterExtensionpublic static final ComponentName NAME
public void activate(ComponentContext context) throws Exception
ComponentThis method is called by the runtime when a component is activated.
activate in interface Componentactivate in class DefaultComponentcontext - the runtime contextException - if an error occurs during activationpublic void deactivate(ComponentContext context) throws Exception
ComponentThis method is called by the runtime when a component is deactivated.
deactivate in interface Componentdeactivate in class DefaultComponentcontext - the runtime contextException - if an error occurs during activationpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) throws Exception
registerContribution in class DefaultComponentExceptionpublic void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) throws Exception
unregisterContribution in class DefaultComponentExceptionpublic List<Task> createTask(CoreSession coreSession, NuxeoPrincipal principal, DocumentModel document, String taskName, List<String> actorIds, boolean createOneTaskPerActor, String directive, String comment, Date dueDate, Map<String,String> taskVariables, String parentPath) throws ClientException
TaskServiceTaskEventNames.WORKFLOW_TASK_ASSIGNED and
TaskEventNames.WORKFLOW_TASK_ASSIGNED, passing the task in the
event properties using key TaskService.TASK_INSTANCE_EVENT_PROPERTIES_KEYcreateTask in interface TaskServicecoreSession - 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.actorIds - 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 nullClientExceptionpublic void acceptTask(CoreSession coreSession, NuxeoPrincipal principal, Task task, String comment) throws ClientException
TaskServiceTaskEventNames.WORKFLOW_TASK_COMPLETED and marking the task as
validated.acceptTask in interface TaskServiceClientExceptionTaskService.endTask(CoreSession, NuxeoPrincipal, Task, String, String, boolean)public void rejectTask(CoreSession coreSession, NuxeoPrincipal principal, Task task, String comment) throws ClientException
TaskServiceTaskEventNames.WORKFLOW_TASK_REJECTED and marking the task as not
validated.rejectTask in interface TaskServiceClientExceptionTaskService.endTask(CoreSession, NuxeoPrincipal, Task, String, String, boolean)public void endTask(CoreSession coreSession, NuxeoPrincipal principal, Task task, String comment, String eventName, boolean isValidated) throws ClientException
TaskServiceendTask in interface TaskServicecoreSession - 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 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
TaskService.canEndTask(NuxeoPrincipal, Task)), or when any other
error occurspublic boolean canEndTask(NuxeoPrincipal principal, Task task) throws ClientException
TaskServicecanEndTask in interface TaskServiceClientExceptionpublic void notifyEventListeners(String name, String comment, String[] recipients, CoreSession session, NuxeoPrincipal principal, DocumentModel doc) throws ClientException
TaskServicenotifyEventListeners in interface TaskServicename - the name of the eventcomment - the commentrecipients - the recipients property of the event contextClientExceptionpublic Task getTask(CoreSession coreSession, String taskId) throws ClientException
getTask in interface TaskServiceClientExceptionpublic void deleteTaskInstance(CoreSession coreSession, String taskId) throws ClientException
TaskServicedeleteTaskInstance in interface TaskServiceClientExceptionpublic DocumentModel getTargetDocumentModel(Task task, CoreSession coreSession) throws ClientException
getTargetDocumentModel in interface TaskServicetask - the task.ClientExceptionpublic List<Task> getCurrentTaskInstances(CoreSession coreSession) throws ClientException
getCurrentTaskInstances in interface TaskProviderClientExceptionpublic List<Task> getCurrentTaskInstances(List<String> actors, CoreSession coreSession) throws ClientException
getCurrentTaskInstances in interface TaskProvideractors - a list used as actorId to retrieve the tasks.filter - ClientExceptionpublic List<Task> getTaskInstances(DocumentModel dm, NuxeoPrincipal user, CoreSession coreSession) throws ClientException
TaskProviderIf the user is null, then it returns all task instances for the document.
getTaskInstances in interface TaskProviderdm - the document.ClientExceptionpublic List<Task> getTaskInstances(DocumentModel dm, List<String> actors, CoreSession coreSession) throws ClientException
TaskProvidergetTaskInstances in interface TaskProviderClientExceptionpublic String getTaskRootParentPath(CoreSession coreSession)
TaskServicegetTaskRootParentPath in interface TaskServiceCopyright © 2011 Nuxeo SA. All Rights Reserved.