My microservice has a Rest endpoint (getLocationForCar()) where it accepts a Car DTO (as below) as it's input , has some business logic to find the car at a location and returns the Location DTO (as below).
class Car {
String carId;
String carName;
String carType;
String carModel;
String carMake;
}
class Location {
String locationId;
String locationType;
String locationAddress;
}
I want to move the business logic to BPMN and DMN. I am new to BPMN and DMN. I went through few tutorials of Camunda and thought this is how I could get this working with Camunda:
- Create a hardcoded DMN table with input = carId and output = locationId.
- Create a BPMN diagram which has a
- start ->
- extract carId from the Car DTO that is passed to the Rest webservice (getLocationForCar()) ->
- call DMN to give the carId to it ->
- send DMN's output to the java process so it can be sent as a webservice (getLocationForCar()) response
This approach has issues (I need help getting the following questions answered):
- How to call a BPMN process from the java Rest Webservice code?
- How to pass Car Object to BPMN so that it can extract the carId, use it in DMN table and geturn the output?
- How the java code will get output from BPMN process or DMN table, that can be used to return the required response object
Using Camunda (third part library) seems like a overhead because Camunda runs on it's own server and bpmn, dmn are deployed on that, this would slow down my process. So I am leaning more towards JBPM (although i have no idea if i can achieve my requirement using any of these).