Empty set After Bonita REST api is used
ok as requested i create a new Question
Here we go. Now it looks like this , i have written the API using the maven REST api extension i used it like this
Now the API converted to JSON here and the JSON looks like this :
[
{
"id": 1,
"fullname": "Emeka Iwuagwu",
"perdiem": 4500.00,
"supervisorname": "James Hall",
"supervisoremail": "jameshall@***************.com",
"userid": "101"
}
]
Having looked at it i made the API into a variable and used in the value like so :
Now the information populates on the form now like this
Now after filling the form, other than show the data entered into the form, it posts empty like this
What did I miss?
In your form, the input widget value is configured to be stored in a form variable named peopleInformation
and the submit button is configured to send the data stored in formOutput
. So based on the information you shared there is no way that the data provided in the input will be sent to the process and stored in the business variable.
You have to option to fix that:
- use a unique variable for both your input widget "value" property and for the submit button "data to sent on click" property.
- for the submit button "data to sent on click" property, use a JavaScript variable with a value set using the
peopleInformation
form variable. In the JavaScript code used to initialize a form variable you can access other form variables using$data
, e.g.$data.peopleInformation
.
Side note: there is a two way data binding between the widget and the form variable: form variable will be used to set the widget initial value and when value is edited in the widget the variable value is updated.
Comments
i put it back to use the API to fetch the information from the REST and display on the form input widget controls then it did like as i showed in the image above and still it sends empty result sets to the DB this is currently what I have in the formOutPut
I still wonder why it gives the zero input on the H2 DB, does not signal any errors , but saving empty into the DB
Here is my link to the Project. you can have a view of it again https://drive.google.com/file/d/14gZsZZY6IFBGQOto1DNStQSzDdGYusg0/view?u...
Uh, that is to say it cannot submit the data for the REST api data converted to json , isnt it?
I did as you said even inside POSTman and its not returning any results.
there has been some difficulty of some sort here as when i click the button, it redirects immediately
i see a URL like this http://localhost:8080/bonita/portal/resource/process/LocalTravel%20Reque... i was able to capture but when i click it does not show the contents.
I am really lost here. TBH i just need a hand about these things
Sorry for the late response.
Comments
What is the value of the "Data sent on click" property of the submit button widget?
FormOutput as is shown below
Did i miss anything?