org.activiti
Interface TaskService


public interface TaskService

provides access to Task related operations.

Author:
Tom Baeyens, Joram Barrez

Method Summary
 void addCandidateGroup(java.lang.String taskId, java.lang.String groupId)
          Convience shorthand for addUserInvolvement(taskId, groupId, TaskInvolvementType.CANDIDATE
 void addCandidateUser(java.lang.String taskId, java.lang.String userId)
          Convience shorthand for addUserInvolvement(taskId, userId, TaskInvolvementType.CANDIDATE
 void addGroupInvolvement(java.lang.String taskId, java.lang.String groupId, java.lang.String involvementType)
          Involves a group with a task.
 void addUserInvolvement(java.lang.String taskId, java.lang.String userId, java.lang.String involvementType)
          Involves a user with a task.
 void claim(java.lang.String taskId, java.lang.String userId)
          Claim responsibility for a task: the given user is made assignee for the task.
 void complete(java.lang.String taskId)
          Called when the task is successfully executed.
 void complete(java.lang.String taskId, java.util.Map<java.lang.String,java.lang.Object> variables)
          Called when the task is successfully executed, and the required task parameters are given by the end-user.
 TaskQuery createTaskQuery()
          Returns a new TaskQuery that can be used to dynamically query tasks.
 void deleteTask(java.lang.String taskId)
          Deletes the given task.
 java.util.List<Task> findAssignedTasks(java.lang.String assignee)
          Retrieves the list of tasks that are directly assigned to the given user.
 java.util.List<Task> findAssignedTasks(java.lang.String assignee, Page page)
          Retrieves the list of tasks that are directly assigned to the given user.
 Task findTask(java.lang.String taskId)
          Returns the task with given id.
 java.util.List<Task> findUnassignedTasks(java.lang.String userId)
          Retrieves the list of tasks that potentially can be done by the given user.
 java.util.List<Task> findUnassignedTasks(java.lang.String userId, Page page)
          Same as findUnassignedTasks, but paged.
 java.lang.Object getTaskForm(java.lang.String taskId)
          Retrieves the rendered task form for the given task.
 Task newTask()
          Creates a new task that is not related to any process instance.
 Task newTask(java.lang.String taskId)
          create a new task with a user defined task id
 void revoke(java.lang.String taskId)
          Releases (revokes) the given task.
 void saveTask(Task task)
          Saves the given task to the persistent data store.
 void setAssignee(java.lang.String taskId, java.lang.String userId)
          Changes the assignee of the given task to the given userId.
 void setPriority(java.lang.String taskId, int priority)
          Changes the priority of the task.
 

Method Detail

newTask

Task newTask()
Creates a new task that is not related to any process instance. The returned task is transient and must be saved with saveTask(Task) 'manually'.


newTask

Task newTask(java.lang.String taskId)
create a new task with a user defined task id


saveTask

void saveTask(Task task)
Saves the given task to the persistent data store.


findTask

Task findTask(java.lang.String taskId)
Returns the task with given id.


deleteTask

void deleteTask(java.lang.String taskId)
Deletes the given task.

Parameters:
taskId - The task id.

findAssignedTasks

java.util.List<Task> findAssignedTasks(java.lang.String assignee)
Retrieves the list of tasks that are directly assigned to the given user.


findAssignedTasks

java.util.List<Task> findAssignedTasks(java.lang.String assignee,
                                       Page page)
Retrieves the list of tasks that are directly assigned to the given user.

Parameters:
page - allows to retrieve only a part of the results. if null, no paging will be applied.

findUnassignedTasks

java.util.List<Task> findUnassignedTasks(java.lang.String userId)
Retrieves the list of tasks that potentially can be done by the given user. This means that the returned tasks are not yet directly assigned to the user, but rather to a certain role or group. To move a task from the 'candidate' task list to the 'personal' task list, call the claim() operation.


findUnassignedTasks

java.util.List<Task> findUnassignedTasks(java.lang.String userId,
                                         Page page)
Same as findUnassignedTasks, but paged.

Parameters:
page - allows to retrieve only a part of the results. if null, no paging will be applied.

claim

void claim(java.lang.String taskId,
           java.lang.String userId)
Claim responsibility for a task: the given user is made assignee for the task.


revoke

void revoke(java.lang.String taskId)
Releases (revokes) the given task. Opposite operation of claim Only usable when the task is in the 'in progress' or 'reserved' state. The task state will be put back to 'ready', without an actual owner.


getTaskForm

java.lang.Object getTaskForm(java.lang.String taskId)
Retrieves the rendered task form for the given task.


complete

void complete(java.lang.String taskId)
Called when the task is successfully executed.


complete

void complete(java.lang.String taskId,
              java.util.Map<java.lang.String,java.lang.Object> variables)
Called when the task is successfully executed, and the required task parameters are given by the end-user.


setAssignee

void setAssignee(java.lang.String taskId,
                 java.lang.String userId)
Changes the assignee of the given task to the given userId.


addCandidateUser

void addCandidateUser(java.lang.String taskId,
                      java.lang.String userId)
Convience shorthand for addUserInvolvement(taskId, userId, TaskInvolvementType.CANDIDATE


addCandidateGroup

void addCandidateGroup(java.lang.String taskId,
                       java.lang.String groupId)
Convience shorthand for addUserInvolvement(taskId, groupId, TaskInvolvementType.CANDIDATE


addUserInvolvement

void addUserInvolvement(java.lang.String taskId,
                        java.lang.String userId,
                        java.lang.String involvementType)
Involves a user with a task. The type of involvement is defined by the given involvementType (@see TaskInvolvementType)


addGroupInvolvement

void addGroupInvolvement(java.lang.String taskId,
                         java.lang.String groupId,
                         java.lang.String involvementType)
Involves a group with a task. The type of involvement is defined by the given involvementType (@see TaskInvolvementType)


setPriority

void setPriority(java.lang.String taskId,
                 int priority)
Changes the priority of the task. Authorization: actual owner / business admin


createTaskQuery

TaskQuery createTaskQuery()
Returns a new TaskQuery that can be used to dynamically query tasks.



Copyright © 2010 Alfresco. All Rights Reserved.