How to compare two business variables?


I'm selecting a record from an external PostgreSQL Database, and saving the information in my BDM, however I want the BDM records not to be duplicate, I currently have two business variables, one that gets the information from my BDM and another Which receives the records from my external database, I need to compare those variables to add in my BDM only record that are not already contained in it.

How could I do that?

I have the link to my .BOS file if you can help me, I thank you.



Submitted by Sean McP on Tue, 02/21/2017 - 18:38

Is this a one off batch process or as part of a fully developed process that will be used by 100's of users?

2 answers


Good morning, thank you for the feedback.

Is it not possible to compare my business variable that receives the BDM information with my process variable that receives PostgreSQL information through a groovy script? So you do not get duplicate information in BDM.

Romualdo Santos


The easy way to do this is add an Index field to the BDM and make it Unique,

Then copy all records from PostgreSQL using the index field as the unique identifier. Print out any duplicates...there shouldn't be any.


The other way to do it is to create a CSV dump from PostgreSQL and them import the dump to the BDM again you could use the principal of unique field.

Even Simpler.

HOWEVER, do note that if this data is to be used by other systems you might want to keep the data in PostgreSQL and use connectors to get it.


PS: As this reply answers your question, please mark as resolved by ticking the tick mark on the left of this reply.


Submitted by on Tue, 02/21/2017 - 12:54

Thanks for the feedback. Could you give me a more detailed example? I am new to BonitaSoft and however simple it may be to do your homework I could not understand how I can access this data stored in my business variable that receives the data from my BDM.

Thank you very much for all the help.

Romualdo Santos

Submitted by Dibyajit.Roy on Wed, 02/22/2017 - 07:53

Did you mean Process variable.
You can Refer the Process variable in your UI form using the API call
Take a look at this example

I believe once you have both Process variable and BDM variable in the UI page.
You could create a javascript variable and compare both.