How to compare two business variables?

1
0
-1

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.

Link:
https://drive.google.com/file/d/0B8aMiLwwVY0nVXhPemhsQzh0MDA/view?usp=sh...

Comments

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

1
0
-1

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

1
0
-1

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.

Simple.

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.

regards
Seán

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

Comments

Submitted by romualdo.s.rs 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

Hi
Did you mean Process variable.
You can Refer the Process variable in your UI form using the API call
../API/bpm/activityVariable/{{taskId}}/myProcessVariable
Take a look at this example
https://github.com/Bonitasoft-Community/process-variable-example/release...

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

Notifications