Postgres query result (List of lists) fills only the first column in form Table

1
0
-1

I am a new to java and Bonita (although not to BPM) and I am trying to display a sql query result in a standard Bonita UI table version 7.1 (using the Table widget). But all the data ends up in the most left column like this example below:

1OWTwFcV.png

What did I do to get to this?

I defined a postgresql dataconnector, that shows a working Array when testing:

1OVozpJJ.png

The output (graphical n*n) is saved in a List type variable 'carsandcolors':

And in the UI designer I defined a variable 'Cars' that receives the data from 'carsandcolors' through the API:

../API/bpm/activityVariable/{{taskId}}/carsandcolors

I have made the following settings in de UI designer:

1OVE9dFx.png

Why are the subarrays listed in the first column only? And what can I do to fix this?

I have the feeling it has something to do with the Column Keys attribute in the UI designer, but I cannot find any information on how to use this attribute.

Any help is greatly appreciated!

11 answers

1
0
-1

1
0
-1

sorry, i know this post is very old, but i realy need help with de columnskey... I have the data with the json structure but i can show in a table... please help

1
0
-1

Use this tool to check JSON: JSON validator
The variable "jsonb" must be defined after the While and also the line before of the "line" variable definition.

1
0
-1

Why can't we do that right from the connector?

1
0
-1

Thanks stefandebruijn!
Do you guys have an idea about how to do a query depending on a UI designer selector option?

Imagine that you have a table with the fields "brand", "color", "year", "type", etc... So you want to filter the content of the table based in the option you've selected.

I'm thinking that I have to use the selector's output, but I don't know if I can do the interaction selector-connector in that way.

Comments

Submitted by stefandebruijn on Mon, 02/15/2016 - 15:09

I am not a developer, but i guess there are some ways to achieve what you need:

1) query directly from to form on your database (through rest api, outside bonita) I do not know how to do this, depends also on your database.
2) load all the data into your form and add a filter in the result table. The filter value should be bound to the value of your selector (search angular js filter). This works pretty good. I can give you an example if you need.
3) select the data in the selector, submit the form, query the database with the selector value, activate new form in new task and return the query result to the new form (not

Probably there are better options, Mayby you can post your question as a new one.

rgds, Stefan

Submitted by jeanov92 on Mon, 02/15/2016 - 16:23

I'm trying to do this in the same task.
Please, I really appreciate it, give me a filter example.

Submitted by stefandebruijn on Tue, 02/16/2016 - 13:47

Ok, this is working for me:

1) Create an empty String variable in de UI designer and call it varFilter (for example)
2) Bind the output value of your selector to this variable. So if you select a value, that value is assigned to variable varFilter
3) Add the filter to your table by adding a pipe and filter:varFilter to your table dataset. Like this: yourTableInputVariable | filter:varFilter
This is done in the file 'content' for a table or 'repeat contents' for a container

This is basic angularjs. You can search google for other angularjs filter examples,

Good luck

Submitted by jeanov92 on Tue, 02/16/2016 - 16:04

Thanks it works great!

1
0
-1

Hi Stefandebruiji. Where did you write the groovy script? I defined a connector I did the query test and it works. Should I create a new variable and write the script?

1
0
-1

Hi Stefandebruiji. Where did you write the groovy script? I defined a connector I did the query test and it works. Should I create a new variable and write the script?

Comments

Submitted by stefandebruijn on Sat, 11/21/2015 - 21:17

Hi jeanov92,

In the 'output operations definition' (the last step when defining a connector). Click on the little pencil on the right hand side.

You should create a variable indeed.

1
0
-1

1
0
-1

1
0
-1
Notifications