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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

How to run a Custom Widget in Eclipse IDE

MM_10109894
5-Regular Member

How to run a Custom Widget in Eclipse IDE

Hello All,

 

I'm trying to develop a custom widget. After my code changes, I use to import the extension file into TWX Composer and test it.

This process takes time for each minor change.

Is there any other option to run in Eclipse IDE level and test it?

 

-MK

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

You could potentially do this, but you'd need to have a very good separation of your widget code from code that could run independently. Even then, you wouldn't be able to fully test your widget since the parts that depend on the Thingworx runtime won't run outside of it - just the parts that don't directly depend on Thingworx.

 

Alternatively, you could consider using a build script such as the one used by this widget which contains a task that increments the extension version, creates the zip package and uploads the extension to Thingworx. This way you could just assign that task to a build shortcut (e.g. ctrl+b) and use it to quickly deploy your changes to the Thingworx server for testing. Additionally this would let you use a different javascript ide if you prefer, such as visual studio code.

 

Another option, though more complex, would be to use a template such as demo webpack widget that has a series of tasks predefined but is a completely different way of building widgets that is not supported by PTC.

View solution in original post

4 REPLIES 4

Hello @MM_10109894 ,

 

pls check the below given link of the thread having same issue:

 

https://community.ptc.com/t5/ThingWorx-Developers/Custom-Widget-not-displaying-in-runtime/td-p/520767?posno=1&q=custom%20widget%20in%20Eclipse%20IDE&source=search

 

Kindly revert back if you have any further queries.

 

Regards

Bhawna

Hello,

If you are using Ant to build the JAR, you can try to update Ant file in order to include:

It is still not testable inside Eclipse but you will gain a lot of time.

Hope it helps.

You could potentially do this, but you'd need to have a very good separation of your widget code from code that could run independently. Even then, you wouldn't be able to fully test your widget since the parts that depend on the Thingworx runtime won't run outside of it - just the parts that don't directly depend on Thingworx.

 

Alternatively, you could consider using a build script such as the one used by this widget which contains a task that increments the extension version, creates the zip package and uploads the extension to Thingworx. This way you could just assign that task to a build shortcut (e.g. ctrl+b) and use it to quickly deploy your changes to the Thingworx server for testing. Additionally this would let you use a different javascript ide if you prefer, such as visual studio code.

 

Another option, though more complex, would be to use a template such as demo webpack widget that has a series of tasks predefined but is a completely different way of building widgets that is not supported by PTC.

I am doing it very similar to how BogdanM suggested.

I added in my ANT task dependency chain 2 tasks that increment the version, then, after packaging, it uploads the widget to ThingWorx.

 

Top Tags