I am using Spring Boot as my backend for my application. The Spring Boot need to have a REST API.
Also I want to have Camunda with it for BPM.
On the whole internet I cannot find even one tutorial, that shows, how I can have the following:
localhost:8081 --> REST API calls (that in turn uses runtimeService to do actions on camunda processes, e.g. start new process instance)
localhost:8080 --> Camunda web app/dashboard
All the tutorials explain only (for Spring Boot + Camunda) how to get to the dashboard. Thats all. Noone explains how I can have a REST API alongside the Camunda.
No, thats not what I mean! I dont mean the REST API offered by Camunda. I mean my own REST API, that I created myself. But never mind, I figured out, how to do it:
So in the same Spring project, I have my own controller:
@RestController
@RequestMapping("/v1/user")
public class OrderController {
@Autowired
private RuntimeService runtimeService;
@GetMapping(value = "/company")
public String index() {
runtimeService.startProcessInstanceByKey("OrderProcess");
return "index";
}
}
So now I can call the camunda dashboard on localhost:8080/app/cockpit...
and I can make rest call: http://localhost:8080/v1/user/company which in turn does something on the process.