Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
A migrator gets executed automatically as the first step of the "Import from ThingWorx Storage", essentially being a "pre" type hook in the import process.
Beware that it's only executed in the case of "Import from ThingWorx Storage" - it is not executed automatically during the Extension installation process.
Its role is to allow you to pre-process entities that were created with a previous version of the extension, at import time (eg: execute model changes).
The use-case when this is useful is not encountered extremely frequent and it's documented in this document, page 46.
From what I observed, the Migrator class is a relatively unused part of the ThingWorx Extension SDK.
I personally post-process the entities in an entity's Start event, which, while it's correct that it's being executed at each Start event, from a verification perspective it is really lightweight and I gain ThingWorx's flexibility (it's faster to write that JavaScript and use the snippets available in the service editor than using them in Java).
A migrator gets executed automatically as the first step of the "Import from ThingWorx Storage", essentially being a "pre" type hook in the import process.
Beware that it's only executed in the case of "Import from ThingWorx Storage" - it is not executed automatically during the Extension installation process.
Its role is to allow you to pre-process entities that were created with a previous version of the extension, at import time (eg: execute model changes).
The use-case when this is useful is not encountered extremely frequent and it's documented in this document, page 46.
From what I observed, the Migrator class is a relatively unused part of the ThingWorx Extension SDK.
I personally post-process the entities in an entity's Start event, which, while it's correct that it's being executed at each Start event, from a verification perspective it is really lightweight and I gain ThingWorx's flexibility (it's faster to write that JavaScript and use the snippets available in the service editor than using them in Java).
Hi Vladimir,
Thx for your comment. It is exactly what we do. But i was wondering if this Migrator was the right way to update entities after change. Seems to not be the case.