Populate BDM using 7.3

1
0
-1

Hi

I am new to BonitaSoft and really enjoying it!

I have created the BDM structure and I would like to populate the tables from a csv file. Can someone point me in the right direction, the documentation isnt clear on doing this.

Thanks

2 answers

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

There are no examples of how to do this. You will need to write your own code, you say nothing about the structure of your BDM so it makes it very difficult for anyone to help.

Here are some examples of how to read a CSV file in Java though (google is a great tool have you heard of it?)
https://www.mkyong.com/java/how-to-read-and-parse-csv-file-in-java/

http://howtodoinjava.com/core-java/related-concepts/parse-csv-files-in-j...

This will get you started and enable you to populate your BDM/Object

And here is some code for doing the BDM bit (will not work) but points you in the right direction.

  1. myBDM myBDMO = new org.mycompany.myBDM();
  2.  
  3. myBDMO.setField1() = "x";
  4. myBDMO.setField2() = "y";
  5.  
  6. return;

regards
Seán

PS: If this reply answers your question, please mark as resolved.

Comments

Submitted by brendan_7 on Wed, 08/17/2016 - 16:55

Hi Sean

I am having a little trouble executing this code.

Is this done using Groovy Scripts? If not where are you executing this from and does anything need to be imported?

For example purposes my structure looks like this,
org = ACME
BDM = Temp
Att1 = name (type string)
Att2 = age (type string)

Thanks
Brendan

Submitted by Sean McP on Thu, 08/18/2016 - 00:51

Hi Brendan,

I'm not at my desk for a few days, this is groovy code so a script connector.

Also have a look here,

Regards
Seán

Submitted by brendan_7 on Thu, 08/18/2016 - 11:13

Hi Sean

No problem, I have played around with the groovy syntax and am starting to get familiar with it. I am not sure how to use this in a connector yet but I am sure "the google" will have something to say about it.

The link you sent was amazing, have a look at it. ;p

Thanks
Brendan

1
0
-1

Hi Sean

Thanks for the prompt response.

What is this google that you speak of?

I thought that there might have been a functional (non programatic) way to populate the data into the BDM.

I will create a script to do it as mentioned.

Thanks
Brendan

Comments

Submitted by Sean McP on Tue, 08/16/2016 - 01:41

:) :D :)

Yeah, no and thanks for understanding - google - it's my go to tool - When I started down this slippery road it was a god send.

This is what started my down this path...
http://www.donthitsave.com/comic/2016/08/02/google-google-google

regards

Notifications