- A variable is the basic buildig block for managing client state. It is of specific type and exists in a specific scope.
- A variable type can be primitive(string, boolean, number, etc), a structured(an array or object), dynamic type(any) or a builtin type(service data provider or array data provider).
- It stores intermidiate state on the client between the visual builder user interface and the rest services. Components are principally bound to these variables and the behavior of the variables is governed by actions.
- Intial value of a variable is determined using the defaultValue property set on the variable.
- When a variable value changes, a variable emits an event, this event may trigger an action chain.
- Constants are a type of variable of the constants namespace and are used to store values tgat do not need to change over time such as company name or measurement conversion value.
- We can use a variable to pass a parameter between the pages. We can mark a page variable as an input, specifying how it becomes part of the contract in order to navigate to that page.
A Scope defines the lifecycle of a variable and teh framework automatically creates and destroys tge variable depending on the semantics of the scope.
Page scope: state is accessible only wihin the context of the specified page.
Application scope: state is accessible in all parts of the application and in all pages.
Flow scope: state is accessbile in all pages contained in the current flow.
Action chain scope: state is accessible in the current action chain.
A variable triggers >> onValueChanged event whenever it is modified. >> the event can trigger a user defined action chain
No comments:
Post a Comment