Adding new Entity to Database from MainPage

Hi,

I have an application, that should add one row (entity) into the business data modells datatable, but from the main page.
I tried creating an insert query, but probably that is not possible. My other approach was using rest api extension, I thought it would be as easy as creating a new entity in the studio, with groovy script, but all I could create is a simple object, it wasnt saved in the database.

I have a list of objects in a table, the object has another object. Lets say i have a human object, that has a dog object in it. When i select a human from the list, i want to add one or more dog objects to the selected human object. Of course i can do this in the main pages form, but i want to save this change in the database.

My question is, what is the best way of creating a new record in the business data model from the main page? (Not in a process) Is it possible?

Actually doing insert or update in to the business data managed by Bonita is only available from a process (this is a design choice). You don’t have API to do so and it is not possible to do it from REST API extension.

My suggestion would be to create a process with the appropriate contract, business variables default values and operations. Then from your application page you can call the Bonita engine REST API to instantiate this process and provide the appropriate value for the process contract.
Another alternative would be to define an instantiation form for your process and load this form in your application.