What version change does the OnMigrate callback relate to?

Felix
Felix Member Posts: 5
Name Dropper First Comment
**

I've noticed that Mechanical ACT objects, loads and results have the OnMigrate callback.

From the API and XML Online Reference Guide for Mechanical I found the following information:

"Callback: Void load.OnMigrate(IUserObject newEntity, IUserObject oldEntity)
Callback that is invoked when the object version has been changed.

Parameters
newEntity

  • Type: IUserObject
  • The newly created object.
    oldEntity

  • Type: IUserObject

  • The old saved object.

Remarks
It enables the migration of data from the old saved object to the new one."

However, I wasn't able to find any other documentation and it isn't clear to me as to what version change this relates to and how this would be properly deployed.

Can anyone share an example showing how to correctly deploy the OnMigrate callback?

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 913
    100 Answers 500 Comments 250 Likes Second Anniversary
    ✭✭✭✭

    @Felix , my two cents here, I believe this callback is called whenever it is detected that the version of the ACT extension has changed. It is supposed to update the object to the newer extension. I've never seen this used as I believe it would be easy to delete the object and create it again with the new extension.