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?
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.
@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.
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.
It sounds like the biggest problem would be reauthenticating after the server restart. You could set up a custom authenticator or if you're running SSO, it may sign in automatically. You would need to set up a refresh in the mashup for it to recover once ThingWorx is back up.
What is your use case?