Execute query from the process

1
0
-1

Is it possible to execute a query from the process that would run directly on a MySql database? How can we do that ?

Can we have the result of this query displayed on our webform?

if yes, how?

Thanks for your answer :-)

1 answer

1
+1
-1
This one is the BEST answer!

Hi,

Yes you can.

Depending on your use case, if you cant to query a Database from a process then you should the Database Connector to execute the query and then process the result and either store it in the BDM (via a business data) or directly use it in an operation or to call another connector.

There are several database connectors, for better performance in production I would recommend the Datasource Connector one (a bit more complex to setup) https://documentation.bonitasoft.com/bonita/latest/process/database-connector-configuration#_how_to_configure_a_datasource_connector

If you are just prototyping, the simple JDBD connector would be enough and easier to configure.

Once the result of your query is stored in the BDM it is very easy to display the information in a form. See in the example page how to generate a form based on a contract that was created based on a business object (all the magic happens there): https://documentation.bonitasoft.com/bonita/latest/getting-started/create-web-user-interfaces

Now, if what you want is to display information coming from an external database (MySQL in your example) directly in a form or page, without going through a process (e.g. to list referential data or data not managed by your process), then you should look for an API Extension that would query your database.

As I do not know your exact use case, I would assume you are in the first situation as it is the most common one.

Hope This Helps,

Captain Bonita

Notifications