task ordering in project dataset created using ReadXml()

I

Ian McPartling

My problem relates to the ordering of tasks in project server which is
'opposite/backwark' to what i want.

I generate a xml file (an example below) and i create a project dataset with
this using ReadXml(), i then use QueueCreateProject() to publish it (as a
Template in my case) in project server. When the project is viewed in project
professional client, the task are in opposite order to how they appear in the
xml below. Also, as you can see, i have tried using TASK_ID to try and
override the ordering to no avail.

Short of manipulating/re-ordering my generated xml is there anything i can
do to fix this.

The problem has effectively ruined the product i am trying to develop !

any help appreciated,
Ian

<?xml version="1.0" standalone="yes"?>
<ProjectDataSet
xmlns="http://schemas.microsoft.com/office/project/server/webservices/ProjectDataSet/">
<Project>
<PROJ_UID>d85f6f07-1946-4089-9697-b61d7f491d47</PROJ_UID>
<PROJ_NAME>test111</PROJ_NAME>
<PROJ_TYPE>1</PROJ_TYPE>
</Project>
<Task>
<PROJ_UID>d85f6f07-1946-4089-9697-b61d7f491d47</PROJ_UID>
<TASK_UID>afaa8c63-ae87-4af2-8206-54df53e0212b</TASK_UID>
<TASK_NAME>Root</TASK_NAME>
<TASK_ID>1</TASK_ID>
<TASK_IS_SUMMARY>true</TASK_IS_SUMMARY>
<TASK_LOCKDOWN_BY_MANAGER>false</TASK_LOCKDOWN_BY_MANAGER>
<TASK_DUR_FMT>7</TASK_DUR_FMT>
<TASK_CONSTRAINT_TYPE>0</TASK_CONSTRAINT_TYPE>
<AddPosition>0</AddPosition>
</Task>
<Task>
<PROJ_UID>d85f6f07-1946-4089-9697-b61d7f491d47</PROJ_UID>
<TASK_UID>57c94501-20e0-4761-9e9d-a6bbd8e8f7c2</TASK_UID>
<TASK_NAME>T1</TASK_NAME>
<TASK_ID>2</TASK_ID>
<TASK_LOCKDOWN_BY_MANAGER>false</TASK_LOCKDOWN_BY_MANAGER>
<TASK_DUR>4800</TASK_DUR>
<TASK_DUR_FMT>7</TASK_DUR_FMT>
<TASK_CONSTRAINT_TYPE>0</TASK_CONSTRAINT_TYPE>
<TASK_OUTLINE_LEVEL>2</TASK_OUTLINE_LEVEL>
<AddPosition>1</AddPosition>
<AddAfterTaskUID>afaa8c63-ae87-4af2-8206-54df53e0212b</AddAfterTaskUID>
</Task>
<Task>
<PROJ_UID>d85f6f07-1946-4089-9697-b61d7f491d47</PROJ_UID>
<TASK_UID>91ffff9a-1b19-4693-9ecf-097d6a94eb9e</TASK_UID>
<TASK_NAME>T2</TASK_NAME>
<TASK_ID>3</TASK_ID>
<TASK_LOCKDOWN_BY_MANAGER>false</TASK_LOCKDOWN_BY_MANAGER>
<TASK_DUR>4800</TASK_DUR>
<TASK_DUR_FMT>7</TASK_DUR_FMT>
<TASK_CONSTRAINT_TYPE>0</TASK_CONSTRAINT_TYPE>
<TASK_OUTLINE_LEVEL>2</TASK_OUTLINE_LEVEL>
<AddPosition>1</AddPosition>
<AddAfterTaskUID>afaa8c63-ae87-4af2-8206-54df53e0212b</AddAfterTaskUID>
</Task>
<Task>
<PROJ_UID>d85f6f07-1946-4089-9697-b61d7f491d47</PROJ_UID>
<TASK_UID>1dd6938b-a6d3-411c-9699-00c7120bad13</TASK_UID>
<TASK_NAME>T3</TASK_NAME>
<TASK_ID>4</TASK_ID>
<TASK_LOCKDOWN_BY_MANAGER>false</TASK_LOCKDOWN_BY_MANAGER>
<TASK_DUR>4800</TASK_DUR>
<TASK_DUR_FMT>7</TASK_DUR_FMT>
<TASK_CONSTRAINT_TYPE>0</TASK_CONSTRAINT_TYPE>
<TASK_OUTLINE_LEVEL>2</TASK_OUTLINE_LEVEL>
<AddPosition>1</AddPosition>
<AddAfterTaskUID>afaa8c63-ae87-4af2-8206-54df53e0212b</AddAfterTaskUID>
</Task>
</ProjectDataSet>
 
I

Ian McPartling

I just decided perhaps it might be clearer if i clarified this ...

so in the xml i have ...

root
t1
t2
t3

but after creating a dataset with this xml and creating on project server,
the project appears (say in gantt view) as ...

root
t3
t2
t1

Ian
 
R

Ruairi

Ian,
This is kinda hard to explain, but I'll give it a go. The problem you're
getting is because "AddAfterTaskUID" needs the immediate predecessor to work
correctly - not the parent (which is what you are doing).

lets look at your entries; take these lines one at a time:
Root - goes in at outline level 1
t1 - goes in at level 2 "AddAfterTaskUID" - set this to the TASK_UID of root
t2 - goes in at level 2 "AddAfterTaskUID" - set this to the TASK_UID of t1
(<-- you set this to root)
t3 -goes in at level 2 "AddAfterTaskUID" - set this to the TASK_UID of t2
(<-- you set this to root)


By setting t2 & t3 to have "AddAfterTaskUID" of root, they get slotted in
before t1 in the wrong order.

I dont like how this works either; it makes if quite difficult to know what
is the last task in an outline level. I would like to see an update to the
PSI which allows for an AddPosition of "Last in Outline" or something
equivelent.

Hope this helps,

Ruairi
 
I

Ian McPartling

thanks Ruairi, your explanation sounds correct, i'll give it a try later
today.
ian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top