I am trying to get latest version number of a process model by creating a plug-i

I am trying to get latest version number of a process model by creating a plug-in.
I am using getVersion() method in ProcessModel.Descriptor class.
But it is returning null value which is assigned initially.
So I have used getLatestPublishedVersion() method in ProcessModelProperties class which is returning correct value.
What wrong with the usage of getVersion method in ProcessModel.Descriptor class.
Please find the attached code.

getObjVersion.txt

OriginalPostID-218988

OriginalPostID-218988

  Discussion posts and replies are publicly visible