Define business data model (BDM)
The Bonita platform provides a means to define, manipulate and store your business data. This data management service will create Java objects to allow data manipulation, database tables for storage, and all operations required to get the data from your process into the database and vice versa.
Data management involves several steps:
-
Create the Business Data Model (BDM). This is the definition of the types of data you will deal with in your processes and applications.
-
Declare business variables in the process definition. Variables are used to make the link between your process definition and the data it needs to create, read, update, and delete. Data can be created as part of process execution (on start or on a task) but processes can also read and update data created by other processes and of course can choose to delete data.
-
Define process and task contracts. Contracts define the information process accepts from the user submitting the form.
In this chapter we will focus on the creation of the Business Data Model (BDM) only. Declaration of business variables is part of the next chapter. You can read the chapter about data handling for more information on data management.
In Bonita Studio, create a BDM:
-
In the Bonita Studio coolbar, click on New then on Business data model
-
Click on Add Object button
-
Type the object name Claim (objects name must always start with an uppercase letter)
-
In the Attributes table, click on Add button
-
Add 3 attributes (attributes name must always start with a lowercase letter):
-
description of type STRING and mandatory (check the checkbox in the mandatory column)
-
answer of type STRING, optional
-
satisfactionLevel of type INTEGER, optional
-
Save your work (Ctrl+S)
-
Click on Deploy button
Mandatory on a object attribute means that the object cannot be created with an empty value. If the mandatory option is not checked, it means that an object can be created with an empty value, for the attribute "not mandatory" (i.e. optional). In our example, the answer attribute is optional because at process start it will be empty. Later in the process execution, an employee will provide an answer and doing so will be mandatory (but this will not be enforced by BDM definition). |
When you edit the BDM in Bonita Studio, it is always recommended resetting the database after doing any modification on the model. Check the checkbox "Reset BDM database," available in the pop-up window display when you validate your modifications. |
When you click on the "Deploy" button different operations are performed:
|
Now you have a fully functional business data model. You are ready to move to the next chapter and start populating the database with data collected by the process.
Bonita Studio uses h2 to provide the database for testing. (We recommend you to use other types of databases such as Oracle, PostgreSQL, MySQL and SQL Server for production). You can also graphically explore the BDM database schema by opening the project explorer contextual menu of Business Data Model → Explore model (GraphQL voyager)…​ . |