joniles / mpxj

Primary repository for MPXJ library
http://www.mpxj.org/
GNU Lesser General Public License v2.1
249 stars 104 forks source link

Question about PERCENT_COMPLETE #751

Closed giladgreen closed 3 weeks ago

giladgreen commented 1 month ago

Hey,

I know there a few types of percent complete, duration, physical, units (maybe more)..

i need those 3..

i see i can use the task.getPhysicalPercentComplete() to get the Physical Percent Complete, and i see there is also a getPercentCompleteType() that return a type..

my question is how do i use the type.. which attribute does that type refer to?..

i.e. if the getPercentCompleteType() return type PercentCompleteType.UNITS, what attribute would then be the units percent complete?

is it getPercentageComplete() is it getPercentageWorkComplete() is it getOverallPercentComplete()

i'd really appreciate if you can give us some simple example how to extract the 3 (duration, physical, units)

thanks

joniles commented 1 month ago

Hi,

apologies for the delay in responding.

The mappings for the three main percent complete types are show below:

PercentCompleteType.DURATION => Task.getPercentageComplete()
PercentCompleteType.PHYSICAL => Task.getPhysicalPercentComplete()
PercentCompleteType.UNITS => Task.getPercentageWorkComplete()

As a convenience, I am planning to add a new read-only "Activity Percent Complete" attribute to the Task class to match the equivalent attribute provided by P6. This will use the "Percent Complete Type" attribute to return the correct percent complete value for the task.

joniles commented 3 weeks ago

Just to confirm, there is now a new attribute available on the task class for Activity Percent Complete. This will be available in the next MPXJ release.