Read / Write - Update Extended Attributes

Hi,

I've started to test with the Primavera XML files and MSP 2003. I have confirmed that the original Primavera XML file does open in MSP 2003. The files I'm using are basically the same exercise files that I used for the MS Project Tests. The only difference is that the XML was generated by Primavera.

The first test is relatively simple. Read the XML file, update some extended attributes, Save the XML file. (as far as I know - only read except for Extended Attributes).

When the saved file is opened by MS Project, I get the same errors ... something about duration format not being correct.

When I do a file compare (original vs Imported), I notice a lot more has been added to the XML file after saving. I've attached the two files.

My conclusions ... the Primavera files (original) seem to open ok. Something appears to have been injected in the save process to cause the errors ... I'll keep looking to see if I can find it..

Any thoughts or support appreciated!!

Regards, Bruce

Hi Bruce,


Yes, it looks that created by Primavera XML file does not contain a lot of information.

See for example: -2147483648. It has to be a default number of working days per month (20 on my local machine).

I will try to eliminate the values as it is important not only for Oracle Primavera but and for MSP2002 xml backward support.

But if MSP 2003 will not find the data in the file it takes the data from the Project Global template, so you can get different results on different systems (20 working days * 8 hours = 160 hours = 1 working month on my PC and 16 working days * 7.5 hours = 120 hours = 1 working month on somebody else PC, so you can get quite different costs for one task with 1 month duration…)

As a variant, you can set each unsupported by Primavera parameter by hand before exporting (-2147483648).

Hi,

Same Test Workshop 19 MS Project 2003.. I've attached the original and the saved version after an import to application (basically read, update the extended attributes and save.).

I've also checked the Primavera (2007) files against the XSD file and there were a few errors (mostly in outlinecode - both versions have the same problem.). I think it shows the range of optional elements that are optional ... so the primavera small file is as compatible as the full set of tags.

BTW: These files are not loading into MS Project 2003. The failure relates to UID = 0 and calculation of free slack. This does not seem to allow the xml to be read!!

I'll keep looking at this problem ...

Regards, Bruce

Hi Sergey,

I've read your note ... and I think this is very important. When using Aspose.Tasks, we don't have a default Project Global Template.

I have a default template for new projects - however, I just open existing files.

I guess you are saying that all of the key parameters missing from the primavera file are available as properties in the Aspose.Tasks interface and to ensure that these are set before saving the file.

I'd be interested in knowing which ones are missing so I can initialise these (or they could be set to the traditional default).

On the other hand, I'm not sure that this explains why the Imported file cannot be read - if it does use the defaults from the Global Template.

I'll also check if there are some options that may not have been used when making the Primavera MS Project XML files

Regards, Bruce

Hi Bruce,

In fact it is not a problem with original MSP xml and mpp files as they contain all data you need to restore the project. Otherwise you could use them only on your local PC.

The problem is with the Oracle Primavera files and with files in old versions where the fields have not been defined yet.

You can find unread fields by their values Int32.Min (-2147483648). Most of them are not important as I think, but you can set them to values you need.

A new issue ‘Remove unread project’s fields from resulting xml’ with id=14081 has been created and linked to this forum thread.

A new intermediate Aspose.Tasks 2.5.0.2 build was created where the issue has been fixed (see attachment).

If the field was not defined in the original xml and was not updated in the code it will be removed from the resulting xml. I have used the build to convert your files (both) and MSP 2003 can open resulting xmls correctly.

Hi Sergey,

I think this is really important!!!!!!! Here is my understanding of what you have indicated!!

Where there are optional XML Elements that are not provided, Aspose.Tasks keeps an indicator (Int32.Min (-2147483648)) that these Elements have not been read. In the past versions, Aspose.Tasks has output something for these missing XML Elements.

I guess the fix in 2.5.0.2 is to only output valid XML that have been provided.

If this is the case, this explains why the XML files have grown so much.. This may also explain why there have faults with missing values..

I tend to go back to the XSD ... Some of the XML Elements are required (if you believe the XSD) and many are optional. For example, the is a required element. I now think I understand why .. as it relates to how the cost numbers are interpreted - the plan must be in that currencycode or the numbers need to be converted to another code. Without this information the currency of the costs is not known. (The Primavera Files are missing this Element though they have the symbol - I'll feed this back to Oracle.).

This sounds like a much more sensible approach to the reading and writing of the XML. As you have indicated, if new things are added or values change after the file is read any of these will be passed through.

Regards, Bruce

Hi Bruce,


Yes, in this version default Global template values will be used for project fields missed in the Primavera xml.

We are thinking about possibility to provide a template for ProjectReader (mpp, mpt, xml) from which the default values could be read independently from local Project settings.

I will be back as I formulate the issue completely.

Do you think the Feature could be helpful?

Hi Sergey,

Here are the results of testing 2.5.0.2. The output file is smaller and the attached file (workshop 9) opened in MS Project 2002 without errors. The other had a problem with accrual choice (related to the resource sheet).

I think this approach is definitely moving in the right direction. There are still too many elements that are being added that do not appear to be absolutely necessary ... as they are not in the original file.

In this case, 'less is more'. Expecially if they are only optional and not in the original XML file.

Re: template for the project reader ... in a sense, I'm already doing this by providing a blank XML project file for New Projects only. At this point, I would like to see what the final resolution of this problem looks like ... the more that doesn't need to be added the better. Maybe this will eliminate the need to have other information available. (NOTE: for new projects, a template with all of the required settings is absolutely critical - you have seen the one I'm using).

In some ways, the only time all of the information and settings need to be fully available and accurate is when full resource scheduling is being performed and cost roll-ups are being produced. I am only synchronizing the structure and dates and resoure assignments and do not recalculate anything. If I was scheduling and recosting, I'd probably want more information to be available and accurate. Others may have different needs for the interface.

Once again, I'll be happy to test any versions you provide and will turn around results asap.

Regards, Bruce

Hi Sergey,

Results of first complete Round Trip - no changes - Primavera MS Project XML files.

1) Primavera MS Project XML does not include resource with UID = 0

I have changed my scan routine to check for a resource with UID = 0 and start with loop with 1 otherwise use 0 (all resources in the list). I'm able to read and write all items.

2) Primavera MS Project XML includes a group resource

Is a group resource supported in 2003, 2007, or 2010? (I'm still using 2002 as minimum for MS Project automation).

3) Import vs Export files..

The good news is that once the import file has been saved with all of the extra XML elements.. I can explain all changes except the various elements that appear to be on Summary Tasks. Is this normal?

I've attached the files. These files open in 2002 with an error - this may be due to 2002 rather than a problem with the XML. I'll try opening them on 2003 later.

The main question I have is: are all of the extra tags actually necessary?

Thanks again for the updated Aspose.Tasks. I'm now able to move forward with more testing.

Regards, Bruce

Hi Bruce,

Sorry for long delay.

See a new updated intermediate Aspose.Tasks 2.5.0.3 version in the attachment. I have introduced a new element ‘Undefined’ in some Aspose.Tasks enumerations and removed some unnecessary elements from resulting xml (unread fields get the Undefined value and are ignored while exporting into Xml).

Now I can read/write your file using Aspose.Tasks 2.5.0.3 and MSP2003/2007 can read resulting file as well. More over, MSP 2007 can not read original file correctly but can read updated. I think it is because exported file contains more required data for this MSP version.

I don’t think we have to remove additional Boolean and Durational elements as MSP 2000/2002 will ignore them and MSP 2003/2007 will add the same.

Let me know if the version works for you.

Hi Sergey,

Many thanks for the update!!! I've repeated the tests with 2.5.0.3 -

1) No error when opening with MS Project 2002

2) Fewer items added

3) Same differences between import and export files. (this is good!!) How is the duration on summary tasks calculated?

There are still a lot of XML Elements that are added in the initial save. It would be nice to see fewer if possible. Primavera opened in 2002 and now I can open this version in 2002 (not that this is a requirement).

I'll start testing some changes on export ...

As before, I'll turn around any new versions you provide with test results.. I appreciate the updates you have provided.

Regards, Bruce

Hi Bruce,


We are going to remove all extra elements. Will try to create an update tomorrow.

Aspose.Tasks does not recalculate summary tasks durations now. MSP will recalculate them while opening the xml. I think summary task start date is the earlest subtasks’ start dates and the end is the latest of subtasks’ end dates. The duration can be calculated from these data. Tasks’s Calendars have been put into considerations too.

Have to be back with the update soon.

Hi Bruce,


The update is ready. You can find the new intermediate 2.5.0.4 version of Aspose.Tasks in the attachment.

I have removed all Boolean and Duration unread optional extra fields from the resulting xml except some calculated values (Summary, IsSubproject etc) as Aspose.Tasks does not read the values from original file but recalculates from other project data.

And I kept the Resource 0 as we need it for a new project creation from scratch.

I am waiting for your results. Thank you for your cooperation!!!

Hi Sergey,

Many thanks for 2.5.0.4. Here are the results of the testing..

1) MS Project 2002 opens no errors ...

2) The files are smaller!!! however, there are now some items in the Source File that are not included in the first output file (mostly in the Assignments area). A file compare between original file (previous attachments and Import21 should highlight the differences..

Here are some specific differences:

1) Where the Resource UID = 0 was added, the ID numbering started from zero not 1. This was corrected on the Export test as the resource with UID = 0 existed. We will get a chance to see what Primavera thinks of a Resource with UID = 0 as it does not seem to add it.

2) The encoding attribute is not copied to the output file (encoding with UTF-8 makes a difference).

3) Task baseline information seems to be missing some lines from source file

<DurationFormat>7</DurationFormat>

<Work>PT0H0M0S</Work>

4) Rate Table

CostPerUse is defined in the source and not in the output file

RateFormats are defined in the output file however are not specified in the source (is this the MS Project default?)

5) Resource start and finish dates in Resource output not in source.

6) Assignment information in source not in output.

<ActualOvertimeCost>0</ActualOvertimeCost>

<RemainingCost>0</RemainingCost>

<Start>2009-12-07T08:00:00</Start>

<Finish>2009-12-07T16:00:00</Finish>

Not sure why these are missing from output.

Thanks very much for this release...

I'm now going to start getting a round trip from My app through Primavera and return and we can see how Primavera reads the files.

I'm feeling a lot more confident we are in the right direction... thanks for your help!!

Regards, Bruce

Hi Bruce,


Thank you a lot for the information!

Let me know if any of the issues is critical for you. I will fix it ASAP.

Meanwhile I am going to make a deep analysis from my side.

Please note, that I am removing unread optional fields from resulting output while all new added tasks, resources and etc will have usual for MSP2003/2007 set of fields with default settings…

You can use any of your tasks as a template and its Clone method to get a new Task with the same set of fields to output.

Hi Sergey,

Given the progress this week with the Primavera files, I was hoping to build a new beta test version. However, yesterday, I initiated an initial round trip through primavera with the last version you sent. This may help indicate which of the items are critical for another intermediate version. I'll let you know what I find.

My only worry about the current results is the items in the source file that are not showing up in the output file. This might have some impact on the results.

I really appreciate your help ... I'll let you know what I find from the rt to p6r7.

Regards, Bruce

Hi Sergey,

Here are the results of doing first pass round trip through primavera. All attempts were very close (80 - 90 %) and then had a failure related to dates which I'm investigating.

We have concluded: The XML created by Primavera cannot be imported to Primavera!

I have attached a project that has worked. I've included the XML from Primavera and the XML from MS Project 2007 that did import successfully.

I am now looking for the minimum items to add to successfully import from MSP. (Hopefully it won't be the full 20x amount of extra information).

BTW: Here is the approach used to Import files to Primavera.... They use an XSLT transform to convert the MS Project XML to Primavera XML and then import the Primavera XML. The reverse might also be true.

I should have more information in a few days (I'm reconfiguring my test environment).

Regards, Bruce

(NOTE: Please keep this sample project confidential)

Hi Bruce,


I have made the thread private to keep your sample confidential. In future you can send private data by e-mail and not put into an open forum thread.

The missed values (CostPerUse and etc) are missed when they are equal to ‘0’ only. It should not impact your project as ‘0’ is a default value for missed decimal fields in MSP. I am working to fix it anyway.

Hi Bruce,

have made the update. Now zero valued read costs will be exported to xml, all unread costs will have Decimal.MinValue values and are not exported to resulting xml.

I else can see a difference in your project (real project) file with the MSP xml schema. Values for PercentCompleted should be integers only while in your file I met some decimal (see task with id = 48). But as MSP can process the file I have added the formats too. So your file can be opened by MSP 2003/2007 and can be processed by Aspose.Tasks 2.5.0.5 (see it in attachment). More over, the resulting file can be opened by MSP 2003/2007. I have compared the project’s statistics before and after conversion. It looks pretty the same.

Note, that the project can not be recalculated by MSP2010(beta). It looks that Microsoft guys have implemented different recalculation algorithms for all three MSP 2003/2007/2010 versions… More over, MSP2010 hangs on while opening your file converted by MSP 2003. Hope they will correct the issue in official release.

Hi Sergey,

Thanks for the update ... I have rerun the tests I've done before ... Here are items that I believe are still open:

1) ID numbering (not UID numbering) of resources after entering Resource with UID = 0

If you look at the import file 31, the id numbers start at 0 not at 1. If you look at the export file 32, the numbers start at 1 as in the original file.

2) The startdate and finishdate in the baseline assignment information is not being copied to the output file.

I hope to be able to get a new test system in place to understand what the minimum info primavera needs to successfully load a project. (hopefully today ... maybe tomorrow).

Many thanks!!

Regards, Bruce