ProjectTasksCreate Method

Description

The PDS adds one or more tasks to the specified project on Microsoft Office Project Server 2003. The PDS also determines the next valid UID for each task and increments any existing task IDs to accommodate the new task. The PDS creates appropriate task links between the new task and existing tasks in the project, as requested in the method call.

If one task creation fails for any reason, then the whole ProjectTasksCreate call fails.

Usage

Microsoft Office Project Professional 2003 handles task data created with ProjectTasksCreate according to the following rules:

  • Project Professional can change the Start and Finish parameters during a recalculation of the project. Essentially, it is the job of Project Professional to schedule the start and finish dates of the tasks and the project.

  • ConstraintType is required if the user wants the start and finish dates of a task to remain unchanged by Project Professional. The relevant constraints in this case are Must Start On (MSO) and Start Not Earlier Than (SNET).

  • Actual reported data (ActualWork, ActualDuration, etc) is NEVER modified by the Project Professional scheduling engine. However, it can appear that Project Professional modifies actual reported data when the data gets redistributed because of calendar changes.

  • Project Professional can modify Duration if more resources are assigned to the task and the task is not fixed duration.

  • Project Professional automatically calculates costs unless the Manual option is set in the Calculation tab on the Options dialog (click Options on the Tools menu).

  • The Project Professional calculation engine will never modify baseline data.

Syntax

<Request>
   <ProjectTasksCreate>
      <AutoPublish></AutoPublish>
      <ProjectID></ProjectID>
      <ProjectName></ProjectName>
      <Tasks>
         <Task>
            <Name></Name>
            <ID></ID>
            <PredecessorLink>
               <PredecessorID></PredecessorID>
               <Type></Type>
               <CrossProject></CrossProject>
               <LinkLag></LinkLag>
            </PredecessorLink>
            -- Other task details --
         </Task>
      </Tasks>
   </ProjectTasksCreate>
</Request>

-- Other supported task details --
<Type></Type>
<WBS></WBS>
<OutlineLevel></OutlineLevel>
<Priority></Priority>
<Start></Start>
<Finish></Finish>
<Duration></Duration>
<EffortDriven></EffortDriven>
<Deadline></Deadline>
<Estimated></Estimated>
<Milestone></Milestone>
<Summary></Summary>
<Work></Work>
<PercentComplete></PercentComplete>
<PercentWorkComplete></PercentWorkComplete>
<ActualDuration></ActualDuration>
<ActualWork></ActualWork>
<ActualOvertimeWork></ActualOvertimeWork>
<RemainingDuration></RemainingDuration>
<RemainingWork></RemainingWork>
<RemainingOvertimeWork></RemainingOvertimeWork>
<ConstraintType></ConstraintType>
<ConstraintDate></ConstraintDate>
<LevelAssignments></LevelAssignments>
<LevelingCanSplit></LevelingCanSplit>
<LevelingDelay></LevelingDelay>
<IgnoreResourceCalendar></IgnoreResourceCalendar>
<HideBar></HideBar>
<Rollup></Rollup>
<PhysicalPercentComplete></PhysicalPercentComplete>
<EarnedValueMethod></EarnedValueMethod>

Parameters

AutoPublish

Optional. The default value is 0. If AutoPublish is set to 1, the PDS calls ProjectViewTablesCreate to synchronize the project with the Project Server view tables after all of the tasks have been added. AutoPublish is set for the entire call.

ProjectID* or *ProjectName

Required. ProjectTasksCreate must include either the ProjectID or the ProjectName. If ProjectID is specified, ProjectName is ignored, even if given. ProjectName is the concatenation of the project name and the version name with a period separator (that is, Name.Version).

Name

Required. The name the task to be added.

ID

Optional. If ID is not specified, Project Server creates a task identifier number which is the order number of the next task in the project.

Note In the first release of Project Server 2003, ID is required. You can call the ProjectData method to get the maximum task ID, and then pass that ID + 1 to ProjectTasksCreate. In the SP1 release of Project Server 2003, ID is optional.

PredecessorLink

Optional. Defines the predecessor task information.

Valid Parameter Values:

The supported task details follow the Project XML Schema.

TaskType

Value Description
0 Fixed units (default). The number of resources (Assignment Units) remains constant, regardless of the amount of work or duration on the task.
1 Fixed duration. The duration of the task remains constant, regardless of the number of resources (Assignment Units) assigned or the amount of work.
2 Fixed work. The amount of work remains constant, regardless of any change in duration or the number of resources (Assignment Units) assigned to the task.

TaskPriority

Any integer value from 0 to 1000 is valid. Those values carry meaning according to the following table.

Value Description
0 Lowest priority. Task will always be leveled.
500 Default.
1000 Highest priority. Task will never be leveled.

ConstraintType

Value Description
0 As soon as possible.
1 As late as possible.
2 Must start on; ConstraintDate is required
3 Must finish on; ConstraintDate is required
4 Start no earlier than; ConstraintDate is required
5 Start no later than; ConstraintDate is required
6 Finish no earlier than; ConstraintDate is required
7 Finish no later than; ConstraintDate is required

LinkType

Value Description
0 FF (finish-to-finish)
1 FS (finish-to-start)
2 SF (start-to-finish)
3 SS (start-to-start)

Additional Parameter Rules:

  • For an Admin project, TaskType defaults to Fixed Duration (2), unless a specific task type is specified.

  • For an Admin project, EffortDriven defaults to False (0), unless it is specified as True (1).

  • ActualWork, ActualOvertimeWork, RemainingWork, and RemainingOvertimeWork are valid only if the task has a value for Work. Therefore, if the task does not have any work associated with it at creation time, these fields will be ignored by Project Professional when it opens the project.

  • RemainingDuration is only valid if the task has a duration specified for it. Therefore, remaining duration will be ignored by Project Professional unless a duration has also been specified.

  • LevelingDelay defaults to a format of "elapsed days" over a 24 hour calendar; this is the only valid format for the LevelingDelay parameter on a task.

  • Duration and LinkLag are specified in minutes. Therefore, with the standard calendar, a 1d task would be entered as 480 (480 = 8 * 60).

  • A task cannot be both a milestone and a summary task (Summary and Milestone cannot both be 1).

  • A summary task cannot be created without children. If a user attempts to create a summary task without children, ProjectTasksCreate returns an error.

Return Value

If the requested task creation is successful, the method returns a successful HRESULT and STATUS.

<Reply>
   <HRESULT>0</HRESULT>
   <STATUS>0</STATUS>
   <UserName>Administrator</UserName>
</Reply>

Remarks

The PDS determines whether the user has the requested project checked out; no other permissions are checked. If so, the PDS checks each task name for valid characters and formatting.

The PDS adds the task or tasks directly to the Project Server database for the requested project.