My question regarding the implementation is whether it is possible to update a form, without explicitly fill out
the particular form. As described in the documentation, it is possible to access the Business Process
Model (bpm) and the Business Data Model (bdm) with the (Web-)REST-API. But i don’t get how to update the specifically defined “attributes” in the bdm.
Is this possible?
Let me give you an example. I will take the process example “Simple Travel Request”. When you import the process and run it out of Bonita BPM (v7.3.3), you’ll see the “Submit Travel Request”-Report, which a user has to fill out.
Now, what I want, is to fill out the the “Submit Travel Request”-Form/Report in an external web application.
I want to use the REST-API and specifically the PUT/POST-Methods to update (or deliver data) to the defined
business data model attributes (or business process model).
So far I can get the information with a simple GET-Request, after a user filled out the original bonita-formular and submitted the data. But I don’t get it done, that I can send a POST/PUT-Methode as a first step.
Do you have any ideas how to tackle the described problem? Is it even possible?
Thank you very much and with best regards,
Steven Ba
Currently it’s not possible, the BDM only can be modified via Engine API and Process. If you want to do this via REST API you have to make a REST API Extension that handles the data for storing, updating or deleting.
Ok, the Business Process Model would have been my next guess.
I tried to figure out where and how these variables (caseVariable, activityVariable) are located and saved, but i have not found anything yet.
If it is not too much asked: can you explain where I can find them (like are these the business variables within the pool variables or are those the “process instantiation inputs”?) ?
Last but not least (I don’t want to look too greedy): Basically it is possible to make an external website, where a user has to fill out a form, send these input-datas via REST-API to Bonita BPM as a case- or activityVariable and then process it further with Bonita?
Really, really appreciate your input. Thank very much!
For explaining simple, you have to follow these steps:
Design a BDM for storing your data
Make in Bonita a process that handles the data submited by the user throught the external app. Define the form instantiation contract with the inputs that will be submited by the user. Contract values must be mapped with the BDM you defined.
Make your external app and build it for it can send to the Bonita Server a JSON with the same structure as the contract.
Test it
With that steps you are not storing with the REST API directly, we made a process that handles the data.
If I understand you correctly, I already have done these steps. In the above mentioned tutorial (simple travel request) I created a bdm (com.company.model.TravelRequest) and added the attributes to variables.
After that I tried to update the variables like the documentation described it:
/API/bdm/businessData/:businessDataType/:persistenceId/:attributeName
All I got is: localhost:8080/bonita/API/bdm/businessData/com.company.model.TravelRequest/2/numberOfNights [HTTP/1.1 403 Forbidden 0ms]
Oke, I tried the last hours to do what you mentioned.
Example process “submit travel request”
bdm: com.company.model.TravelRequest
I started the process, filled out the first form (submit travel request)
Actually I don’t know what I am missing here. I filled out the form as a bonita process and the data is visible in the portal, so these simple get-requests should work.
If this case is not going to work, would it be an alternative to firstly send the formular-data to a database and Bonita BPM will get it from the database to process it?
For the purpose of clarification: I don’t want to add/deploy an (external) application within the bonita portal.
It is really an external website.
You’ll know if you cannot login when you can find this text on your response: “Unable to log in. Please check your username and password.”, it’s a little tricky but it works ;).
first of all: thank you very much for your time and help.
Your advice works - till now - fine for me. It did not cross my mind to use this specific ID.
Regarding this id, how is this generated? Do I always have to request this (http://localhost:8080/bonita/API/bpm/proces$
api beforehand, readout the specific id and then instantiate the process via http://localhost:8080/bonita/API/bpm/proce$
After the instantiation I’d like to use the userTaskId and update a specific attribute/variable.
I know that it is possible to update the variable and it works, but currently I have to do this manual.
Is there an option to read out the userTaskId and update it with a payload?
Do you have any idea regarding this?
Anyway: thank you very much, this helped me a lot!
Bonitasoft empowers development teams with Bonita, the open-source and extensible platform to solve the most demanding process automation use cases. The Bonita platform accelerates delivery of complex applications with clear separation between capabilities for visual programming and for coding. Bonita integrates with existing solutions, orchestrates heterogeneous systems, and provides deep visibility into processes across the organization.