The WEM Preview Environment is the Development-Testing part of the WEM Modeler.
Just hit the Preview Button in the top-menu bar, and see your Project in action!
The WEM Preview environment brings all your settings, flows, nodes and fields together with the selected design to show the application in action and enables you to make and review changes without the need to publish.
When started, Preview opens a new browser window and loads your project information directly from the Modeler repository. In the background, a database container for the Preview-Runtime will be created (when starting the Portal in Preview for the first time) or updated with the latest changes to permanent lists and their fields. Data stored in permanent lists during Preview Sessions will then also be available in other Preview sessions.
A Preview Session of any project can only be started from the Modeler.
The Preview is only available to Modeler Users with access to that project.
Any Preview URL which is accessed by other people (if a link is shared in some way) will not work and will show a message stating [No debug session].
You will see this -no debug session- message also if you copy the preview link and use it in a different browser (for example you start in Edge, and copy the link to open in Chrome). But having multiple preview pages is not practical at all, so just keep using one Preview session that is started directly from the Modeler.
Using a technology called Comet Messaging (wiki), WEM makes it possible to exchange information between the Modeler session and the Preview session started from that Modeler session. This way, while Previewing your application, it is possible to:
Push changes from Modeler to Preview without reload:
Make any change in the Modeler and you'll see it work in Preview almost immediately (depending on the change) without restarting the Preview session. For example if you add a text, button or other visual element to the Interaction Template: after saving that Template in the Modeler, the changes will be sent to the connected Preview session and you will see the added element appear.
Changes that have been made to flowchart-nodes only occur as you pass through these nodes. So any changes that have been made to nodes that have been passed before reaching the current active node in the Preview, will only be executed if they are passed through again, which can be done with a menu item or a button.
Access current Preview State in Modeler:
When Preview is started from the Modeler, a Debugging panel appears at the bottom. This panel provides access to the information in the Preview Session using Expressions: put any field into the Expression to see its value in Preview, or do a Count([list]) to see how many values there are in a certain list.
The button [Goto current node] does exactly that: it opens the flowchart and selects and highlights the node which is currently active in the Preview session.
The Preview Debugging panel appears at the bottom of the Modeler
The Comet connection between Modeler and Preview may get broken sometimes for many reasons. When that happens, you will see for example that when you use the Goto current node, you will not end up at the correct node that you see in Preview, or when you try to check a value using an expression, you will not get any result.
In that case, it is necessary to start a new Preview session in order to create a new Comet connection between the Modeler and Preview sessions.
Use the Preview Environment to test how your application works, debug and improve "on-the-go" until you are happy and ready to publish your application and latest changes to the Staging and Live Runtime Environments to make it available to your end-users.
Because the Preview Environment is tightly linked to the Modeler and its main purpose is to directly show changes made in the Modeler and provide debugging information back to the Modeler, it works a bit slower compared to the Published Runtime Environments.
The performance of the application in Preview is absolutely no indicator for performance expected in the Runtime. The Runtime is very specifically optimized for speed, performance and high usage.