Search code examples
postgresqlbusiness-process-managementbonita

Connect external bank to UI Designer in Bonitasoft Community


I am using the Bonitasoft tool to develop a BPM project, I have a PostgreSQL database that through a JDBC connection I was able to insert and change records by Bonitasoft, however I can not select the database data and display them in my UI Designer, because A tool not yet widely used I did not find much information about it, if they have any material soon, or any idea how I can display the data in a worksheet in my UI Designer, would be very useful.

I tested the return that my Select brings me and the information matched correctly with what I need, so I added the information in an arrayList, my problem now is to display the information from that array in UI Designer


Solution

  • Displaying data in Bonita BPM UI Designer forms relies on forms variables that you bind to forms widgets.
    Forms variables value can be set using different options:

    • JSON (i.e. constant)
    • JavaScript expression (the returned value of script execution)
    • External API call (REST API)...

    The solution to get the data from the PostgreSQL database and put them into a form variable is actually to use a REST API call. That's the only solution to bind a form with a third party system without duplicating data in Bonita BPM.

    Problem is (AFAIK) that PostgreSQL doesn't provide REST API to run SQL queries.

    The solution here is to deploy in Bonita BPM a REST API extension that will act as a proxy: it will offers a REST API to initialize form variables and will execute Java code and use JDBC to run queries on the PostgreSQL database.

    A REST API extension to do so is available as a Bonita BPM community project. Note that this extension does not actually handle directly the connection to the database but rather goes through a Java application server connection pool using data source.

    Here is a sum up of the architecture:
    Form -> Widgets -> Forms variables -> REST API extension -> Data source -> Database

    Such architecture can seems quite complex. A good alternative would be to use Bonita BPM business data model (BDM). BDM basically let you define your database schema in Bonita BPM Studio and will create for you the database tables and Java classes to manipulate your data in processes.
    Benefits of this solution is that you have out of the box REST API to get business data values and you can use "operations" on processes tasks to update them.