Live Preview (Strategy Designer)
The Live Preview function allows you to see the calculated results of your strategy, snippet or data lookup in real-time. It also provides useful validation messages in case your workspace is not properly configured. The panel with the Live Preview is located on the right side of the user interface. By default, it is hidden, and you have to expand it by clicking on the arrow button.
You can switch between the Preview and Code tabs:
Preview – Allows you to perform a simulation of the current strategy.
Code – Shows the code generated by the strategy. This tab is for development and debugging purposes only. Business users should not pay much attention to it.
The Preview panel is divided into two main parts: Inputs and Results
When previewing an active strategy, you can choose to between using the current or the latest versions of snippets and lookups. By default, an active strategy calculates based on the snippets and lookups that were in place when it was activated. However, if you've already created a draft for a new version of a snippet or a lookup, you may want to preview the strategy with that version instead. To do this, simply click the toggle to switch to the latest versions.
Inputs
This section contains the inputs required to run the simulation. Some inputs are generated only if the strategy requires them.
Product ID – Select a product to simulate the strategy with. Required input, although some strategies and data lookups might not need it.
Dependency Level – Select the dependency level to simulate the strategy with. Partitions with an older version of PSP (<2.4) support only independent levels.
Target Date – Select a target date to simulate the strategy with. If not specified, today’s date will be used.
For Snippet Live Preview, each Snippet Argument will generate one input here.
The following inputs are only generated if certain blocks are present in the workspace:
Simulated price from the current list – Required if the Get price from the current list block is in the workspace. Because this block triggers a second-pass calculation, it cannot be simulated easily. The value from this input will be used for the simulation of this block’s value.
Simulated kit price – Required if the Calculate kit price block is in the workspace. Calculating the kit price also requires a second-pass calculation so we simulate it instead in the live preview.
To calculate the strategy, click the Calculate button. The button will be enabled only if all the required inputs are filled. Once filled, the strategy will be automatically recalculated when the workspace changes.
Result
The first table always shows the calculated result price of the strategy. The price is always rounded to two decimal digits. Hover your mouse over the price to see the non-rounded price.
Underneath the price, there is a total calculation time (ms).
Intermediate Results
All the tables below show calculated results of each meaningful block in the workspace, such as variables, product attributes, PSP attributes, and data lookups. This gives you the possibility to debug your strategy in real-time.
Validation
If the workspace is not properly configured, the Live Preview panel will show validation errors instead of results. In such a case, you will not be able to see the simulated price or the code until you fix the errors.
You can click the eye icon to highlight the offending block in the workspace.