cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Does anyone know what is an "Extension Migrator" for ?

cbaurand
12-Amethyst

Does anyone know what is an "Extension Migrator" for ?

Hi,

 

All is in the title.

 

Thanks,

 

 

 

ACCEPTED SOLUTION

Accepted Solutions

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).

 

 

View solution in original post

2 REPLIES 2

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. 

Announcements


Top Tags