Decision centers

In Netsilon, decision centers, that link web elements together, are used as points of variation that dynamically construct the appearance of page or select a target page according to business rules. There are several kinds of decision centers: presentation decision centers, navigation decision centers and utility decision centers. A decision center is embedded in one or more web elements and is located by a label specific to Netsilon in the HTML formatted text associated to the web element. During execution, a decision center will embed or jump to an element from an ordered list of target web elements according to the first business rule (constraints expressed in Xion) that can be fired.

A decision center is generated as a target language file in the where its target web element is created unless it is shared, in which case it is generated in the root folder.

Label syntax

A decision center is identified by a unique number in a subsystem. That number must be specified in the associated label of the decision center. The name of the decision center is optional and is not taken into account. If parameters should be transmitted to the decision center, they must be coded as key=value pairs, separated with white spaces and encoded as specified in the URL encoding specification.

A label must begin with !-!/objexion/, followed by the unique number of the decision center, optionally followed by a space and the name of the decision center (with no spaces), optionally followed by a sequence of pairs key=value separated by white spaces and ended with /.

Here is a corresponding regular expression expressed in Perl :

!-!\/objexion\/(\d*)(\s+([^\s=\/]+))?((\s+\w+=[^\s\/]*)*)\s*(\/)

Examples:

For a decision center named "entry Discrimination" with number 10

!-!/objexion/10/

!-!/objexion/10 entryDiscrimination/

 

With parameter "newtopic" with value "03b2197a5f99128b0c0324b288f3d899"

!-!/objexion/10 newtopic=03b2197a5f99128b0c0324b288f3d899/

!-!/objexion/10 entryDiscrimination newtopic=03b2197a5f99128b0c0324b288f3d899/

 

With parameter "color" with value "light gray"

!-!/objexion/10 newtopic=03b2197a5f99128b0c0324b288f3d899 color=light%20gray/

 

Entry context

Inherited variables

A decision center has access to every variable defined in the entry context of the web element in which it is embedded. The scope of a modification made to a non-session variable is the decision center itself. However, the modification made to a session variable is reflected on the following decision centers. The decision centers are ordered according to the position of their label in the HTML formatted text.

If a decision center is shared between two web elements, only the variables common to the entry contexts of those are visible. Moreover, if two variables bear the same name but have different types:

  • if the types are conformant, the common super type is applied to the variable
  • if not, the variable is not visible.
Local variables

A decision center can define local variables that are visible in its entry action and in its expressions.

Normal local variables must be initialized in the entry action.

Local variables can be set as User defined in which case they are initialized with the value that is extracted from their corresponding parameter in the URL, label or form context used to access this decision center. The value is automatically converted from its string representation to the type of the variable. In case of a collection type, values defined one or many times are inserted in a newly created collection. User defined variables may be used to get values posted by a form.

Entry action

Almost every decision center has a (possibly empty) entry action. Entry actions are written in Xion and are executed after the entry context has been elaborated and before any expression is evaluated. Entry actions have access to the variables in the entry context (inherited web element context and local variables) and to the business model. Variables defined in the entry action are only visible in it.

Target web element selection

A decision center can be linked to several target web elements (fragments which take part in a composition, pages to jump to). These web elements are ordered in a list and provided with a constraint which makes it possible to express a business rule and which if it is evaluated to true, selects inclusion or the jump towards this element. The first constraint evaluated to true selects the web element and stops the evaluation of the following constraints. A decision center can be linked to a web element with a default decision constraint that always evaluates to true and is fired when no other constraint has been fired.

A constraint is expressed in Xion and must return a value of type Boolean. This expression has access to variables in the entry context (inherited web element context and local variables).

All the variables of the entry context of the target web elements which do not have a default value and are not private must be initialized using expressions which have access to the entry context of the decision center. Public variables with default values may also be initialized.

 
TOC ] Previous ] Next ]