Skip to main content
6-Contributor
March 30, 2022
Solved

How to run a Custom Widget in Eclipse IDE

  • March 30, 2022
  • 4 replies
  • 1864 views

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

 

 

Best answer by BogdanM

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.

4 replies

5-Regular Member
March 30, 2022

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

14-Alexandrite
March 30, 2022

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.

BogdanM1-VisitorAnswer
1-Visitor
March 30, 2022

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.

19-Tanzanite
March 31, 2022

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.