Custom Rest API in Camunda Spring Boot Project

Hi guys,
I 'm running camunda’s rest engine as standalone spring boot application. I added some custom Rest-Controller myself, however, there is no chance for me to reach out to these manually added endpoints. I did research myself and came across the following guide: Embed the API

However, I am struggling to apply the steps the above mentioned guide suggests. I cannot find a class called that looks like the pattern of JAX-RS application. Attached, please find the Rest-Controller’s code. Can anyone provide guidance?

@RestController
@RequestMapping("/processes")
public class ProcessRestController {

    @Autowired
    private ProcessOverviewService processOverviewService;

    @GetMapping("getProcesses")
    @ResponseStatus(HttpStatus.OK)
    public ResponseEntity<List<ProcessOverviewDto>> getProcesses(){
        try {
            return ResponseEntity.ok(processOverviewService.getOverviewOfProcesses());
        } catch (Exception e){
            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
        }
    }
}
1 Like

I also encountered same problem. And do you solve this problem? If yes, please you write your solution about it. Thank you!

Hi,

for me, the following worked:

@Component
@ApplicationPath("/custom")
public class SpringBootResourceConfig extends CamundaJerseyResourceConfig {
    @Override
    protected void registerAdditionalResources() {
        this.register(ProcessRestController.class);
    }
}

I simply added a bean and configured JerseyResourceConfig accordingly. However, I had to make my rest-api from above (i.e. ProcessRestController) an endpoint realized with JAX-RS/Jersey.

Hey there,

You can have camunda running in a springboot application and add anything you want on top of it. Where exactly did you face issues ?

Can you please share the entire URL which you’re able to invoke? I have a similar issue but I’m unable to invoke the endpoint : http://localhost:8080/custom/startprocess1

where /startprocess1 is my custom controller