Wednesday, April 24, 2024

VBCS - Understand variables

  1. A variable is the basic buildig block for managing client state. It is of specific type and exists in a specific scope.
  2. 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).
  3. 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.
  4. Intial value of a variable is determined using the defaultValue property set on the variable.
  5. When a variable value changes, a variable emits an event, this event may trigger an action chain. 
  6. 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.
  7. 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

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...