com.starbase.starteam
Class Task

java.lang.Object
  |
  +--com.starbase.starteam.CacheRef
        |
        +--com.starbase.starteam.NamedCacheRef
              |
              +--com.starbase.starteam.TypedResource
                    |
                    +--com.starbase.starteam.SimpleTypedResource
                          |
                          +--com.starbase.starteam.Item
                                |
                                +--com.starbase.starteam.TreeItem
                                      |
                                      +--com.starbase.starteam.Task
All Implemented Interfaces:
java.lang.Cloneable, ISecurable, ISecurableObject

public class Task
extends TreeItem

Represents a StarTeam Task item.


Nested Class Summary
 
Nested classes inherited from class com.starbase.starteam.Item
Item.LockType
 
Constructor Summary
Task(Folder parentFolder)
          Creates a new task in the specified folder.
Task(Task parentTask)
          Creates a new task that is a subtask of an existing task.
 
Method Summary
 void addPredecessorLink(int predecessorID, int lagTime, int depType)
          Adds a new predecessor to this task.
 void addResource(int userID)
          Adds the specified user ID as a resource for this Task.
 void addWorkRecord(WorkRecord record)
          Deprecated. Use createWorkRecord instead
 WorkRecord createWorkRecord(User user)
          Creates a new WorkRecord for the specified Task and user.
 void discard()
          This will discard all cached data associated with this task including changes made but not yet saved.
 boolean equals(java.lang.Object source)
          returns true if this object instance is equal to the source
 OLEDate getActualFinish()
          Returns the actual finish date of this task.
 double getActualHours()
          Returns the actual number of hours spent on this task.
 OLEDate getActualStart()
          Returns the actual start date of this task.
 java.lang.String getAttentionNotes()
          Returns the text in the "Needs Attention" note for this task.
 int getChildrenCount()
          Returns the number of tasks that are subtasks of this one.
 OLEDate getConstraintDate()
          Returns the task's Constraint Date from MS Project.
 int getConstraintType()
          Returns the MS Project Constraint Type of this task.
 java.lang.String getConstraintTypeDisplayName(int value)
          Returns a user-friendly display name for the given ConstraintType value.
 OLEDate getDependencyLastUpdate()
          Returns the date that a work record or task dependency (predecessor or successor) was last added to this task.
 double getDuration()
          Returns the number of hours during which at least one user is working on this task.
 OLEDate getEstimatedFinish()
          Returns the estimated date at which this task will be completed.
 int getEstimatedFinishVariance()
          Returns the Estimated Finish Variance of this task.
 double getEstimatedHours()
          Returns an estimate of the number of hours that will be spent completing this task.
 double getEstimatedHoursVariance()
          Returns the Estimated Hours Variance of this task.
 OLEDate getEstimatedStart()
          Returns the estimated start date of this task.
 int getEstimatedStartVariance()
          Returns the Estimated Start Variance of this task.
 java.lang.String getGUID()
          Returns the MS Project GUID of this task.
 int getIsMyTask()
          Returns a value indicating whether the logged on user is responsible for this task.
 java.lang.String getIsMyTaskDisplayName(int value)
          Returns a user-friendly display name for the given IsMyTask value.
 int getMilestone()
          Returns a value indicating whether or not this task represents a milestone.
 java.lang.String getMilestoneDisplayName(int value)
          Returns a user-friendly display name for the given Milestone value.
 java.lang.String getMSProjectFileName()
          Returns the MS Project FileName of this task.
 OLEDate getMSProjectLastUpdate()
          Returns the date that this task was last updated from MS Project.
 java.lang.String getName()
          Returns the Name of this task.
 int getNeedsAttention()
          Returns a value that indicates whether or not this task needs attention.
 java.lang.String getNeedsAttentionDisplayName(int value)
          Returns a user-friendly display name for the given NeedsAttention value.
 java.lang.String getNotes()
          Returns the text in the "Notes" for this task.
 int getNumber()
          Returns the number assigned to this task.
 int getOrigin()
          Returns a value indicating the origin (e.g., StarTeam or MS Project) of this task.
 java.lang.String getOriginDisplayName(int value)
          Returns a user-friendly display name for the given Origin value.
 int getParentID()
          Returns the ObjectID of this task's parent task.
 int getPercentComplete()
          Returns a percentage indicating how much of the task has been completed.
 int[] getPossibleConstraintType()
          Returns the possible enum codes that are valid values for the ConstraintType property.
 int[] getPossibleIsMyTask()
          Returns the possible enum codes that are valid values for the IsMyTask property.
 int[] getPossibleMilestone()
          Returns the possible enum codes that are valid values for the Milestone property.
 int[] getPossibleNeedsAttention()
          Returns the possible enum codes that are valid values for the NeedsAttention property.
 int[] getPossibleOrigin()
          Returns the possible enum codes that are valid values for the Origin property.
 int[] getPossiblePriority()
          Returns the possible enum codes that are valid values for the Priority property.
 int[] getPossibleStatus()
          Returns the possible enum codes that are valid values for the Status property.
 int[] getPossibleTaskType()
          Returns the possible enum codes that are valid values for the TaskType property.
 TaskDependency[] getPredecessorLinks()
          Returns the predecessor tasks to this this task.
 int getPriority()
          Returns the Priority of this task.
 java.lang.String getPriorityDisplayName(int value)
          Returns a user-friendly display name for the given Priority value.
 int getResourceCount()
          Returns the number of resources assigned to this task.
 java.lang.String[] getResourceNames()
          Returns the names of the users assigned as resources of this task.
 int[] getResources()
          Returns the IDs of the users assigned as resources of this task.
 int getResponsibility()
          Returns the user ID of the user who is responsibile for this task.
 int getStatus()
          Returns the Status of this task.
 java.lang.String getStatusDisplayName(int value)
          Returns a user-friendly display name for the given Status value.
 TaskDependency[] getSuccessorLinks()
          Returns the successor tasks to this this task.
 int getTaskType()
          Returns the task's type in MS Project.
 java.lang.String getTaskTypeDisplayName(int value)
          Returns a user-friendly display name for the given TaskType value.
 int getUniqueID()
          Returns the MS Project UniqueID of this task.
 ProcessItemUsage getUsage()
          Gets the usage of this task.
 java.lang.String getWBSCode()
          Returns the MS Project WBS Code of this task.
 int getWorkRecordCount()
          Returns the number of work records that have been added to this task.
 WorkRecord[] getWorkRecords()
          Returns the work records associates with this task.
 int hashCode()
          returns a unique hash for all instances of this type
 boolean isDirty()
          Returns true if this task has been modified and is need of updating.
 boolean isProcessTask()
          Determines whether or not this task is a process task.
 boolean isReplicated()
          Returns true if this task is replicated in MS Project.
 java.lang.Object put(java.lang.String propertyName, java.lang.Object value)
          Sets the value of the specified property and return the old value.
 void removeDependency(TaskDependency dependency)
          Removed the specified task dependency from this task.
 void removeResource(int userID)
          Removes the specified user ID as a resource from this task.
 void removeWorkRecord(WorkRecord record)
          Removes the work record from this task.
 void setAttentionNotes(java.lang.String AttentionNotes)
          Sets the text in the "Needs Attention" note for this task.
 void setDuration(double Duration)
          Sets the number of hours during which at least one user is working on this task.
 void setEstimatedFinish(OLEDate EstimatedFinish)
          Sets the estimated date at which this task will be completed.
 void setEstimatedStart(OLEDate EstimatedStart)
          Sets the estimated start date of this task.
 void setMilestone(int Milestone)
          Sets the value indicating whether or not this task represents a milestone.
 void setName(java.lang.String Name)
          Sets the Name of this task.
 void setNeedsAttention(int NeedsAttention)
          Sets the value that indicates whether or not this task needs attention.
 void setNotes(java.lang.String Notes)
          Sets the text in the "Notes" for this task.
 void setOrigin(int origin)
          Sets the value indicating the origin (e.g., StarTeam or MS Project) of this task.
 void setPercentComplete(int PercentComplete)
          Sets the percentage indicating how much of the task has been completed.
 void setPriority(int Priority)
          Sets the Priority of this task.
 void setReplicated(boolean replicated)
          Sets whether or not this task is replicated in MS Project.
 void setResponsibility(int userID)
          Sets the user ID of the user who is responsibile for this task.
 void setStatus(int Status)
          Sets the Status of this task.
 void setUsage(ProcessItemUsage usage)
          Sets the task usage.
 void update()
          Either stores this task in the server repository if the task is new or modifies an existing task.
 
Methods inherited from class com.starbase.starteam.TreeItem
createChild, move, moveTo, moveTo, remove, shareTo
 
Methods inherited from class com.starbase.starteam.Item
acquireOwnership, addAttachment, copy, createAttachment, createAttachmentFromFile, createItem, deleteMergePoint, get, getACL, getAllLabels, getAttachedLabels, getAttachment, getAttachmentIDs, getAttachmentNames, getAttachmentToFile, getBehavior, getBranchRevisionFromDotNotation, getByProperty, getByPropertyID, getByteArray, getCachedProperties, getComment, getCommonAncestor, getCreatedBy, getCreatedTime, getDeletedTime, getDeletedUserID, getDisplayValue, getDotNotation, getDouble, getEnumDisplayName, getFlag, getFlagDisplayName, getFromHistoryByDate, getFromHistoryByLabelID, getFromHistoryByVersion, getHistory, getID, getInt, getIntArray, getItemID, getItemRevisions, getLocker, getMergeHistory, getModifiedBy, getModifiedTime, getMyLock, getNewRevisionComment, getObjectID, getOLEDate, getOwner, getParentContainer, getParentFolder, getParentFolderHierarchy, getParentFolderName, getParentFolderPath, getParentFolderQualifiedName, getParentRevision, getPossibleFlag, getPossibleReadStatus, getPossibleValues, getPropertyNames, getReadStatus, getReadStatusDisplayName, getReference, getReferences, getRevisionNumber, getRootObjectID, getServer, getString, getType, getTypeNames, getView, getViewVersion, getViewVersionFromDotNotation, hasPermission, hasValues, isBranchable, isDeleted, isDisembodied, isEqualTo, isFromHistory, isNew, isRefreshRequired, isRefreshRequired, isReverseShareRecommended, isRootShare, lock, modifyFlagForUser, modifyReadStatusForUser, populate, populate, putByPropertyID, putLock, recordMergePoint, refresh, refresh, removeAttachment, resolveMergePoint, reverseShareTo, setACL, setBehavior, setBranchOnChange, setComment, setFixedConfig, setFloatingConfig, smartShareTo, toDebugString, toString, unlock, updateRevisionComment
 
Methods inherited from class com.starbase.starteam.TypedResource
addToIntArray, removeFromIntArray
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Task

public Task(Folder parentFolder)
Creates a new task in the specified folder.

Parameters:
parentFolder - The folder to which this new task will be added.

Task

public Task(Task parentTask)
Creates a new task that is a subtask of an existing task.

Parameters:
parentTask - The parent task.
Method Detail

put

public java.lang.Object put(java.lang.String propertyName,
                            java.lang.Object value)
                     throws NoSuchPropertyException,
                            java.lang.ClassCastException
Sets the value of the specified property and return the old value.

Overrides:
put in class Item
Parameters:
propertyName - the name of the property to set
value - the new value to set for the specified property
Returns:
the old property value
Throws:
NoSuchPropertyException - if the named property does not exist
java.lang.ClassCastException - if the value is of the wrong type for the specified property

getEstimatedHoursVariance

public double getEstimatedHoursVariance()
Returns the Estimated Hours Variance of this task.

Returns:
The Estimated Hours Variance of this task.
See Also:
PropertyNames.TASK_ESTIMATED_HOURS_VARIANCE

getEstimatedStartVariance

public int getEstimatedStartVariance()
Returns the Estimated Start Variance of this task.

Returns:
The Estimated Start Variance of this task.
See Also:
PropertyNames.TASK_ESTIMATED_START_VARIANCE

getEstimatedFinishVariance

public int getEstimatedFinishVariance()
Returns the Estimated Finish Variance of this task.

Returns:
The Estimated Finish Variance of this task.
See Also:
PropertyNames.TASK_ESTIMATED_FINISH_VARIANCE

getParentID

public int getParentID()
Returns the ObjectID of this task's parent task. Returns -1 if this task has no parent.

Overrides:
getParentID in class TreeItem
Returns:
The ObjectID of this task's parent task. Returns -1 if this task has no parent.
See Also:
PropertyNames.TASK_PARENT_ID

getDuration

public double getDuration()
Returns the number of hours during which at least one user is working on this task.

Returns:
The number of hours during which at least one user is working on this task.
See Also:
PropertyNames.TASK_DURATION

setDuration

public void setDuration(double Duration)
Sets the number of hours during which at least one user is working on this task.

Parameters:
Duration - The number of hours during which at least one user is working on this task.

getNumber

public int getNumber()
Returns the number assigned to this task.

Returns:
The number assigned to this task.
See Also:
PropertyNames.TASK_NUMBER

getNeedsAttention

public int getNeedsAttention()
Returns a value that indicates whether or not this task needs attention.

Returns:
A value that indicates whether or not this task needs attention.
See Also:
Task.getPossibleNeedsAttention(), Task.getNeedsAttentionDisplayName(int), PropertyNames.TASK_NEEDS_ATTENTION

setNeedsAttention

public void setNeedsAttention(int NeedsAttention)
Sets the value that indicates whether or not this task needs attention.

Parameters:
NeedsAttention - The new value that indicates whether or not this task needs attention.

getPossibleNeedsAttention

public int[] getPossibleNeedsAttention()
Returns the possible enum codes that are valid values for the NeedsAttention property. This is really a convenience method for accessing Property.getEnumValues for this property.

Returns:
The possible values for the NeedsAttention property.
See Also:
Task.getNeedsAttention(), Task.getNeedsAttentionDisplayName(int), TypedResource.getPossibleValues(java.lang.String), PropertyNames.TASK_NEEDS_ATTENTION

getNeedsAttentionDisplayName

public java.lang.String getNeedsAttentionDisplayName(int value)
Returns a user-friendly display name for the given NeedsAttention value. This is really a convenience method for accessing TypedResource.getEnumDisplayName for this property.

Parameters:
value - The NeedsAttention value to be converted to a display name.
Returns:
A user-friendly display name for the given NeedsAttention value.
See Also:
Task.getNeedsAttention(), Task.getPossibleNeedsAttention(), TypedResource.getEnumDisplayName(java.lang.String, int), PropertyNames.TASK_NEEDS_ATTENTION

getName

public java.lang.String getName()
Returns the Name of this task.

Returns:
The Name of this task.
See Also:
PropertyNames.TASK_NAME

setName

public void setName(java.lang.String Name)
Sets the Name of this task.

Parameters:
Name - The new Name for this task.

getAttentionNotes

public java.lang.String getAttentionNotes()
Returns the text in the "Needs Attention" note for this task.

Returns:
The text in the "Needs Attention" note for this task.
See Also:
PropertyNames.TASK_ATTENTION_NOTES

setAttentionNotes

public void setAttentionNotes(java.lang.String AttentionNotes)
Sets the text in the "Needs Attention" note for this task.

Parameters:
AttentionNotes - The text in the "Needs Attention" note for this task.

getNotes

public java.lang.String getNotes()
Returns the text in the "Notes" for this task.

Returns:
The text in the "Notes" for this task.
See Also:
PropertyNames.TASK_NOTES

setNotes

public void setNotes(java.lang.String Notes)
Sets the text in the "Notes" for this task.

Parameters:
Notes - The new Notes text for this task.

getPercentComplete

public int getPercentComplete()
Returns a percentage indicating how much of the task has been completed.

Returns:
A percentage indicating how much of the task has been completed.
See Also:
PropertyNames.TASK_PERCENT_COMPLETE

setPercentComplete

public void setPercentComplete(int PercentComplete)
Sets the percentage indicating how much of the task has been completed.

Parameters:
PercentComplete - The new percentage indicating how much of the task has been completed.

getMilestone

public int getMilestone()
Returns a value indicating whether or not this task represents a milestone.

Returns:
A value indicating whether or not this task represents a milestone.
See Also:
Task.getPossibleMilestone(), Task.getMilestoneDisplayName(int), PropertyNames.TASK_MILESTONE

setMilestone

public void setMilestone(int Milestone)
Sets the value indicating whether or not this task represents a milestone.

Parameters:
Milestone - The new value indicating whether or not this task represents a milestone.

getPossibleMilestone

public int[] getPossibleMilestone()
Returns the possible enum codes that are valid values for the Milestone property. This is really a convenience method for accessing Property.getEnumValues for this property.

Returns:
The possible values for the Milestone property.
See Also:
Task.getMilestone(), Task.getMilestoneDisplayName(int), TypedResource.getPossibleValues(java.lang.String), PropertyNames.TASK_MILESTONE

getMilestoneDisplayName

public java.lang.String getMilestoneDisplayName(int value)
Returns a user-friendly display name for the given Milestone value. This is really a convenience method for accessing TypedResource.getEnumDisplayName for this property.

Parameters:
value - The Milestone value to be converted to a display name.
Returns:
A user-friendly display name for the given Milestone value.
See Also:
Task.getMilestone(), Task.getPossibleMilestone(), TypedResource.getEnumDisplayName(java.lang.String, int), PropertyNames.TASK_MILESTONE

getTaskType

public int getTaskType()
Returns the task's type in MS Project.

Returns:
The task's type in MS Project.
See Also:
Task.getPossibleTaskType(), Task.getTaskTypeDisplayName(int), PropertyNames.TASK_TYPE

getPossibleTaskType

public int[] getPossibleTaskType()
Returns the possible enum codes that are valid values for the TaskType property. This is really a convenience method for accessing Property.getEnumValues for this property.

Returns:
The possible values for the TaskType property.
See Also:
Task.getTaskType(), Task.getTaskTypeDisplayName(int), TypedResource.getPossibleValues(java.lang.String), PropertyNames.TASK_TYPE

getTaskTypeDisplayName

public java.lang.String getTaskTypeDisplayName(int value)
Returns a user-friendly display name for the given TaskType value. This is really a convenience method for accessing TypedResource.getEnumDisplayName for this property.

Parameters:
value - The TaskType value to be converted to a display name.
Returns:
A user-friendly display name for the given TaskType value.
See Also:
Task.getTaskType(), Task.getPossibleTaskType(), TypedResource.getEnumDisplayName(java.lang.String, int), PropertyNames.TASK_TYPE

getPriority

public int getPriority()
Returns the Priority of this task.

Returns:
The Priority of this task.
See Also:
Task.getPossiblePriority(), Task.getPriorityDisplayName(int), PropertyNames.TASK_PRIORITY

setPriority

public void setPriority(int Priority)
Sets the Priority of this task.

Parameters:
Priority - The new Priority for this task.

getPossiblePriority

public int[] getPossiblePriority()
Returns the possible enum codes that are valid values for the Priority property. This is really a convenience method for accessing Property.getEnumValues for this property.

Returns:
The possible values for the Priority property.
See Also:
Task.getPriority(), Task.getPriorityDisplayName(int), TypedResource.getPossibleValues(java.lang.String), PropertyNames.TASK_PRIORITY

getPriorityDisplayName

public java.lang.String getPriorityDisplayName(int value)
Returns a user-friendly display name for the given Priority value. This is really a convenience method for accessing TypedResource.getEnumDisplayName for this property.

Parameters:
value - The Priority value to be converted to a display name.
Returns:
A user-friendly display name for the given Priority value.
See Also:
Task.getPriority(), Task.getPossiblePriority(), TypedResource.getEnumDisplayName(java.lang.String, int), PropertyNames.TASK_PRIORITY

getConstraintType

public int getConstraintType()
Returns the MS Project Constraint Type of this task.

Returns:
The MS Project Constraint Type of this task.
See Also:
Task.getPossibleConstraintType(), Task.getConstraintTypeDisplayName(int), PropertyNames.TASK_CONSTRAINT_TYPE

getPossibleConstraintType

public int[] getPossibleConstraintType()
Returns the possible enum codes that are valid values for the ConstraintType property. This is really a convenience method for accessing Property.getEnumValues for this property.

Returns:
The possible values for the ConstraintType property.
See Also:
Task.getConstraintType(), Task.getConstraintTypeDisplayName(int), TypedResource.getPossibleValues(java.lang.String), PropertyNames.TASK_CONSTRAINT_TYPE

getConstraintTypeDisplayName

public java.lang.String getConstraintTypeDisplayName(int value)
Returns a user-friendly display name for the given ConstraintType value. This is really a convenience method for accessing TypedResource.getEnumDisplayName for this property.

Parameters:
value - The ConstraintType value to be converted to a display name.
Returns:
A user-friendly display name for the given ConstraintType value.
See Also:
Task.getConstraintType(), Task.getPossibleConstraintType(), TypedResource.getEnumDisplayName(java.lang.String, int), PropertyNames.TASK_CONSTRAINT_TYPE

getConstraintDate

public OLEDate getConstraintDate()
Returns the task's Constraint Date from MS Project.

Returns:
The task's Constraint Date from MS Project.
See Also:
PropertyNames.TASK_CONSTRAINT_DATE

getResponsibility

public int getResponsibility()
Returns the user ID of the user who is responsibile for this task.

Returns:
The user ID of the user who is responsibile for this task.
See Also:
PropertyNames.TASK_RESPONSIBILITY

setResponsibility

public void setResponsibility(int userID)
Sets the user ID of the user who is responsibile for this task.

Parameters:
userID - The user ID of the user who is responsibile for this task.

getGUID

public java.lang.String getGUID()
Returns the MS Project GUID of this task.

Returns:
The MS Project GUID of this task.
See Also:
PropertyNames.TASK_GUID

getEstimatedHours

public double getEstimatedHours()
Returns an estimate of the number of hours that will be spent completing this task.

Returns:
An estimate of the number of hours that will be spent completing this task.
See Also:
PropertyNames.TASK_ESTIMATED_HOURS

getUniqueID

public int getUniqueID()
Returns the MS Project UniqueID of this task.

Returns:
The MS Project UniqueID of this task.
See Also:
PropertyNames.TASK_UNIQUE_ID

getEstimatedStart

public OLEDate getEstimatedStart()
Returns the estimated start date of this task.

Returns:
The estimated start date of this task.
See Also:
PropertyNames.TASK_ESTIMATED_START

setEstimatedStart

public void setEstimatedStart(OLEDate EstimatedStart)
Sets the estimated start date of this task.

Parameters:
EstimatedStart - The new estimated start date of this task.

getWBSCode

public java.lang.String getWBSCode()
Returns the MS Project WBS Code of this task.

Returns:
The MS Project WBS Code of this task.
See Also:
PropertyNames.TASK_WBS_CODE

getEstimatedFinish

public OLEDate getEstimatedFinish()
Returns the estimated date at which this task will be completed.

Returns:
The estimated date at which this task will be completed.
See Also:
PropertyNames.TASK_ESTIMATED_FINISH

setEstimatedFinish

public void setEstimatedFinish(OLEDate EstimatedFinish)
Sets the estimated date at which this task will be completed.

Parameters:
EstimatedFinish - The new estimated date at which this task will be completed.

getMSProjectFileName

public java.lang.String getMSProjectFileName()
Returns the MS Project FileName of this task.

Returns:
The MS Project FileName of this task.
See Also:
PropertyNames.TASK_MSPROJECT_FILENAME

getActualHours

public double getActualHours()
Returns the actual number of hours spent on this task.

Returns:
The actual number of hours spent on this task.
See Also:
PropertyNames.TASK_ACTUAL_HOURS

getMSProjectLastUpdate

public OLEDate getMSProjectLastUpdate()
Returns the date that this task was last updated from MS Project.

Returns:
The date that this task was last updated from MS Project.
See Also:
PropertyNames.TASK_MSPROJECT_LAST_UPDATE

getActualStart

public OLEDate getActualStart()
Returns the actual start date of this task.

Returns:
The actual start date of this task.
See Also:
PropertyNames.TASK_ACTUAL_START

getActualFinish

public OLEDate getActualFinish()
Returns the actual finish date of this task.

Returns:
The actual finish date of this task.
See Also:
PropertyNames.TASK_ACTUAL_FINISH

getResourceCount

public int getResourceCount()
Returns the number of resources assigned to this task.

Returns:
The number of resources assigned to this task.
See Also:
PropertyNames.TASK_RESOURCE_COUNT

getResources

public int[] getResources()
Returns the IDs of the users assigned as resources of this task.

Returns:
The IDs of the users assigned as resources of this task.
See Also:
PropertyNames.TASK_RESOURCE_IDS

getChildrenCount

public int getChildrenCount()
Returns the number of tasks that are subtasks of this one.

Returns:
The number of tasks that are subtasks of this one.
Throws:
DisembodiedItemException - if the Task is disembodied
See Also:
Item.isDisembodied(), PropertyNames.TASK_CHILDREN_COUNT

getWorkRecordCount

public int getWorkRecordCount()
Returns the number of work records that have been added to this task.

Returns:
The number of work records that have been added to this task.
See Also:
PropertyNames.TASK_WORKRECORD_COUNT

getResourceNames

public java.lang.String[] getResourceNames()
Returns the names of the users assigned as resources of this task.

Returns:
The names of the users assigned as resources of this task.
See Also:
PropertyNames.TASK_RESOURCE_NAMES

getIsMyTask

public int getIsMyTask()
Returns a value indicating whether the logged on user is responsible for this task.

Returns:
A value indicating whether the logged on user is responsible for this task.
See Also:
Task.getPossibleIsMyTask(), Task.getIsMyTaskDisplayName(int), PropertyNames.TASK_IS_MY_TASK

getPossibleIsMyTask

public int[] getPossibleIsMyTask()
Returns the possible enum codes that are valid values for the IsMyTask property. This is really a convenience method for accessing Property.getEnumValues for this property.

Returns:
The possible values for the IsMyTask property.
See Also:
Task.getIsMyTask(), Task.getIsMyTaskDisplayName(int), TypedResource.getPossibleValues(java.lang.String), PropertyNames.TASK_IS_MY_TASK

getIsMyTaskDisplayName

public java.lang.String getIsMyTaskDisplayName(int value)
Returns a user-friendly display name for the given IsMyTask value. This is really a convenience method for accessing TypedResource.getEnumDisplayName for this property.

Parameters:
value - The IsMyTask value to be converted to a display name.
Returns:
A user-friendly display name for the given IsMyTask value.
See Also:
Task.getIsMyTask(), Task.getPossibleIsMyTask(), TypedResource.getEnumDisplayName(java.lang.String, int), PropertyNames.TASK_IS_MY_TASK

getOrigin

public int getOrigin()
Returns a value indicating the origin (e.g., StarTeam or MS Project) of this task.

Returns:
A value indicating the origin (e.g., StarTeam or MS Project) of this task.
See Also:
Task.getPossibleOrigin(), Task.getOriginDisplayName(int), PropertyNames.TASK_ORIGIN

setOrigin

public void setOrigin(int origin)
Sets the value indicating the origin (e.g., StarTeam or MS Project) of this task.

See Also:
Task.getPossibleOrigin(), Task.getOrigin(), PropertyNames.TASK_ORIGIN

getPossibleOrigin

public int[] getPossibleOrigin()
Returns the possible enum codes that are valid values for the Origin property. This is really a convenience method for accessing Property.getEnumValues for this property.

Returns:
The possible values for the Origin property.
See Also:
Task.getOrigin(), Task.getOriginDisplayName(int), TypedResource.getPossibleValues(java.lang.String), PropertyNames.TASK_ORIGIN

getOriginDisplayName

public java.lang.String getOriginDisplayName(int value)
Returns a user-friendly display name for the given Origin value. This is really a convenience method for accessing TypedResource.getEnumDisplayName for this property.

Parameters:
value - The Origin value to be converted to a display name.
Returns:
A user-friendly display name for the given Origin value.
See Also:
Task.getOrigin(), Task.getPossibleOrigin(), TypedResource.getEnumDisplayName(java.lang.String, int), PropertyNames.TASK_ORIGIN

getStatus

public int getStatus()
Returns the Status of this task.

Returns:
The Status of this task.
See Also:
Task.getPossibleStatus(), Task.getStatusDisplayName(int), PropertyNames.TASK_STATUS

setStatus

public void setStatus(int Status)
Sets the Status of this task.

Parameters:
Status - the new Status for this task.

getPossibleStatus

public int[] getPossibleStatus()
Returns the possible enum codes that are valid values for the Status property. This is really a convenience method for accessing Property.getEnumValues for this property.

Returns:
The possible values for the Status property.
See Also:
Task.getStatus(), Task.getStatusDisplayName(int), TypedResource.getPossibleValues(java.lang.String), PropertyNames.TASK_STATUS

getStatusDisplayName

public java.lang.String getStatusDisplayName(int value)
Returns a user-friendly display name for the given Status value. This is really a convenience method for accessing TypedResource.getEnumDisplayName for this property.

Parameters:
value - The Status value to be converted to a display name.
Returns:
A user-friendly display name for the given Status value.
See Also:
Task.getStatus(), Task.getPossibleStatus(), TypedResource.getEnumDisplayName(java.lang.String, int), PropertyNames.TASK_STATUS

getDependencyLastUpdate

public OLEDate getDependencyLastUpdate()
Returns the date that a work record or task dependency (predecessor or successor) was last added to this task.

Returns:
The date that a work record or task dependency (predecessor or successor) was last added to this task.
See Also:
PropertyNames.TASK_WORK_DEPENDENCY_LAST_UPDATE

getWorkRecords

public WorkRecord[] getWorkRecords()
Returns the work records associates with this task.

Returns:
The work records associates with this task.

createWorkRecord

public WorkRecord createWorkRecord(User user)
Creates a new WorkRecord for the specified Task and user.

Parameters:
user - the the user that performs the work

addWorkRecord

public void addWorkRecord(WorkRecord record)
Deprecated. Use createWorkRecord instead

Adds a work record to this task.

Parameters:
record - the work record to be added
See Also:
Task.createWorkRecord(com.starbase.starteam.User)

removeWorkRecord

public void removeWorkRecord(WorkRecord record)
Removes the work record from this task. The work record must already be associated with this task or an exception will be thrown.

Parameters:
record - the work record to be removed.

getPredecessorLinks

public TaskDependency[] getPredecessorLinks()
Returns the predecessor tasks to this this task. The predecessors are represented by a TaskDependency object.

Returns:
The predecessor tasks to this this task.

addPredecessorLink

public void addPredecessorLink(int predecessorID,
                               int lagTime,
                               int depType)
Adds a new predecessor to this task.

Parameters:
predecessorID - the task id of the predecessor task
lagTime - the lag time for this dependency
depType - the dependency type.
See Also:
PropertyNames.TASKDEPENDENCY_TYPE

removeDependency

public void removeDependency(TaskDependency dependency)
Removed the specified task dependency from this task. The dependency must be either a successor or predecessor to this task or an exception will be thrown.

Parameters:
dependency - the task depenency to remove

getSuccessorLinks

public TaskDependency[] getSuccessorLinks()
Returns the successor tasks to this this task. The successors are represented by a TaskDependency object.

Returns:
The successor tasks to this this task.

addResource

public void addResource(int userID)
Adds the specified user ID as a resource for this Task.

Parameters:
userID - the user ID to add as a resource for this task,

removeResource

public void removeResource(int userID)
Removes the specified user ID as a resource from this task.

Parameters:
userID - the user ID resource to remove from this task.

update

public void update()
Either stores this task in the server repository if the task is new or modifies an existing task.

Overrides:
update in class Item
See Also:
Item.isNew()

discard

public void discard()
This will discard all cached data associated with this task including changes made but not yet saved.

Overrides:
discard in class Item
See Also:
Item.refresh()

isDirty

public boolean isDirty()
Returns true if this task has been modified and is need of updating.

Overrides:
isDirty in class Item
Returns:
true if this task has been modified and is need of updating.
See Also:
Task.update()

isReplicated

public boolean isReplicated()
Returns true if this task is replicated in MS Project.

Returns:
true if this task is replicated in MS Project.
See Also:
Task.getOrigin(), PropertyNames.TASK_IS_REPLICATED

setReplicated

public void setReplicated(boolean replicated)
Sets whether or not this task is replicated in MS Project.

Parameters:
replicated - true if the task should be marked as replicated in MS project
See Also:
Task.getOrigin(), Task.setOrigin(int), PropertyNames.TASK_IS_REPLICATED

equals

public boolean equals(java.lang.Object source)
returns true if this object instance is equal to the source

Overrides:
equals in class Item
Parameters:
source - Object the source to comapre with
Returns:
boolean true if this object is equal to the source

hashCode

public int hashCode()
returns a unique hash for all instances of this type

Overrides:
hashCode in class Item
Returns:
int a unique hash for all instances of this type

setUsage

public void setUsage(ProcessItemUsage usage)
Sets the task usage. The usage determines whether or not this is a process task and, if so, the type of operation that created the task and its process links.

Internally, how the usage is stored depends on the StarTeam server version number. StarTeam server versions 9.5 and later have a system-defined TASK_USAGE property. Earlier servers may have a functionally equivalent TASK_USAGE_90 custom property. For earlier servers that have not been customized, setUsage() will trigger a NoSuchPropertyException.

Parameters:
usage - The usage of this task.
See Also:
ProcessItem.Usage

getUsage

public ProcessItemUsage getUsage()
Gets the usage of this task.

Returns:
The task usage. The usage determines whether or not this is a process task and, if so, the type of operation that created the task and its process links.

isProcessTask

public boolean isProcessTask()
Determines whether or not this task is a process task.

Returns:
true if this task is a process task; false otherwise.
See Also:
Task.getUsage(), ProcessItem


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.