MSPDIWriter does not write Task GUID
Multi platform library to read and write schedule data
Brought to you by:
joniles
Hello,
I'm trying to preserve Task GUIDs between read and write, but the underlying JAXB model class does not have a field for GUID, so it is skipped when writing.
I tried to modify the class, but I think it has been generated somehow (29000 lines O.o) and it crashes my eclipse... :(
Please, can you add it?
Thank you
Hi, unfortunately MS Project doesn't read or write the task GUID attribute to MSPDI files. The JAXB code has been generated from Microsoft's schema file for MSPDI. I could potentially add a field to support it, but it would be ignored when read by MS Project, and obviously not present when written by MS Project. Bearing this in mind, would the field still be useful to you?
Hi, I just "hotpatched" your code, and it's working :)
I'm attaching the result to show XML and MS Project 2016 reading the GUID correctly.
I don't know about formal MSPDI schema, but even MS Project 2016 exports this field (and many others) in XML.
So, even if it is not formally compliant, I'll be very grateful if you can add the field :)
To made it work I just added the field to Task:
to Resource:
and modified MSPDIWriter for tasks:
and for resources:
Since I just use the lifecycle:
I didn't note there's also the MSPDIReader class to modify accordingly.
Thank you very very much
I've just tried this with MS Project 2016 and MS Project 2016 Pro. I'm not seeing GUIDs being written for tasks. I tried loading your sample file (Z004.mspdi-java.xml) into MS Project 2016 Pro, but the GUIDs in the file are ignored, MS Project generates new GUIDs for the task.
Can you confirm the version of MS Project you are working with?
The file version: 16.0.9226.2156
Inside Project: Microsoft Project MSO (16.0.9226.2114) 64 bit
I'm sorry, I think I made some mistake...
If I open the XML with MS Project the GUIDs are loaded correctly, but as soon as I "save as" MPP, the GUID are re-assigned :(
I've closed this, as per my original comment the MSPDI file format does not include task GUIDs.