I created modal window with textarea or text fields. How to save input data in to bdm from modal window when click ok button?

1
0
-1

Hi:
I created modal window with textarea or text fields. How to save input data in to bdm from modal window when click ok button? I map text filed with bdm but no data save in database. Can anyone give me an example? Thank you!

2 answers

1
0
-1

thanks msakirkutlu_1359205.
I am new for Bonita custom Rest Api. I have following URL
/API/bdm/businessData/com.company.model.Contract/1

Questuins:
1) How i can get persistenceId in Modal popup instead of form? Any example?
2) When i use following code:
$http({
method: 'POST',
url: '/API/bdm/businessData/com.company.model.Contract/' + persistenceId,
data: contractData ,
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
});

i can fetch bdm contract Data using httpGet by persistenceId and change bdm ( contract) in controller, then do httpPost to update bdm, right? But this is not simple.

Is there a way to get bdm object in custom modal popup controller directly and use it?
Thx!

Comments

Submitted by msakirkutlu_1359205 on Fri, 09/14/2018 - 09:05

I am not the expert but i believe your post method is wrong, you can only use get from bdm api, not put,post or delete. if you could check this documantation page, there only get from bdm api.

There are several example about how to get bdm object, even UI designer has example how to get bdm object when you select "external api" type.
You can see from image.
fRBWep

1
0
-1

I think you have 2 options.
First you can create a REST API that insert your values to bdm and assign your ok button on modal to put or post api request.
Second one is a bit tricky and i am not sure that it is the correct way but it can give you solution, but it can only work if you already started your process, add a human task, create your contracts, define bdm table, set your bdm table to get values from operation tab in your human task, then assign your ok button on modal to post that human task with task id. You can find documantation in here how to use post request to human task

I suggest you to use custom Rest Api if you know how to create one. Is easier and most efficient way to do it

Notifications