Problems with the lag calculated in the relation
Multi platform library to read and write schedule data
Brought to you by:
joniles
When I import a mpp file with some lags in the relations, the model calculates a wrong lag duration always show 95.57333333333334d but if I check the ToString method in the Relation model shows the correct lag
[Relation [Task id=2 uniqueID=2 name=Tarea 2 - Lag 0d] -> [Task id=1 uniqueID=1 name=Tarea 1]]
I attach the file with a simple example.
I'll attach a patch that will probably fix the problem.
Let me know if it is ok.
Hi! I think this patch should be applied to nearest update, because the problem with relations is really critical. Almost all files contain relations between tasks, and in this case import is useless. Hope we will see this patch in our favorite mpxj as soon as possible.
I still have not tested the patch with version 4.0.
On 03/04/2014 08:53 AM, Dmitry Lagoda wrote:
--
{}S José Vilmar Estácio de Souza
Related
Bugs:
#223I just tried to use your patch, and it seems to work perfectly. At least, in simple cases. Any case, thank you for sharing solution!
Did you apply the patch in version 4.50 released recently?
If the answer is yes, I do not need to test.
Thanks.
On 03/04/2014 11:16 AM, Dmitry Lagoda wrote:
--
{}S José Vilmar Estácio de Souza
Related
Bugs:
#223Yes, I tried with 4.5
Thank you for the fix, it works fine with 4.5.0.
Hi guys,
the patch work perfectly fine with MS Project 2013, but if you try to read files created with Project 2010, the lag will be incorrect.
I guess there should be a check of the version and depending on this set offsets 14/16 or 18/14.
I'll upload patch as soon as I'll modify it in my code
Sorry, no patch. I didn't check out the head, but simply downloaded the sources. So here's the change I've made in MPP14Reader.java at line 2006:
Duration lag;
if (m_file.getApplicationName().equals("Microsoft.Project 15.0"))
{
TimeUnit durationUnits = MPPUtility.getDurationTimeUnits(MPPUtility.getShort(data, 18));
lag = MPPUtility.getAdjustedDuration(m_file, MPPUtility.getInt(data, 14), durationUnits);
}
else
{
TimeUnit durationUnits = MPPUtility.getDurationTimeUnits(MPPUtility.getShort(data, 14));
lag = MPPUtility.getAdjustedDuration(m_file, MPPUtility.getInt(data, 16), durationUnits);
}
The latest code in Git fixes this issue.
I recently had this issue for a MS Project 2016 file. I could solve it locally by changing line 60 in ConstraintFactory.java to (>= 14 instead of == 14):