Price Setting Configuration Wizard - Technical Design
This document is for maintenance and upgradability. Do not publish it to users.
The user manual for the Price Setting Configuration Wizard can be found at Configuration Wizard (Price Setting).
In this section:
Screen Map
Components
Generic logics
PSP_ConfigWizard
PSP_ConfigWizardExecutor
Libraries
PSP_ConfigWizardScreenFactory
PSP_ConfigWizardCommonLib
General Calculation Flow
PSP_ConfigWizardScreenFactory Library Structure
Each element in the library represents a screen, with proper naming.
Syntax to get a factory element: Script screen = libs.PSP_ConfigWizardScreenFactory[currentScreen]
Syntax to get a screen instance: libs.PSP_ConfigWizardScreenFactory[currentScreen].getInstance()
Syntax to get a screen DB update handler: libs.PSP_ConfigWizardScreenFactory[currentScreen].processChanges()
Element Structure
Must have these public methods:
Map getInstance() – To produce configurator entries set for the screen from a predefined scheme and handled businesses.
void processChanges() – To update values to DB (if any).
Scheme Format
Must have _currentInstanceName hidden configurator entry, with fixed value as the current screen name.
Must have current screen instance-id hidden configurator entry. This is to determine whether the screen is a first-time run.
Each input has a properties map. Supported properties:
type – Typically InputType.X, but can also be null. Null means that the result after rendering is a text line, not an input.
label – String, the input label.
defaultValue – Object, the value of the input on the first time run.
value – Object, fixed value.
readOnly – Boolean, disables the input from entering a value.
required – Boolean, the user has to set the input to a valid value to proceed with the wizard.
valueOptions – List, the options of a dropdown list input or a radio button input.
valueLabels – Map, the labels of the options of a dropdown list input or a radio button input.
value labels structure – [option value 1: option label 1, option value 2: option label 2, ...]
noRefresh – Boolean, to prevent logic from rerun when an input value has changed.
message – String, to show message / HTML string instead of a regular input.
Scheme:
Example
The ModuleSelection element structure is as follows:
PSP_ConfigWizardCommonLib Library Structure
A set of predefined utilities which consists of:
Constants – Contains constants used throughout the wizard such as common input labels,…
HTMLDescriptions – Contains HTML constants used throughout the wizard.
HTMLDescriptionUtilities – Contains HTML handler methods.
Errors – Contains error handler methods (temporarily unused).
ScreenStateUtilities – Contains configurator entry state modification methods, such as set a CE input value, properties,…
InputBuilder – Contains configurator entry builder methods, to build a CE from a predefined scheme.
DataUtilities – Contains database-related methods, such as fetching configuration data rows,…
SchemeUtilities – Contains methods for common scheme manipulation/parsing, with business handling.
ModuleUtilities – Contains methods for common module-related operations, with business handling.
NavigationUtilities – Contains methods for common stuff related to handling screen navigation.
InputUtilities – Contains common methods that provide data for a dropdown input, validate an input value, handle common business operations,... Typically they are for inputs that have dynamic data/properties based on the user interaction (eg. checkbox selected by user unlocks some input fields).
Screen Instance Flow
The following chart is for a typical data source configuration screen. Depending on businesses, it may get different between screens.