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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Adding an entry to Datatable when extension is imported

vranganathan
10-Marble

Adding an entry to Datatable when extension is imported

I am developing an Thingworx Apps. To have them in Console page (Thingworx Utilities), we need an entry in a data table. I want to add an entry into the table programmatically when I import my extension. How do I do it? I have the code which can add an entry to the datatable. Not sure how to run it when I import the extension. Any thoughts?

5 REPLIES 5
smanley
13-Aquamarine
(To:vranganathan)

There may be a way to create a custom wrapper service that simply makes a post to the ExtensionPackageUploader REST service and passes the extension as a binary parameter. You could then use an event from this service to trigger the add entry service. The URL to make the post to would looks something like this: http://<server>/Thingworx/ExtensionPackageUploader.

I am wondering how do I know when the extension is successfully imported. This is where I am stuck. Once I know that, I should able to trigger it. Not sure is there any document explaining the lifecycle of extension loading process with custom entry points.

Thanks,

Varathan

ankigupta
5-Regular Member
(To:vranganathan)

Hi Varathan Ranganathan​,

I am not sure if any event is fired when there is a successful extension import.

You can try to use timer event and check at some interval regularly for GetExtensionPackageList service of PlatformSubsystem. So, if there is any change in count; we call call our custom service to update the DataTable.

Could you please explain how are you using the DataTable in Utilities? A better way would be to use GetExtensionPackageList service of PlatformSubsystem directly and show the current data.

We can create a custom Service with GetExtensionPackageList service wrapped and show the Data according to our requirement.

I think it is one possible option. I am adding a Tile for my custom application to the Manufacturing Solution. Thingworx Utilities also has this concept.

Thanks,

Varathan

I achieved it through ThingStart event. I was able to add an entry into datatable, create token update configuration. After successful completion, the subscription will disable itself. It works just fine.

Top Tags