North and Southbound API for BPM process

Hi,

I want to create a Northbound API that the customer can use to put in a request and JSON POST with Spring. This should then start a BMP process that calls an external API and based on the result I should give a JSON object back to the customer API call or call another external API and give the results back as JSON object.
The reason is that the BPM process could be much more complex and I don’t want to have the business logic in the Java Code. The Java Code and the REST API should be very simple and the logic what to do when should be in the BMP.

What is your question?

I am looking for an example code to archive my goal. So far I found mostly examples how to use the camuda API, but not much how to create an API for a BPM or deal with external APIs.

I do not have an example at hand, but basically you have spring-boot-web application running that just happens to run camunda inside. So you can create a restController, provide a mapping and call autowired camunda services inside.

Hi Empusas.

So your idea is to develop that process without any programming? This is not impossible - but also tricky and typically much more work than using a bit of Java (or other programming languages).

You could use the REST API as the Northbound API (https://docs.camunda.org/manual/7.8/reference/rest/) and Connectors to include REST calls (https://github.com/camunda/camunda-bpm-examples/tree/master/servicetask/rest-service). Then you can use expression language or scripting to do data mapping or evaluations.

Personally I think it is much easier to use e.g. Java within Spring to do the REST calls - it is not much code: https://github.com/flowing/flowing-retail/blob/master/payment-rest/src/main/java/io/flowing/retail/payment/port/resthacks/PaymentRestHacksControllerV3.java#L68. But it might depend on the team and the environment.

Cheers
Bernd