Home > Platform > SolutionBuilder Guide > Layout Designer > Layout Data Model Designer

Layout Data Model Designer

08 Dec 2017Last updated
0votes
28updates
88views

Overview

The Data Modeler is a special area of Layout Designer for describing the Layout Data Model.

Data Model is a unified set of various data which are required for the Layout rendering and execution. The whole Data Model represents the collection of Data Sources, each of them is a portion of data obtained from one single source (e.g. from Web Service response, or from single SQL query execution, or Data Layer request) in scope of the one transaction (request). By defining the right Data Sources with the right scope, it is possible to achieve dynamic Layout Data Model, which dynamically actualizes only minimal Model scope (only one Data Source) , without reloading the whole Model.

Besides the declaration of Data Sources, the main purpose of the Data Model is to setup relations between Data Sources, and define rules of how the Data Sources are changed (updated) depending on various conditions, such as user input or received data from another Data Source.

Principles

Data Sources

Each Data Source, regardless of its type, has input (1), output contacts (3), and system properties (2).
image.png

In the picture above, the typical "GetCategoryInfo" Data Source which integrates the result of the Web Service execution to Layout Data Model is presented. In this case, the Data Source has only one property as Input contract (categoryId), and two properties Priority and Summary as output contract.

The input contact is a list of Data Source properties which defines the Data Source data. They are similar to input arguments of a function, or query parameters of the SQL Query. Once the input contact (at least one) is changed, the System invalidates the related Data Source and tries to reload the relevant data for new input arguments, or, in our example, once the categoryId is changed, it causes the whole Data Source reload, and as a result of the update of the output properties Priority and Summary to corresponding values.

 

Data Source System Properties

$sourceState

Integer. Signals the current state of the Data Source.
0 - Initial, no request to obtain data is sent, output data is not present; 

1 - loading, the request to obtain data has been sent, but no data received yet; 

2 - loaded, the data relevant to current input contact are loaded to output contact; 

3 - rejected, the failed state of Data Source, means the Server reject the request for data

$inactive Boolean. Gets or sets the availability of the Data Source. If True, no requests are sent to Server to actualize the Data Source, regardless of changing the input contact
Note

Using $inactive attribute can help in cases when the Data Source has a lot of input properties, and setting them is a step-by-step interactive process (e.g. Wizard steps). To avoid multiple requests, a Server provoked by any single change, it makes sense to deactivate Data Source on the begging, and make it active again when all properties are set.

Data Source Property

A Data Source consists of a list of Properties, each  of them could be bound with some UI control property, or with another Property in data model. 
Click on a property to display the available artifacts at the bottom of the Data Model view:

 

Property.png

 

Title Localized display name of the Property. Present only in cases when the related Data Source provides such metadata description. E.g. "Data Definition" or "Entity" Data Sources are extracting this information from Schema metadata, and delivers these data to Solution Builder.
Type Indicates the data type of the Property. The Type is used to build a relevant list of properties available in Layout Designer. E.g. on binding the Data Model Property to DateTime Picker control value, only properties with type Date Time will be available.
Reference Describes the Database relation Data Definition. Available only for properties associated with the Schema Relation or Pickup value.
Direction Describes the purpose of a property. IN - signals the property is input contact of a Data Source, OUT - shows the value of the property is obtained from Server.

Changing Property value

Model-View-Controller pattern used in Layout Designer presumes the Data Model in any single moment of time is up-to-date and does not require additional preparations to be submitted. It means the System should react to all possible events, like User interaction or some Service response, appropriately and immediately actualize the whole Data Model to bring it to normal state.
There are several ways how the System can affect the Property value:

 

1. User interaction (input)

Place an input control on Layout Designer Canvas and bind the control output value with the appropriate Data Model Property. Once the user opens the Layout and starts entering data into the control, the provided changes are immediately reflected in the Data Model property value.

 

2. Data Source reload

Changing the DataSource input contacts causes the reload of the whole Data Source and update of all Output properties

 

3. Associate the Property with another Property

The System allows to setup a relation to another Property. Once the associated property is changed, it immediately changes the Property value. For example, in Wizards the property Context.ObjectIds keeps the IDs of the selected Objects for which the Wizard is started. The Wizard on submit calls a Web Service which as input contact has an array of affected object ids. In this case the WebService.IDs property can be easily associated with Wizard Context.ObjectIds.


To setup a relation: 

  1. Select the Property in Data Modeller you would like to associate. 
  2. Click "Edit" in Property details view.
  3. In the Dialog that appears, click the "TAKE VALUE FROM" button and pick the needed property.

Assign2.png

4. Calculated Property

In many cases, the value of the property depends on values of several related variables, and needs additional calculations. For all such cases, the Advanced Mode of the Calculated Property can be used. Just like for the "Associate Property" (1) case, you need to select the Property the value of which needs to be moderated, and click the "EDIT" action for it. At the top of the dialog, select the “Advanced Mode” radio button. 

CalcField.png

In the picture above, the example of the definition of the eMail property is present. The value of that Property relies on values of two other Properties, FirstName and LastName. Use the ADD button (2) to add new relations to other properties.

Data Source Types

Solution Builder provides a wide range of various kinds of Data Sources which allow to incorporate the data into the Data Model from different sources. At that moment, you have the following options:
 

Entity (Configuration Item) Data Source

Add a single object of the specified Configuration Item to the Data Model. 

 

Data Definition Data Source

Web Service Operation Data Source

Data Query Data Source
 

Context Data Source

Is a predefined Data Source the single instance of which is present in Layout Template of any kind. By default, the Context provides a set of Environment variables which can be useful for Layout authoring.
 

Context Predefined Properties

CurrentUser ID of the interactive user
ApplicationName Technical name of the active UUX Application
Object  

 

You must to post a comment.
Last modified

Tags

This page has no custom tags.

Classifications

(not set)
Customer
(not set)
icons-access-c.png