Skip to main content
1-Visitor
May 26, 2022
Question

Automatically reload the mashup after ThingWorx is up and running again.

  • May 26, 2022
  • 1 reply
  • 1283 views

We have a Test mashup which is opened in runtime and we restarted the Tomcat and the ThingWorx is down. Can we automatically reload the Test Mashup in runtime once again after the ThingWorx is up and running again? Is there any way to do so?

1 reply

22-Sapphire I
May 26, 2022

There is location.reload() that you could use, but the bigger challenge is what to use to trigger it.

You could perhaps have some push to the mashup from the server (GetProperties - Push when data is updated) and monitor that using a timer and an expression or validation widget that fires into the reload, however that wouldn't capture if ThingWorx is up and running again.

Not so sure you can do some sort of 'ping' command from the expression widget.

adiku1-VisitorAuthor
1-Visitor
May 27, 2022

@PaiChung Hi Pai, Thank you for answering my question. Can I use ThingStart event of ThingWorx in which I am changing the property value and triggering the mashup.

22-Sapphire I
June 1, 2022

The problem is that once ThingWorx goes down, your session to the mashup ends and any 'push' connection is closed.

So even though ThingStart is a great way to detect the startup of ThingWorx there will be no path to notify the Mashup.

There may be some custom approach where you build in something into the mashup that 'pings' the server, but I've never tried anything like that.