Closed alex-matatov closed 1 year ago
Fixed! The change is available in the version of MPXJ I've just released.
So quick! Thank you!
Hi Jon,
Unfortunately, the fix broke Primavera P6 EPPM import :( .
Unlike P6/Desktop, P6/EPPM (web version) is sensitive to xml elements order. Seems, if its xml parser expects tag "B" after tag "A" but sees tag "C" it stops to process rest of elements and project is not imported properly.
That is from P6 import log:
.....
ParentEPSObjectId = 3667
For Layout: Project 11968 from xml created Project 653
Project '621001-JV-PBI-1' (653) created according to 11968 from xml
WARNING: ScheduledFinishDate is skipped as this type of object is not recognized or invalid.
WARNING: StartDate is skipped as this type of object is not recognized or invalid.
....
Basically I found out (at least on my test files) that the problem is in <ScheduleOptions>
tag position inside <Project>
. After the fix it is placed before /APIBusinessObjects/Project/Calendar
tag. So P6 EPPM ignores all Project data.
After some experiments I realised that the right <ScheduleOptions>
position is after /APIBusinessObjects/Project/Relationship
tag.
The fix is quite trivial:
src/main/java/net/sf/mpxj/primavera/schema/ProjectType.java:
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ProjectType", propOrder =
{
"activityDefaultActivityType",
............
"riskMatrixObjectId",
"riskScore",
// "scheduleOptions", <= delete it
"scheduleWBSHierarchyType",
................
"relationship",
// scheduleOptions tag position is somewhere between <relationship> and <riskResponseActionImpact>.
// in my files I have only <relationship> block so I can say only that the tag position is definitely after relationship
"scheduleOptions", <= add it here
"activityPeriodActual",
"projectIssue",
"resourceAssignmentPeriodActual",
"document",
"projectDocument",
"risk",
"activityRisk",
"riskImpact",
"riskResponsePlan",
"riskResponseAction",
"riskResponseActionImpact"
}) public class ProjectType
Thanks for the detailed investigation for this one. I had a quick look at the sample files I have to hand and found that the schedule options tag actually appears after the projectDocument
tag, so slightly further down in the file. (I don't have any sample files with any of the risk*
tags so I'm not sure if it needs to be further down still...) The affected files are actually generated from an XSD schema, so I've corrected that and regenerated the relevant code. I also noticed that baseline projects in PMXML files written by P6 include a schedule options tag, but this was missing from the schema so I've also added that.
I've just published a new release which contains these changes.
thank you!
P6 allows to create Calendar and ActivityCodeType with Project and Global (scopes). P6 EPPM expects that
[Calendar | ActivityCodeType]/Global
will be inside<APIBusinessObjects>
tag and[Calendar | ActivityCodeType]/Project
will be inside<APIBusinessObjects><Project>
tag.However, PrimaveraPMFileWriter exports both
Global
(correctly) andProject
(incorrectly) Calendar/ActivityCodeType inside<APIBusinessObjects>
tag. P6 EPPM reports it in import log like below and replaces project based calendar with a default one. (Seems, P6/Desktop does not have this behaviour and is resistant to xml tag location)