Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplication of tasks when P6 exported xml iwth baseline #706

Closed
giladgreen opened this issue Jun 13, 2024 · 12 comments
Closed

Duplication of tasks when P6 exported xml iwth baseline #706

giladgreen opened this issue Jun 13, 2024 · 12 comments

Comments

@giladgreen
Copy link

giladgreen commented Jun 13, 2024

Hey,

when user create a schedule with baseline in P6, and then export it to xml, the result file (attached) tasks are treated as seperate tasks and the result is duplication (see output file example)

compare

(the input file is XML, i had to rename it to txt to attach it here)

With_Baseline.txt

output.json

@joniles
Copy link
Owner

joniles commented Jun 13, 2024

Hi Gilad, thanks for opening the issue and providing the sample file. I opened the sample file using MPXJ 12.10.2 and I'm able to read three distinct schedules from the file, each with their own separate WBS and Activities. Looking at the JSON file you've provided, I'm assuming you are undertaking some post-processing on the data from MPXJ to generate the JSON format you are working with. Is it possible that during this processing the data from the three schedules is being merged accidentally?

Jon

@giladgreen
Copy link
Author

Hey Jon

" and I'm able to read three distinct schedules from the file" - that is the issue.. its not 3 different schedules.. the original P6 file is one project, with a baseline.. we expect the result to have this activities only once, and only one result project

@joniles
Copy link
Owner

joniles commented Jun 13, 2024

If you have a look at the XML file, you'll see the structure is something like this:

<APIBusinessObjects>
	<!-- some preamble -->
	<Project>
		<!-- main project content -->
	</Project>
	<BaselineProject>
		<!-- baseline project content -->
	</BaselineProject>
	<BaselineProject>
		<!-- baseline project content -->
	</BaselineProject>
</APIBusinessObjects>

P6 manages baselines by taking copies of the original schedule, which is how you end up with multiple projects in one file when you export with baselines. If you use the UniversalProjectReader.read() method you'll just retrieve the main project (represented by the <Project> tag in the file), and if the current baseline from P6 has been exported as part of the file, the baseline attributes will be set on the Activities in that project. Calling the UniversalProjectReader.readAll() method will give you a list representing each of the schedules in the file as separate ProjectFile instances: the main one plus the two baselines. Again if the current baseline from P6 has been exported as part of the file, the baseline attributes will be set on the Activities in the main schedule.

@MadaraUchiha
Copy link

MadaraUchiha commented Jun 13, 2024

Hi Jon, I'm @giladgreen 's colleague.

The way we process multi-project schedules is that we merge them, such that they appear as the same logical schedule on the other end (the user is responsible for picking which schedules the extract, so that they are shown as one in the UI)

The bug (as I see it) is that the baselines are read by MPXJ as their own projects, we've been calling universal.readAll() since the beginning of time (as we do want to support the ability for users to export multiple projects at once from P6/other software, and have them appear like that on our end) and this is a relatively new (as far as we can tell) issue, and specifically with PMXML.

@joniles
Copy link
Owner

joniles commented Jun 13, 2024

Interesting! Let's see if we can get to the bottom of this...

So the behaviour of readAll to return both the main project and baseline projects from PMXML has been in place since February 2021 (a907092), so that bit isn't recent. The other relevant recent change I can think of was a big refactor to the internals of UniversalProjectReader to introduce ProjectReaderProxy which happened in April this year and went into version 12.9.0.

To see if this did have an effect, I just checked out 12.8.0 and used the "project explorer" UI which ships with MPXJ to open the file, and selected the "Open All" option which uses UniversalProject.readAll and I still get three distinct projects being retrieved. Just to be sure I went back to 12.0.0 and repeated the same test with the same results.

Can you confirm which MPXJ version you are working with currently? If you look at your version control history, can you roll back the MPXJ versions to see at what point you get back to the behaviour you are expecting?

@giladgreen
Copy link
Author

giladgreen commented Jun 13, 2024

Jon,

can we use the:
projectFile.getProjectProperties().getBaselineTypeName()

and be sure that only the BaselineProject would return a non-NULL value there? and alos that all of them would return value..

@joniles
Copy link
Owner

joniles commented Jun 13, 2024

getBaselineTypeName depends on the content of the PMXML file, so it could easily not be present.

It would probably be best for me to add a separate flag set by MPXJ to ensure you can distinguish between baseline and non-baseline projects. Would that work for you?

@giladgreen
Copy link
Author

yes, that would help a lot..

is the baseline feature relevant only to PMXML?

@joniles
Copy link
Owner

joniles commented Jun 14, 2024

is the baseline feature relevant only to PMXML?

Yes, at the moment as that's the only file format which could return a mixture of projects and baselines. Powerproject may end up being able to do this: at the moment although MPXJ is reading embedded baseline schedules from PP files, it doesn't make them available to the caller.

@joniles
Copy link
Owner

joniles commented Jun 14, 2024

I've added a new project property: IsProjectBaseline, I'll try and get a new release out today with this change.

@joniles
Copy link
Owner

joniles commented Jun 14, 2024

The new version is available now with the additional property.

@joniles
Copy link
Owner

joniles commented Jul 4, 2024

Hello! I'm going to close this issue now on the assumption you have what you need - feel free to update the issue or create a new one if you still have problems.

@joniles joniles closed this as completed Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants