How to manage referential BDM Data
Learn how you can create, edit, delete referential Business Data and bulk import data.
-
Difficulty: beginner
-
Estimated time: 20 minutes
-
Prerequisites: following the how-tos below will help you to understand this guide:
Context
Bonita 2025.1 introduces new APIs to create, update, delete and import referential Business Data.
The import operation allows to upload a CSV-formatted file containing referential Business Data to import into the BDM.
In this guide, we will focus on how to configure a Table widget to create, edit and delete Business Data, bulk import data, and many other things.
Display and update referential Business Data
Create a new page in Bonita UI Builder and drag and drop a Table widget onto the whiteboard. Name it BDM_list
.
Configure the Table widget to allow update and delete operations, and allow to add new rows.
Remember to read the "create an editable table" how-to to see UIB screenshots. See also the following guides in Appsmith documentation: |
Create Queries
Go to Queries
section and create a new query/API.
For all queries, add a single line the Headers:
-
key: content-type
-
value: multipart/form-data
Retrieve all existing Business Data from the BDM.
Name: BDM_get_all GET /bonita/API/bdm/businessData/<name_of_the_bdm_entity>/?p=0&c=10&q=find
Create a new Business Data entry
Name: BDM_create POST /bonita/API/bdm/businessData/<name_of_the_bdm_entity> Body - type: JSON - content: create an object with the attributes of the Business Data Model entity
Use the {{BDM_list.newRow}}
object to access to the new row data in the Table widget.
Update an existing Business Data entry
Name: BDM_update PUT /bonita/API/bdm/businessData/<name_of_the_bdm_entity>/{{BDM_list.updatedRow['persistenceId']}} Body - type: JSON - content: create an object with the attributes of the Business Data Model entity
Use the {{BDM_list.updatedRow}}
object to access to the selected row data in the Table widget that
Use the Queries in the UI
Configure the Table widget to use the queries created above.
-
Table Data:
{{BDM_get_all.data}}
-
Adding a row: bind Adding a Row onSave event to
BDM_create.run
and on success, execute queryBDM_get_all
-
Editing a row: bind
onSave
event toBDM_update.run
and on success, execute queryBDM_get_all
-
Deleting a row: bind the delete button
onClick
event toBDM_delete.run
and on success, execute queryBDM_get_all
Bulk import referential Business Data
Here, we want to upload a single CSV file time using a FilePicker
widget in the Bonita UI Builder and perform a bulk data import.
Remember to read the perform file upload how-to to see UIB screenshots. |
Use a FilePicker widget
To do so, drag and drop a FilePicker
widget onto your interface and configure it as follows:
Then, use this specific widget configuration:
-
Data Format:
Text
-
Max no. of files:
1
Also add a Reset
and Submit
button to your interface.
Create a file upload Post request
Go to Queries
section and create a new query/API.
Assuming that the name of the FilePicker widget is FilePicker1
, the query should be configured as follows:
POST /bonita/API/bdm/businessData/<name_of_the_bdm_entity>/import Headers: - key: content-type - value: multipart/form-data Body - type: MULTIPART_FORM_DATA - key: dataset - value: ${FilePicker1.files[0]}