Trying to get data from Postgres into BDM
My goal - read the entire postgres table customers and put it into a BDM table.
BOS file, log output, and Postgres table definition are in the "CASE1" folder in my Google Drive public folder. I know that the test is nt BPMN2 compliant.
I've created two BDM tables. One a working table, the other a reference table (bdocustomer and bdoPGcustomer respectively).
I have a connector in step one that successfully retrieves that data from Postgres.
I have a process variable defined - pvar_PGcustomer_temp - that ...should... receive the data from the connector. I think.
The form, when this works, right now will just display the contents of the table that will become the working file - bdocustomer, and the retrieved Postgres data - bdoPGcustomer.
To achieve my goal, the connector - out - will write the temporary process variable contents to the bdoPGcustomer table.
Thanks... I'd be enjoying this process a lot more if I weren't under-the-gun to deliver.
I downloaded your bos file, updated postgresql host etc, and got same error as you have.
I dig into your Connector In code, and found you are using Groovy script to retrieve data, then converted all records into a single String. However, in next page of connector setup, you can find this is expecting a list of list object. Application tries to convert String obj to list obj, but fails to find a suitable converter, therefore you got ConversionException exception.
Actually there's no needs to write any Groovy code to retrieve data. Just use a constant SQL string is good enough to your case.
I made some changes on top of your code, using Graphical mode. loc_PGJSONcustomer is changed to a java.util.list with "Is multiple" selected. Of course Default Value of this local parameter is removed.
After start a case, you can use REST API to check local variable is properly set:
You can download bos file from: https://drive.google.com/file/d/0B4PSuBFeVF-aLUhIZFFCQVlQLWM/view?usp=sh...
BTW, although I made it works, I have doubt why you would like to retrieve whole table data and keep in local variable or BDM? It is not good approach.
If you want to refer to some data, you could always refer to necessary data on the fly using web service or REST service, there's no need to keep data alone with case instance if only for reference purpose.
Re: your comment "BTW, although I made it works, I have doubt why you would like to retrieve whole table data and keep in local variable or BDM? It is not good approach."
I want to put the data into the bdoPGcustomer table.
I see you made it work but I still can't copy the postgres table into the BDO table.
What do I have to do?
Thanks very much!