Return a subset of fields from REST app call to bdm
How can we return only certain fields from a business data REST app call? We have a business object with say 20 fields and we just want to populate a select widget on a form. So we only need the value key (persistentId) and a display key. No need to transmit all 20 fields.
We already know how to make the call to get all the fields via REST. This shown in the docs here http://documentation.bonitasoft.com/bdm-api-0 which shows how to call a custom query or call for a single record by attribute. What we need is a combination of the two, a custom query which we can set the return attribute. We need to filter the returned values in the custom query.
If this is not possible, is it possible some other way to get the list? Maybe as a call to a case/pool which returns a list?
This is a make or break item for us to get a subscription or switch back to Talend for API. Of course we like what we are seeing in our Bonita POC test so far!
Thanks everyone for the help.
what you do is create a Custom Query that says:
Select c.myColumnName from Customer c
or if you want two columns
Select c.myColumnName1, c.myColumnName2 from Customer c
the other options, order by, where etc. can be added as required.
You then call this as per calling a normal REST call.
PS: If this reply answers your question, please mark a resolved.
Thanks Sean, that sounds exactly what we thought too but read somewhere we couldn"t pick the fields. Guess we should have tested first. Let me verify and get back.
We tested and received a 500 error from the server. Change the SQL back and it works again. Here is our SQL:
SELECT l.persistenceId, l.en
FROM LocationType l
and the error message:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
The calling API url is
Now that we thought more about. We also may need to have the ability to use SQL table joins and access to the user's roles/permissions in the SQL. This seems to be a key aspect for populating pages for widgets like tables, select, autocomplete, etc. Also from a security & performance point-of-view, why would we want to send an entire record to the mobile device when just 4 fields may be required?
Has anyone successfully done this in 7.x?
Wow, spent some time switching to Talend today for the API layer. Boy I sure miss the flow and ease of Bonita BPM. It feels like I am stuck figuring out the plumbing, instead of figuring out the application. Bonita BPM abstracted a lot of the plumbing. How much long until we can get that feature into Bonita :-)
Interesting and good to know, I've not used Talend so haven't got a reference.
I will add this comment to the bug to see what Bonitasoft say...
I've also added an idea for future release if you want to give it a PLUS
have you tried this?
also have a look at my comment on the bug report here