org.apache.agila.impl.dao
Class TaskServiceImpl

java.lang.Object
  extended by org.apache.agila.services.task.AbstractTaskService
      extended by org.apache.agila.impl.dao.TaskServiceImpl
All Implemented Interfaces:
TaskService
Direct Known Subclasses:
TaskServiceImpl

public class TaskServiceImpl
extends AbstractTaskService

A provide which delegates to an AgilaDAO for all of the detailed persistence methods.

Version:
$Id: $
Author:
James Strachan

Constructor Summary
TaskServiceImpl(AgilaDAO dao)
           
 
Method Summary
 java.util.List getTasksForGroups(GroupID[] teamIDs, int status)
          Returns a list of tasks for the groups in which a user belongs.
 java.util.List getTasksForInstance(InstanceID instanceID, int status)
          Returns a list of tasks for the given workflow instance which are at the specified status
protected  Task internalGetTask(TaskID taskID)
           
protected  java.util.List internalGetTasksByUserID(UserID userID, int status)
           
protected  void internalSave(Task task)
          Add or update a task.
 boolean lockTaskForUser(TaskID taskID, UserID userID)
          Attempts to lock the given task for the user, to take ownership of the task if noone else has locked it yet.
 int setTaskStatusForInstance(InstanceID instanceID, int oldStatus, int newStatus)
          Updates the status of all tasks of the oldStatus on the given workflow instance to the newStatus.
 void unlockTaskForUser(TaskID taskID, UserID userID)
          Unlocks the task for the given user so that its given back to the team for another user to complete.
 
Methods inherited from class org.apache.agila.services.task.AbstractTaskService
assignTask, assignTaskToActors, assignTaskToTeam, getRendererForTask, getResponseHandlerForTask, getTaskByID, getTasksForUser, setActorResolverService, setBusinessProcessService, setInstanceService, setNotificationService, setTaskStatus, setTimerService, setTokenService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskServiceImpl

public TaskServiceImpl(AgilaDAO dao)
Method Detail

getTasksForGroups

public java.util.List getTasksForGroups(GroupID[] teamIDs,
                                        int status)
Description copied from interface: TaskService
Returns a list of tasks for the groups in which a user belongs. The definitions of the groups is outside of the scope of Agila.

Returns:

lockTaskForUser

public boolean lockTaskForUser(TaskID taskID,
                               UserID userID)
Description copied from interface: TaskService
Attempts to lock the given task for the user, to take ownership of the task if noone else has locked it yet.

Returns:
true if the task was locked or false if another user has already locked it.

getTasksForInstance

public java.util.List getTasksForInstance(InstanceID instanceID,
                                          int status)
Description copied from interface: TaskService
Returns a list of tasks for the given workflow instance which are at the specified status


unlockTaskForUser

public void unlockTaskForUser(TaskID taskID,
                              UserID userID)
Description copied from interface: TaskService
Unlocks the task for the given user so that its given back to the team for another user to complete.


setTaskStatusForInstance

public int setTaskStatusForInstance(InstanceID instanceID,
                                    int oldStatus,
                                    int newStatus)
Description copied from interface: TaskService
Updates the status of all tasks of the oldStatus on the given workflow instance to the newStatus. This method can be used to cancel/complete all open tasks, or re-open all complete tasks etc.

oldStatus - the current status of the tasks
newStatus - the new status of the tasks
Returns:
the number of rows updated

internalSave

protected void internalSave(Task task)
Add or update a task.

Specified by:
internalSave in class AbstractTaskService

internalGetTasksByUserID

protected java.util.List internalGetTasksByUserID(UserID userID,
                                                  int status)
Specified by:
internalGetTasksByUserID in class AbstractTaskService

internalGetTask

protected Task internalGetTask(TaskID taskID)
Specified by:
internalGetTask in class AbstractTaskService


Copyright © 2004-2005 The Apache Software Foundation. All Rights Reserved.