Data Modeler
Data modeler is a module that lets end users create a data hierarchy such that it will be stored in the system and can be used in the application. This data can be business related as well as for intermediate calculations. User can create the following:
- Entity (Business Object)
- Data Model (Business Model)
- Enumeration (LOVs) – For LOV elements (Radio Button, Checkbox, LOV Slider, Dropdowns)
To create the business object, business model, and enumeration, you can access the Data Modeler module as follows:
- On the Vahana portal’s home page, see the top panel.
- On the top panel, click the VDLC icon to display the context menu.
- On the context menu, go to Design & Architecture>Data Modeler to display the Data Modeler page.
Entity
An entity is a collection of information defined as a single unit. To store a data as a JSON data type (key/value pair, JSON array, JSON object), you define an entity. A user can create multiple entities which he/she would like to use in an application. These entities can be as small as a page or complex for an entire journey. In an entity, the size and type of the JSON data structure depends on how you want to display the data in the application.
To manage data at the application-level, entity serves as a virtual container. It can store the data in the following ways:
- A key/value pair
- A JSON object that contains a set of key/value pairs
- A JSON object that contains a set of JSON arrays; in the JSON object, each array contains a set of key/value pairs.
Note:- In the Data Modeler module, in an entity, you cannot define the JSON array as the top-level data structure. To define an array, you need to define the JSON object as the top-level data structure and then define an array or set of arrays in the JSON object.
There are two types of user defined entities that are created for an application on Vahana Cloud.
- Business Entity (Entity Store):- Business Entity is the core of any application, and all structure of all business-related data will be defined here.
- Temporary Entity (Temp Store):- Temporary Entity as the name suggests is used for intermediate calculations and it only persists till the session lasts. These parameters will be used in tasks and events only in vDesigner.
Creating an Entity
- On the Data Modeler page, see the top panel.
- Click Data Modeler
- In the top panel, click Create Entity to display the Create Entity dialog box.
- In the Create Entity dialog box, enter values in the following boxes and list:
Field Name | Description |
Key | In this box, define the key (key name) of the entity (for example, tiny_ent). After you define the entity’s key name, the Name box also displays the same key name. You can also define another name of the entity in the Name box. In the Key box, the entity’s key (key name) (for example, tiny_ent) is used as a name identifier to manage the entity in the Data Modeler module. |
Name | This box automatically displays the key name of the entity after you enter the key name in the Key box. You can also enter another name of the entity in the Name box. The name of the entity that you enter in the Name box is displayed as the entity’s label name in the vDesigner module. |
Entity Type | When you click this list, you can select one of the following values: 1. Temporary Entity:- This lifespan of this entity is short-lived. These entity are used for the calculation purposes. 2. Business Entity:- In the Data Modeler module, the business entity stores the business-related data. |
Tags | In this box, enter a random value (for example, entity_for_vDesigner). You can use a tag to manage an entity or group of entities at the Data Modeler level. In the details of the entity, a tag works as an identifier that you can use to find one or more entities. |
Description | In this box, enter a brief reason to create the entity. |
- After you enter the details of the new entity, click Create to create a new entity.
Defining JSON Structure in Entity
After you create an entity, you can define a JSON structure so that it can store the data. You can define a JSON structure based on the functional requirement of an application. You can define a JSON structure that contains the following:
- A key/value pair
- An object that contains one or more key/value pairs
- An object that contains a set of JSON arrays; JSON arrays also contain key/value pairs
To define the JSON structure:
- On the Data Modeler page, click the Entity tab to display the list of entities.
- In the list of entities, search and find the entity.
- After you find the entity, double-click it to display the <entity name> page.
- On the <entity name> page, in the Input box, define the JSON structure as follow:
Sample JSON Structure with Key/Value Pair
When the application executes the related custom function or task (for example:- load entity), it will consume or display the value of the ID key.
Sample JSON Structure with the JSON Object
In this JSON structure, the user has defined a JSON object named emp_details. Assume, you want to copy the data in the application by using the Copy Data task. You can select the entity in the smart selector, as shown in the following screen:
Sample JSON Object with Array
It is a capability of the entity model in the Data Modeler module that it can support and manage a complex JSON structure, such as a JSON object that contains an array or a set of multiple JSON arrays. You can define the complex JSON structure and then manipulate data in it.
In the above screen capture, you can see that the JSON structure contains the emp_details object as the top level data type. In the emp_details object, the user defined an array named emp. The emp array contains ordered key/value pairs with the keys named id, name, and status.
After you define the JSON structure in the entity, click right-arrow () to display the output in the Output box. If the Output box displays the output, it means that your JSON is valid. Thus, you can use the JSON structure to manipulate the data at the application level.
Data Model
A Data model is an empty variable that contains the data in the structured format. To store and manage the data in a structured manner, you can define an entity or enum data type. After you create an entity or enum, you need to link the entity or enum to the data model. Like an entity, you create a data model, link it to the entity or enum, and then link the data model to the application. Linking the data model to the application establishes the connection between the front-end and front-end supporting data layer.
Creating a Data Model
You can create a data model as follows:
To create a data model:
- On the Data Modeler module’s home page, see the top panel.
- In the top panel, click Create Data Model to display the Create Data Model dialog box.
- In the Create Data Model dialog box, enter or select values in the related fields as follows:
Field Name | Description |
Key | In this box, define the key (key name) of the data model (for example, datamdl_ent). After you define the data model’s key name, the Name box also displays the same name. You can also define another name of the data model in the Name box. In the Key box, the key (key name) (for example, datamdl_ent) of the data model is used as a name identifier to manage the data model in the Data Modeler module. |
Name | This box automatically displays the key name of the data model after you enter the key name in the Key box. You can also enter another name of the data model in the Name box. The name of the data model that you enter in the Name box is displayed as the data model’s label name in the vDesigner module. |
Tags | In this box, enter a random value (for example, datamdl_for_vDesigner). You can use a tag to manage a data model or group of data models at the Data Modeler level. In the details of a data model, a tag works as an identifier that you can use to find one or more data models. |
Description | In this box, enter a brief reason to create the data model. |
- After you enter details of data model, click Create to create a new data model.
Linking an Application to a Data Model
After you successfully create a data model and link one or more entities to the data model, you need to link that data model to the application. After you link an application to the data model, you can store and manage the data in the data model-linked entities and enum objects.
- Click on the 9 Dots icon on the right panel & click ?Applications?
- Click ?Create App?
- Select ?Mobile App?
- Enter details & click ?Create?
- Once the application is created, double-click on the application & click ?Info?
- Go to ?Data Model? section & click on “Link data model”
On the right panel, click ?Link Collection? under ?Collection?