Problem with "POST" Button and BDM API Call (Empty Error Message)

Hey there,

i’ve got a problem with the Bonita 7 UI Designer Button (Bonita 7 Community Edition)

I try to load the contents of a Table Widget when i click on a button. Therefore i created a button, set the action to “POST” and entered the URL to an API Call. I leave the “Data sent on click” part empty. Both “Successful response value” and “Failed response value” are mapped to empty String variables. The first one is used to fill the table and the second one is displayed for debugging reasons…

The following happens:

  • If I enter a relative path like “…/API/bdm/businessData/com.company.model.KnowledgebaseEintrag?q=find&p=0&c=10” and click on the button in preview mode, everything works as expected and the table is filled correctly. If I start the process and do the same in the corresponding task, I receive an empty error message (“”)

  • If I enter an absolute path like “http://localhost:8080/bonita/API/bdm/businessData/com.company.model.KnowledgebaseEintrag?q=find&p=0&c=10” I also get an empty error message both in preview mode and in the running process.

I’m guessing that the relative path is converted to the absolute path when the button is clicked on the running task and that there is a problem with resolving the current user.

How can i solve this issue?

Thanks in advance.

Based on the description of your use case I can suggest two options:

  • One is to search as user type in search field. I create an example that illustrate that. Main limitation is that multiple queries are sent to the server.
  • The second option would be to create a custom widget to perform the GET REST API call.

Currently a custom widget is require because “button” widget does not support GET operation. Such feature will be added in a future release.

Hi, it can be solved using a button, in action choose “GET”, and in url to call put the api call, in successful response value put a variable that holds the response, in this case json.

Hi,

As documented businessData REST resource only support GET operation, so I’m surprised that it actually work in preview mode.

Can you share your process so I can give a try to find a solution?

Also I can recommend to use the web browser console (usually open using F12 key) to inspect the network activity when you click on the button.

Hi,

thanks for your answer.

https://drive.google.com/file/d/0Bxe6rShjVEusMXpmVlJ0bmVTVlE/view?usp=sharing

This is an example process, which includes the very step that is failing, for i’m not allowed to share the whole process.

It includes what i’m really trying to achieve: A search functionality. I created a custom query for the bdm for searching both in the titles and the description (beschreibung) of the specific bdm.

Is there any other way to load the content of a table dynamically, as there is no GET type on the button widget?

Thanks for your answer. I came to the same conclusion and implemented a direct search as shown in your example, after i quickly attempted a to create a GET custom widget (it didn’t work out quite well, as i’m a absolute jquery/AngularJS beginner). Until i delve deeper into the matter, your example is adequate :slight_smile: