8min

Working with Data Models

Use the Data Model Designer to create your custom data type. It helps you define the relationships between the data elements (attributes) you have, to give it a structure. Data models are a key concept in PROCESIO as they can be used to configure the data type of process variables.

Data model structure

A Data Model is an organized view of attributes and their relationships with other data models.ย 

Each data model has one or more attributes. Each attribute has a data type, either primitive or data model, which would effectively create a relationship between 2 data models.

Relationships consist of dependencies or associations between two data models. Thus a data model can have another data model as an attribute, describing the relationship between the two.ย 

Creating a data model

Here are the steps to create a data model and add attributes to it:

Step 1:ย  Go to the Designer panel and select Data Model Designer to access the Data Models page.ย 

Step 2:ย  Once on the Data Models page, select Create data model from the upper right corner.

Document image

Step 3:ย A modal screen will pop up where you must set a name for your Data model.

If you want to create several data models at this point, check the Add another option and hit Create. A similar form will be displayed to set a name for the following data model. ย 

Step 5:ย Press Create when done.

Step 6:ย The data model is now created and you can add attributes by pressing Add attribute.

Step 7:ย Define the Display Name, Type, and JSon Property.ย 

Note: the Type of an attribute can be a primitive (integer, string, boolean etc.) or another Data Model created upfront. This is how you can create Relationships between two or more data models.

Document image

If you want to create several attributes at this point, check the Add another option and click Create. A similar form will be displayed to set a name for the following attribute.

Step 8:ย Press Create button to complete the attribute definition. It will be listed within the data model you created.

Using a data model in a process

After you created a process you can add variables that have a custom data type that you defined in the Data Model Designer. For example, you have defined the data model Country like in the image below:

Document image

In the process designer, you can create the <country_var> variable that has the data type โ€œCountryโ€:

Document image

We can use the <%country_var%> variable in any action configuration, by selecting an attribute of the โ€œCountryโ€ data model:

Document image

When mapped to the property of an action, the format is <%variable_name%>.<data_model_attribute_name>, like in the image below:

Document image

๏ปฟ