At my company, we have a software program that exposes many small bits of functionality through a REST API. In order to perform a specific task through that API, you need to combine several calls.
We are now looking for a solution that allows us to model that logic (the combination of calls required for a specific task) in a visual way. Conceptually, a BPM tool is a good way to achieve this and Bonita seems like a really good candidate. It seems really powerful and very extensible, which we like.
I’ve been reading a lot of documentation about Bonita’s REST capabilities, but some things are still unclear to me. I was hoping you guys could point me in the right direction.
-
From what I’ve read, I would need to create a custom connector or use a Groovy script connector to connect to our software’s REST API. Is that right?
-
Each process would represent a task that combines several calls to our software’s REST API. I would like to be able to perform a REST call that starts the process (passing along the necessary data), executes the entire process and then returns the final result of the task (information on objects I have created, an error message, …). Is this possible using Bonita? If not, what are the alternatives? Starting a process through the Bonita REST API and then obtaining the final response in some other way?
Any help is very much appreciated.
Kind regards
Maarten
1 Like
Hi,
To call your own software REST API you can use the REST connector available as community contribution.
Execution of a process instance is asynchronous. Meaning that the call to REST resource to instantiate the process will immediately return once process instance created (providing instance id).
You can eventually poll the engine to figure out when the instance is finished.
Another option would be to include have a call back called at the end of your process.
And finally a third option would be to use Engine Event Handlers to trigger some processing at the end of the process instance.
Hi antoine.mottier
Thanks for your answer.
I was indeed afraid that you can’t really call a process synchronously in Bonita.
I guess I could simulate synchronous execution by writing a program that accepts a REST call, translates it into the right (REST) API call to start the Bonita process and then uses one of your three options to wait for the process to finish, obtain the result and pass it back to the original caller. However, that doesn’t feel like clean solution to me (even without considering performance or what happens if a Bonita process does not finish almost instantly).
I am now exploring BPEL, primarily because it does allow you to create a synchronous service that performs various calls to other services internally.
Hi Maarten,
any luck? I´m looking right now for a solution for a problem like this.
Best regard.
Hi Jandres
We’ve ended up using BPEL for this. It’s very good at building synchronous services that internally call a number of other services, making it ideal for microservice orchestration. In our particular case, we use an ESB to make our REST services behave like SOAP services, but you can also connect to REST services directly with a bit more effort.
I don’t think I should be naming any specific products here, but this should give you an idea of the approach we’re using.