Task

Task class

Inherits: Aspose::Tasks::IEntityWithTd

Represents a task in a project.

The Task is representing a one atomic chunk of work.

One can use Task to plan a project by creating tasks and assign appropriate resources onto them. Tasks in a project are organized as a rooted hierarchical tree structure, with a root task and subtrees of children tasks.

To build a tree of tasks one can use a specialized collection Aspose::Tasks::TaskCollection by accessing Project::RootTask property e.g.:

Project project = new Project();
 
// add new tasks
Task task1 = project.RootTask.Children.Add(); // a parent task with empty name is added
Task childTask1 = task1.Children.Add("Child 1");
childTask1.Set(Tsk.Start, new DateTime(2020, 2, 12, 8, 0, 0))
childTask1.Set(Tsk.Duration, project.GetDuration(8, TimeUnitType.Hour));
childTask1.Set(Tsk.Finish, new DateTime(2020, 2, 12, 17, 0, 0));
Task childTask3 = task1.Children.Add("Child 3");
childTask3.Set(Tsk.Start, new DateTime(2020, 2, 13, 8, 0, 0))
childTask3.Set(Tsk.Duration, project.GetDuration(8, TimeUnitType.Hour));
childTask3.Set(Tsk.Finish, new DateTime(2020, 2, 13, 17, 0, 0));
Task childTask2 = task1.Children.Add("Child 2", 2); // inserts a task before the childTask3
childTask2.Set(Tsk.Start, new DateTime(2020, 2, 14, 8, 0, 0))
childTask2.Set(Tsk.Duration, project.GetDuration(8, TimeUnitType.Hour));
childTask2.Set(Tsk.Finish, new DateTime(2020, 2, 14, 17, 0, 0));
 
// save project in the one of available formats
project.Save("Filled project.xml", SaveFileFormat.MPP);

Methods

NameDescription
CloneCreates full copy of a task without subtasks.
DeleteDeletes a task from parent project tasks collection and all its assignments.
Equals (2 overloads)Returns a value indicating whether this instance is equal to a specified object.
GetReturns the value to which the property is mapped in this container.
get_ActivityIdRepresents activity id field - a task’s unique identifier used by Primavera. (only applicable to Primavera projects).
get_ActualCostGets a value of ActualCost.
get_ActualDurationGets a value of ActualDuration.
get_ActualFinishGets a value of ActualFinish.
get_ActualOvertimeCostGets a value of ActualOvertimeCost.
get_ActualOvertimeWorkGets a value of ActualOvertimeWork.
get_ActualOvertimeWorkProtectedGets a value of ActualOvertimeWorkProtected.
get_ActualStartGets a value of ActualStart.
get_ActualWorkGets a value of ActualWork.
get_ActualWorkProtectedGets a value of ActualWorkProtected.
get_ACWPGets a value of ACWP.
get_AssignmentsGets a collection of resource assignments for this object.
get_BaselinesGets the collection of baseline values of the task.
get_BCWPGets a value of BCWP.
get_BCWSGets a value of BCWS.
get_BudgetCostGets a value of BudgetCost.
get_BudgetWorkGets a value of BudgetWork.
get_CalendarGets a value of Calendar .
get_ChildrenGets a child task collection of this object. TaskCollection object which represents children tasks.
get_CommitmentFinishGets a value of CommitmentFinish.
get_CommitmentStartGets a value of CommitmentStart.
get_CommitmentTypeGets a value of CommitmentType.
get_ConstraintDateGets a value of ConstraintDate.
get_ConstraintTypeGets a value of ConstraintType.
get_ContactGets a value of Contact.
get_CostGets a value of Cost.
get_CostVarianceGets a value of CostVariance.
get_CreatedGets a value of Created.
get_CVGets a value of CV.
get_DeadlineGets a value of Deadline.
get_DisplayAsSummaryGets a value indicating whether DisplayAsSummary is set or not.
get_DisplayOnTimelineGets a value indicating whether DisplayOnTimeline is set or not.
get_DurationGets a value of Duration .
get_DurationFormatGets a value of DurationFormat.
get_DurationTextGets a value of DurationText.
get_DurationVarianceGets a value of DurationVariance.
get_EarlyFinishGets a value of EarlyFinish.
get_EarlyStartGets a value of EarlyStart.
get_EarnedValueMethodGets a value of EarnedValueMethod.
get_ExtendedAttributesGets ExtendedAttributeCollection object containing the values of an extended attribute.
get_ExternalIdGets a value of ExternalId.
get_ExternalTaskProjectGets a value of ExternalTaskProject.
get_ExternalUidGets or set the external task’s Unique identifier when the task is external.
get_FinishGets a value of Finish.
get_FinishSlackGets a value of FinishSlack.
get_FinishTextGets a value of FinishText.
get_FinishVarianceGets a value of FinishVariance.
get_FixedCostGets a value of FixedCost.
get_FixedCostAccrualGets a value of FixedCostAccrual.
get_FreeSlackGets a value of FreeSlack.
get_GuidGets a value of Guid.
get_HideBarGets a value indicating whether HideBar is set or not.
get_HyperlinkGets the title or explanatory text for a hyperlink associated with a task.
get_HyperlinkAddressGets the address for a hyperlink associated with a task.
get_HyperlinkSubAddressGets the specific location in a document in a hyperlink associated with a task.
get_IdGets a value of Id.
get_IgnoreResourceCalendarGets a value indicating whether IgnoreResourceCalendar is set or not.
get_IgnoreWarningsGets a value indicating whether IgnoreWarnings is set or not.
get_IsActiveGets a value indicating whether IsActive is set or not.
get_IsCriticalGets a value indicating whether IsCritical is set or not.
get_IsEffortDrivenGets a value indicating whether IsEffortDriven is set or not.
get_IsEstimatedGets a value indicating whether IsEstimated is set or not.
get_IsExpandedGets a value indicating whether IsExpanded is set or not.
get_IsExternalTaskGets a value indicating whether IsExternalTask is set or not.
get_IsManualGets a value indicating whether IsManual is set or not.
get_IsMarkedGets a value indicating whether IsMarked is set or not.
get_IsMilestoneGets a value indicating whether IsMilestone is set or not.
get_IsNullGets a value indicating whether IsNull is set or not.
get_IsOverallocatedGets a value indicating whether IsOverallocated is set or not.
get_IsPublishedGets a value indicating whether IsPublished is set or not.
get_IsRecurringGets a value indicating whether IsRecurring is set or not.
get_IsResumeValidGets a value indicating whether IsResumeValid is set or not.
get_IsRollupGets a value indicating whether IsRollup is set or not.
get_IsSubprojectGets a value indicating whether IsSubproject is set or not.
get_IsSubprojectReadOnlyGets a value indicating whether IsSubprojectReadOnly is set or not.
get_IsSummaryGets a value indicating whether IsSummary is set or not.
get_LateFinishGets a value of LateFinish.
get_LateStartGets a value of LateStart.
get_LevelAssignmentsGets a value indicating whether LevelAssignments is set or not.
get_LevelingCanSplitGets a value indicating whether LevelingCanSplit is set or not.
get_LevelingDelayGets a value of LevelingDelay.
get_ManualDurationGets a value of ManualDuration.
get_ManualFinishGets a value of ManualFinish.
get_ManualStartGets a value of ManualStart.
get_NameGets a value of Name.
get_NotesRTFGets a value of NotesRTF.
get_NotesTextGets a value of NotesText.
get_OutlineCodesGets OutlineCodeCollection object.
get_OutlineLevelGets a value of OutlineLevel.
get_OutlineNumberGets a value of OutlineNumber.
get_OvertimeCostGets a value of OvertimeCost.
get_OvertimeWorkGets a value of OvertimeWork.
get_ParentProjectGets the parent project of a task.
get_ParentTaskGets the parent task of a task.
get_PercentCompleteGets a value of PercentComplete.
get_PercentWorkCompleteGets a value of PercentWorkComplete.
get_PhysicalPercentCompleteGets a value of PhysicalPercentComplete.
get_PredecessorsGets a TaskCollection object which contains all predecessors of this Task object.
get_PreleveledFinishGets a value of PreleveledFinish.
get_PreleveledStartGets a value of PreleveledStart.
get_PrimaveraPropertiesGets an object containing Primavera-specific properties for a task read from Primavera file.
get_PriorityGets a value of Priority.
get_RecurringInfoGets the instance of RecurringTaskInfo class for the task which is a recurring task; if the task is not a recurring one then returns null;
get_RegularWorkGets a value of RegularWork.
get_RemainingCostGets a value of RemainingCost.
get_RemainingDurationGets a value of RemainingDuration.
get_RemainingOvertimeCostGets a value of RemainingOvertimeCost.
get_RemainingOvertimeWorkGets a value of RemainingOvertimeWork.
get_RemainingWorkGets a value of RemainingWork.
get_ResumeGets a value of Resume.
get_SplitPartsGets a SplitPart collection that represents the portions of a task.
get_StartGets a value of Start.
get_StartSlackGets a value of StartSlack.
get_StartTextGets a value of StartText.
get_StartVarianceGets a value of StartVariance.
get_StatusGets task status.
get_StatusManagerGets a value of StatusManager.
get_StopGets a value of Stop.
get_SubprojectNameGets a value of SubprojectName.
get_SuccessorsGets a TaskCollection object which contains all successors of this Task object.
get_SVThe earned value schedule variance, through the project status date. Schedule variance (SV) is the difference between the BCWP and the BCWS.
get_TimephasedDataGets a TimephasedDataCollection object of this task. The time phased data block associated with a task.
get_TotalSlackGets a value of TotalSlack.
get_TypeGets a value of Type.
get_UidGets a value of Uid.
get_WarningGets a value indicating whether Warning is set or not.
get_WBSGets a value of WBS.
get_WBSLevelGets a value of WBSLevel.
get_WorkGets a value of Work.
get_WorkVarianceGets a value of WorkVariance.
GetHashCodeReturns a hash code value for this Task .
GetTimephasedData (2 overloads)Returns TimephasedDataCollection object with TimephasedData values within given start and end dates.
MoveToSibling (2 overloads)Moves the current task at the same Outline Level before the specified task. If ParentProject.CalculationMode is None user should invoke Project.Recalculate() after using this method (It will reschedule all project tasks (start/finish dates, sets early/late dates) and calculate the dependent fields such as slacks, work and cost fields, outline levels). If ParentProject.CalculationMode is Manual the method will calculate only task id, outline level and outline numbers automatically. If ParentProject.CalculationMode is Automatic the method reschedules all project’s tasks automatically (start/finish dates, sets early/late dates, calculates slacks, work and cost fields, recalculates ids and outline levels).
OutlineIndentIndents a task in the outline.
OutlineOutdentPromotes a task in the outline.
SelectAllChildTasksRecursively collects all child tasks of this task.
SetMaps the specified property to the specified value in this container.
set_ActivityIdRepresents activity id field - a task’s unique identifier used by Primavera. (only applicable to Primavera projects).
set_ActualCostSets a value of ActualCost.
set_ActualDurationSets a value of ActualDuration.
set_ActualFinishSets a value of ActualFinish.
set_ActualOvertimeCostSets a value of ActualOvertimeCost.
set_ActualOvertimeWorkSets a value of ActualOvertimeWork.
set_ActualOvertimeWorkProtectedSets a value of ActualOvertimeWorkProtected.
set_ActualStartSets a value of ActualStart.
set_ActualWorkSets a value of ActualWork.
set_ActualWorkProtectedSets a value of ActualWorkProtected.
set_ACWPSets a value of ACWP.
set_BaselinesSets the collection of baseline values of the task.
set_BCWPSets a value of BCWP.
set_BCWSSets a value of BCWS.
set_BudgetCostSets a value of BudgetCost.
set_BudgetWorkSets a value of BudgetWork.
set_CalendarSets a value of Calendar .
set_CommitmentFinishSets a value of CommitmentFinish.
set_CommitmentStartSets a value of CommitmentStart.
set_CommitmentTypeSets a value of CommitmentType.
set_ConstraintDateSets a value of ConstraintDate.
set_ConstraintTypeSets a value of ConstraintType.
set_ContactSets a value of Contact.
set_CostSets a value of Cost.
set_CostVarianceSets a value of CostVariance.
set_CreatedSets a value of Created.
set_CVSets a value of CV.
set_DeadlineSets a value of Deadline.
set_DisplayAsSummarySets a value indicating whether DisplayAsSummary is set or not.
set_DisplayOnTimelineSets a value indicating whether DisplayOnTimeline is set or not.
set_DurationSets a value of Duration .
set_DurationFormatSets a value of DurationFormat.
set_DurationTextSets a value of DurationText.
set_DurationVarianceSets a value of DurationVariance.
set_EarlyFinishSets a value of EarlyFinish.
set_EarlyStartSets a value of EarlyStart.
set_EarnedValueMethodSets a value of EarnedValueMethod.
set_ExternalIdSets a value of ExternalId.
set_ExternalTaskProjectSets a value of ExternalTaskProject.
set_ExternalUidGets or set the external task’s Unique identifier when the task is external.
set_FinishSets a value of Finish.
set_FinishSlackSets a value of FinishSlack.
set_FinishTextSets a value of FinishText.
set_FinishVarianceSets a value of FinishVariance.
set_FixedCostSets a value of FixedCost.
set_FixedCostAccrualSets a value of FixedCostAccrual.
set_FreeSlackSets a value of FreeSlack.
set_GuidSets a value of Guid.
set_HideBarSets a value indicating whether HideBar is set or not.
set_HyperlinkSets the title or explanatory text for a hyperlink associated with a task.
set_HyperlinkAddressSets the address for a hyperlink associated with a task.
set_HyperlinkSubAddressSets the specific location in a document in a hyperlink associated with a task.
set_IdSets a value of Id.
set_IgnoreResourceCalendarSets a value indicating whether IgnoreResourceCalendar is set or not.
set_IgnoreWarningsSets a value indicating whether IgnoreWarnings is set or not.
set_IsActiveSets a value indicating whether IsActive is set or not.
set_IsCriticalSets a value indicating whether IsCritical is set or not.
set_IsEffortDrivenSets a value indicating whether IsEffortDriven is set or not.
set_IsEstimatedSets a value indicating whether IsEstimated is set or not.
set_IsExpandedSets a value indicating whether IsExpanded is set or not.
set_IsExternalTaskSets a value indicating whether IsExternalTask is set or not.
set_IsManualSets a value indicating whether IsManual is set or not.
set_IsMarkedSets a value indicating whether IsMarked is set or not.
set_IsMilestoneSets a value indicating whether IsMilestone is set or not.
set_IsNullSets a value indicating whether IsNull is set or not.
set_IsOverallocatedSets a value indicating whether IsOverallocated is set or not.
set_IsPublishedSets a value indicating whether IsPublished is set or not.
set_IsRecurringSets a value indicating whether IsRecurring is set or not.
set_IsResumeValidSets a value indicating whether IsResumeValid is set or not.
set_IsRollupSets a value indicating whether IsRollup is set or not.
set_IsSubprojectSets a value indicating whether IsSubproject is set or not.
set_IsSubprojectReadOnlySets a value indicating whether IsSubprojectReadOnly is set or not.
set_IsSummarySets a value indicating whether IsSummary is set or not.
set_LateFinishSets a value of LateFinish.
set_LateStartSets a value of LateStart.
set_LevelAssignmentsSets a value indicating whether LevelAssignments is set or not.
set_LevelingCanSplitSets a value indicating whether LevelingCanSplit is set or not.
set_LevelingDelaySets a value of LevelingDelay.
set_ManualDurationSets a value of ManualDuration.
set_ManualFinishSets a value of ManualFinish.
set_ManualStartSets a value of ManualStart.
set_NameSets a value of Name.
set_NotesRTFSets a value of NotesRTF.
set_NotesTextSets a value of NotesText.
set_OutlineCodesSets OutlineCodeCollection object.
set_OutlineLevelSets a value of OutlineLevel.
set_OutlineNumberSets a value of OutlineNumber.
set_OvertimeCostSets a value of OvertimeCost.
set_OvertimeWorkSets a value of OvertimeWork.
set_PercentCompleteSets a value of PercentComplete.
set_PercentWorkCompleteSets a value of PercentWorkComplete.
set_PhysicalPercentCompleteSets a value of PhysicalPercentComplete.
set_PreleveledFinishSets a value of PreleveledFinish.
set_PreleveledStartSets a value of PreleveledStart.
set_PrioritySets a value of Priority.
set_RegularWorkSets a value of RegularWork.
set_RemainingCostSets a value of RemainingCost.
set_RemainingDurationSets a value of RemainingDuration.
set_RemainingOvertimeCostSets a value of RemainingOvertimeCost.
set_RemainingOvertimeWorkSets a value of RemainingOvertimeWork.
set_RemainingWorkSets a value of RemainingWork.
set_ResumeSets a value of Resume.
set_StartSets a value of Start.
set_StartSlackSets a value of StartSlack.
set_StartTextSets a value of StartText.
set_StartVarianceSets a value of StartVariance.
set_StatusManagerSets a value of StatusManager.
set_StopSets a value of Stop.
set_SubprojectNameSets a value of SubprojectName.
set_SVThe earned value schedule variance, through the project status date. Schedule variance (SV) is the difference between the BCWP and the BCWS.
set_TimephasedDataSets a TimephasedDataCollection object of this task. The time phased data block associated with a task.
set_TotalSlackSets a value of TotalSlack.
set_TypeSets a value of Type.
set_UidSets a value of Uid.
set_WarningSets a value indicating whether Warning is set or not.
set_WBSSets a value of WBS.
set_WBSLevelSets a value of WBSLevel.
set_WorkSets a value of Work.
set_WorkVarianceSets a value of WorkVariance.
ToStringReturns short string representation of a task. The exact details of the representation are unspecified and subject to change.