org.apache.agila.impl.memory
Class TaskServiceImpl

java.lang.Object
  extended by org.apache.agila.services.task.AbstractTaskService
      extended by org.apache.agila.impl.memory.TaskServiceImpl
All Implemented Interfaces:
TaskService

public class TaskServiceImpl
extends AbstractTaskService

Version:
$Id: $
Author:
Geir Magnusson Jr.

Constructor Summary
TaskServiceImpl()
           
 
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 type)
          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 type)
           
protected  void internalSave(Task ti)
          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 oldType, int newType)
          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()
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.

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.


getTasksForInstance

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


setTaskStatusForInstance

public int setTaskStatusForInstance(InstanceID instanceID,
                                    int oldType,
                                    int newType)
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.

oldType - the current status of the tasks
newType - the new status of the tasks
Returns:
the number of rows updated

internalSave

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

Specified by:
internalSave in class AbstractTaskService

internalGetTasksByUserID

protected java.util.List internalGetTasksByUserID(UserID userID,
                                                  int type)
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.