# Data model in the process

In order to be able to use **the data model** in the process, the following steps must be taken:

1. **Create the data model.**
2. **Bind the data model keys bidirectionally with the application**\
   (details described in the section [*Data model on the interface*](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/praca-z-komponentami-bazowymi/model-danych-na-interfejsie)).
3. **Run the application with the assigned data model.**

After completing the above steps the data model is available in the process.

***

### Where can the data model be used?

The data model can be used in:

* **script tasks**,
* **userTasks**,
* **subprocesses**.

***

### Limitations — where do model keys not work?

Data model keys **do not work** in:

* BPMN gateways,
* script **BPMN ScriptTasks**.([BPMS script task (scriptTask)](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/proces-biznesowy/zadania-automatyczne/zadanie-skryptowe-bpms-scripttask))

If we want to use model data in these BPMN elements, we must **map them to process variables**.\
More information in the section [*Passing data to the process*](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/proces-biznesowy/przekazywanie-danych-do-procesu).

***

### modelInstanceId – access to the model instance

A process that uses the data model automatically receives a variable:

**`modelInstanceId`**

This is the identifier of the data model instance where the model values are stored.\
All operations on the data model during the process use this variable.

***

### Script tasks

A detailed description of using the data model in script tasks can be found here:\
[Script tasks API](https://docs.eximee.com/documentation/documentation-en/logika-biznesowa/scriptcode/zadanie-skryptowe-scripttask/api-zadan-skryptowych#model-danych) and  [Data model API](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/model-danych/wykorzystanie-modelu-danych/api-modelu-danych).

***

### UserTasks

In UserTasks using the data model consists of using model keys the same way as in the section  [Data model on the interface](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/praca-z-komponentami-bazowymi/model-danych-na-interfejsie).

***

### Subprocesses

To use the data model in a subprocess:

1. Pass the variable to the subprocess **`modelInstanceId`**.
2. The variable name **must be identical** to that in the calling process.
