com.plumtree.remote.prc.collaboration.tasklist
Interface ITask

All Superinterfaces:
ICalendarItem

public interface ITask
extends ICalendarItem

Interface that represents a task, the fundamental unit of a task list. It handles creation of sub-tasks, and manages each task's metadata and task dependencies. Each ITask contains the following attributes: start date, end date, risk, status, notes, and assigned users.

Tasks can have 3 level of sub-tasks. For example, you can create a task hierarchy as follows:

  1. Level 0 (parent task) - Task_0, the top level task
  2. Level 1 (first level of sub-task) - Task_01, sub-task of Task_0
  3. Level 2 (second level of sub-task) - Task_012, sub-task of Task_01
  4. Level 3 (third level of sub-task) - Task_0123, sub-task of Task_012

A task’s start date, end date, risk and status will be automatically updated when its sub-tasks are stored.

Tasks can also have dependent tasks. Task dependency is achieved by setting a task to depend on a source task using the addDependentTask method and then calling store on the task.

Any task modifications will not be stored permanently until store is called.


Method Summary
 void addAssignedUser(int userID)
          Assigns a user to the task.
 void addDependentTask(ITask sourceTask)
          Adds this task as a dependent task of the given source task (makes the current task depend on the specified source task).
 ITask createSubTask(java.lang.String name, java.lang.String description, java.util.Date startTime, java.util.Date endTime)
          Creates a sub-task for the current task.
 int[] getAssignedUserIDs()
          Returns the user IDs of users assigned to this task.
 IProject getContainingProject()
          Returns the project that this task belongs to.
 ITaskList getContainingTaskList()
          Returns the ITaskList object that this task belongs to.
 java.util.Date getCreatedDate()
          Returns the task creation date.
 java.lang.String getDescription()
          Returns the task description.
 java.lang.String getDetailsURL()
          Returns the URL at which the task details can be viewed.
 int getID()
          Returns the task ID for this task.
 int getIntStatus()
          Returns the status of a task.
 java.util.Date getLastModifiedDate()
          Returns the task's last modified date.
 int getLevel()
          Returns the level of the task.
 java.lang.String getName()
          Returns the task name.
 java.lang.String getNotes()
          Returns the task notes.
 int getOwnerUserID()
          Returns the user ID of the owner of this task.
 ITask getParentTask()
          Return the parent task, or null if this is a root task.
 TaskRisk getRisk()
          Returns the risk of a task.
 TaskStatus getStatus()
          Returns the status of a task.
 ITask[] getSubTasks()
          Returns an ITask array containing all sub-tasks of the current task.
 ITask[] getTaskDependencies()
          Returns an ITask array of tasks that that this task is dependent on.
 ITask[] getTaskDependents()
          Returns an ITask array of tasks that are dependent on this task.
 boolean hasCreatedDate()
          Returns true if the task's created date is available, otherwise false.
 boolean hasLastModifiedDate()
          Returns true if the task's last modified date is available, otherwise false.
 void removeAssignedUser(int userID)
          Removes an assigned user from the task.
 void removeDependentTask(ITask sourceTask)
          Removes this task as a dependent of another task.
 void setDescription(java.lang.String description)
          Sets the task description.
 void setIntStatus(int intStatus)
          Sets the status of a task.
 void setName(java.lang.String name)
          Sets the task name.
 void setNotes(java.lang.String notes)
          Sets the notes for this task.
 void setRisk(TaskRisk risk)
          Sets the risk of a task.
 void setStatus(TaskStatus status)
          Sets the status of a task.
 void store()
          Stores the task.
 
Methods inherited from interface com.plumtree.remote.prc.collaboration.calendar.ICalendarItem
getEndTime, getStartTime, setEndTime, setStartTime
 

Method Detail

addAssignedUser

public void addAssignedUser(int userID)
Assigns a user to the task.

Parameters:
userID - the user ID; must be positive
Throws:
java.lang.IllegalStateException - if the object has already been removed

addDependentTask

public void addDependentTask(ITask sourceTask)
Adds this task as a dependent task of the given source task (makes the current task depend on the specified source task). The current task must call store to persist the newly-added dependency. If the source task to be added has sub-tasks, the current task cannot add that source task as a dependency, and CollaborationException will be thrown upon calling store.

Parameters:
sourceTask - the source task that the current task depends on; cannot be null
Throws:
java.lang.IllegalStateException - if the object has already been removed

createSubTask

public ITask createSubTask(java.lang.String name,
                           java.lang.String description,
                           java.util.Date startTime,
                           java.util.Date endTime)
                    throws CollaborationException,
                           java.rmi.RemoteException
Creates a sub-task for the current task. The current task must have been stored before creating a sub-task.

If the current task is a dependent source task of other tasks, it cannot have any sub-tasks, and CollaborationException will be thrown.

Note: The value of the start date and end date stored in the database may vary by a few milliseconds from the supplied date. The date in this object will reflect the stored date after a call to store.

Parameters:
name - the name of the sub-task; cannot be null
description - the description of the sub-task; cannot be null
startTime - the start time of the sub-task; cannot be null
endTime - the end time of the sub-task; cannot be null
Returns:
the new sub-task
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed
CollaborationException - if the current task already has task dependency, or if the method call resulted in an error
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

getAssignedUserIDs

public int[] getAssignedUserIDs()
Returns the user IDs of users assigned to this task.

Returns:
an int array of IDs of the users who are assigned to this task
Throws:
java.lang.IllegalStateException - if the object has already been removed

getContainingProject

public IProject getContainingProject()
                              throws CollaborationException,
                                     java.rmi.RemoteException
Returns the project that this task belongs to.

Returns:
the project that this task belongs to.
Throws:
java.lang.IllegalStateException - if the object has already been removed
CollaborationException - if the method call resulted in an error
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

getContainingTaskList

public ITaskList getContainingTaskList()
                                throws CollaborationException,
                                       java.rmi.RemoteException
Returns the ITaskList object that this task belongs to.

Returns:
the task list that this task belongs to
Throws:
java.lang.IllegalStateException - if the object has already been removed
CollaborationException - if the method call resulted in an error
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

getCreatedDate

public java.util.Date getCreatedDate()
Returns the task creation date.

Returns:
the task creation date
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed

getDescription

public java.lang.String getDescription()
Returns the task description.

Returns:
task description.
Throws:
java.lang.IllegalStateException - if the object has already been removed

getDetailsURL

public java.lang.String getDetailsURL()
Returns the URL at which the task details can be viewed.

Note: This URL is gatewayed using the Collaboration server's primary portal.

Returns:
the task details URL
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed

getID

public int getID()
Returns the task ID for this task.

Returns:
the task ID.
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed.

getIntStatus

public int getIntStatus()
Returns the status of a task.

Returns:
the status of a task
Throws:
java.lang.IllegalStateException - if the object has already been removed

getLastModifiedDate

public java.util.Date getLastModifiedDate()
Returns the task's last modified date. The last modified date of a task will also get updated whenever a new sub-task is created.

Returns:
the task last modified date
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed

getLevel

public int getLevel()
Returns the level of the task. The maximum level is 4 deep (0-3).

Returns:
the level of the task (0-3)
Throws:
java.lang.IllegalStateException - if the object has already been removed

getName

public java.lang.String getName()
Returns the task name.

Returns:
the task name.
Throws:
java.lang.IllegalStateException - if the object has already been removed

getNotes

public java.lang.String getNotes()
Returns the task notes.

Returns:
the task notes
Throws:
java.lang.IllegalStateException - if the object has already been removed

getOwnerUserID

public int getOwnerUserID()
Returns the user ID of the owner of this task. The owner of a task is the user who creates it.

Returns:
the owner user ID
Throws:
java.lang.IllegalStateException - if the object has already been removed

getParentTask

public ITask getParentTask()
                    throws CollaborationException,
                           java.rmi.RemoteException
Return the parent task, or null if this is a root task.

Returns:
the parent task, or null if this is a root task
Throws:
java.lang.IllegalStateException - if the object has already been removed
CollaborationException - if the method call resulted in an error
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

getRisk

public TaskRisk getRisk()
Returns the risk of a task.

Returns:
the risk of a task
Throws:
java.lang.IllegalStateException - if the object has already been removed

getStatus

public TaskStatus getStatus()
                     throws CollaborationException
Returns the status of a task.

Returns:
the status of a task
Throws:
CollaborationException - if the numeric status is not of any TaskStatus enum value
java.lang.IllegalStateException - if the object has already been removed

getSubTasks

public ITask[] getSubTasks()
Returns an ITask array containing all sub-tasks of the current task. If the current task does not have any sub-tasks, the array will have 0 elements.

Returns:
an ITask array containing all sub-tasks of the current task
Throws:
java.lang.IllegalStateException - if the object has already been removed

getTaskDependencies

public ITask[] getTaskDependencies()
                            throws CollaborationException,
                                   java.rmi.RemoteException
Returns an ITask array of tasks that that this task is dependent on. If this task does not depend on any other tasks, the array will have 0 elements.

Returns:
an ITask array of tasks that that this task is dependant on
Throws:
java.lang.IllegalStateException - if the object has already been removed
CollaborationException - if the method call resulted in an error
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

getTaskDependents

public ITask[] getTaskDependents()
                          throws CollaborationException,
                                 java.rmi.RemoteException
Returns an ITask array of tasks that are dependent on this task. If no other tasks depend on the this task, a zero-length array will be returned.

Returns:
an array of ITask that are dependent on this task.
Throws:
java.lang.IllegalStateException - if the object has already been removed
CollaborationException - if the method call resulted in an error
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

hasCreatedDate

public boolean hasCreatedDate()
Returns true if the task's created date is available, otherwise false.

Returns:
true if created date is available, else false
Throws:
java.lang.IllegalStateException - if the object has already been removed

hasLastModifiedDate

public boolean hasLastModifiedDate()
Returns true if the task's last modified date is available, otherwise false.

Returns:
true if last modified date is available, else false
Throws:
java.lang.IllegalStateException - if the object has already been removed

removeAssignedUser

public void removeAssignedUser(int userID)
Removes an assigned user from the task. If the user with the given ID does not exist, the call will be ignored.

Parameters:
userID - the user id; must be positive
Throws:
java.lang.IllegalStateException - if the object has already been removed

removeDependentTask

public void removeDependentTask(ITask sourceTask)
Removes this task as a dependent of another task.

Parameters:
sourceTask - the source task that the current task depends on; cannot be null
Throws:
java.lang.IllegalStateException - if the object has already been removed

setDescription

public void setDescription(java.lang.String description)
Sets the task description.

Parameters:
description - the description.
Throws:
java.lang.IllegalStateException - if the object has already been removed

setIntStatus

public void setIntStatus(int intStatus)
Sets the status of a task.

Throws:
java.lang.IllegalStateException - if the object has already been removed
java.lang.IllegalArgumentException - if the numeric status value is not of the range 0 - 100.

setName

public void setName(java.lang.String name)
Sets the task name.

Parameters:
name - the task name.
Throws:
java.lang.IllegalStateException - if the object has already been removed

setNotes

public void setNotes(java.lang.String notes)
Sets the notes for this task.

Parameters:
notes - the notes to set
Throws:
java.lang.IllegalStateException - if the object has already been removed

setRisk

public void setRisk(TaskRisk risk)
Sets the risk of a task.

Parameters:
risk - the risk of the task
Throws:
java.lang.IllegalStateException - if the object has already been removed

setStatus

public void setStatus(TaskStatus status)
Sets the status of a task.

Parameters:
status - the status of the task
Throws:
java.lang.IllegalStateException - if the object has already been removed

store

public void store()
           throws CollaborationException,
                  java.rmi.RemoteException
Stores the task. Can be used to persist a newly created task or edit an existing task. All task modifications will not be stored permanently until this method is called.

Throws:
CollaborationException - if the method call resulted in an error
java.lang.IllegalStateException - if the object has already been removed
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call


For additional information on the Oracle® WebCenter Interaction Development Kit, including tutorials, blogs, code samples and more, see the Oracle Technology Network (http://www.oracle.com/technology/index.html).

Copyright ©2010 Oracle® Corporation. All Rights Reserved.