Connecting Query With External API

1
0
-1

Hello , I am new into BONITA SOFT STUDIO and im trying to connect my database jquery with the form that i created in BonitaSoft Studio.How to connect the widget (dropdown) from the form with the database.I tried many combinations but none of them was working.In the step when im creating a new variable im writing the name and in the type im choosing ExternalAPI.How can i define a specific API URL for a specific query ?

2 answers

1
0
-1

1
0
-1

Hello,

What is a "database jquery"? An external database or a database inside a JavaScript JQuery?

1/ external DATABASE

You need to query this database, then get back the data in a variable in your browser (i.e. a variable in UI Designer).

Then, when the variable is fulfilled, you can use it via the UI Designer (display data via a Table Widget for example).

To do that, you can use the Gasoline page. https://community.bonitasoft.com/project/pagegasoline

With this page, you declare your SQL Request, and Gasoline offers you a REST API to call, and this REST API returns all data.

2/ JQuery database

Declare a JavaScript variable in your UI Designer, to access the information. A JavaScript variable in UI Designer can use some JQUERY order.

3/ Widget

You can use as well a widget to develop in AngularJS to access the data you need.

Best

Comments

Submitted by AleksandraS1 on Fri, 10/23/2020 - 14:43

ThankYou for the answer.Yes it is an external database.I want to try to solve it with gasolina truck ,but how can i access to gasolina page ? I downloaded the zipped folder with gasolina documents , how can i use them now ?

Submitted by Pierre-yves Monnet on Fri, 10/23/2020 - 21:24

Hello,

You should have a look to the PY tutorial https://youtu.be/GDw2FVuiTqE

It explain how to use a page from the community. Is that helpful?

Best

Submitted by AleksandraS1 on Tue, 11/03/2020 - 09:37

Thank You for the tutorials. Here is more detailed explanation about our problem.

Our application, needs to load some data from external databases while also keeping information in the default HBase database.

Some data that are to be loaded are in the form of lookups.

To be more concrete, we have Customers, each having a status (Active, Interested, Not interested), and also living in a City.

Our Business Data Model, is:

Customer (CustomerName, Description, PhoneNumber, ..., CityId)
*City (Id, Name)
Status(Id, StatusName)

However, CityId must come from an external database, a custom CRM system that we are using. Therefore, IDs must be exactly the same (CityId in Bonita with Id from the table City of that database).

The form that we have generated basically lists all fields from the Customer BDM and displays a dropdown for the City. However, we are unable to load data into the dropdown.

Our implementation in the process is to create a business variable (pool variable) for the Customer model. We have also created a contract from this customer variable and generated a form from the contract.

We are also able to create a connector that loads the data from the external source, and save that data into another business variable (cities List). However, we find it impossible to display such data in our form. Any suggestion on how we can display these data in our form?

*I am also aware that in the BPM, the City model might not be needed.

The next question is how to insert the form data (QuoteText, Amount, CustomerId...) from the form to the external database?

external database select insert

Submitted by Pierre-yves Monnet on Tue, 11/03/2020 - 19:20

Hello,

The form that we have generated basically lists all fields from the Customer BDM and displays a dropdown for the City. However, we are unable to load data into the dropdown

==> Use Gasoline to collect this list from an external database

We are also able to create a connector that loads the data from the external source, and save that data into another business variable (cities List).

=> I would not recommend that, you duplicate information. Hopefully, this list should be stable, else you face some synchronization issue.

The next question is how to insert the form data (QuoteText, Amount, CustomerId...) from the form to the external database?

==> Typically, this has to be done in your process, because this is a Business steps, not from the form.

So,to do that, create a Activity Step, and use a JDBC Connector. In the JDBC Connector, you can do any insert/update operation.

Best,

Notifications