How to implement a spring boot rest application with camunda 8?

I kick started with camunda 8 by following this github project but I want to expand it a bit by adding a custom rest controller that can get the ProcessInstance object from RuntimeService and then operate on a user task using the TaskService (for e.g. marking it complete etc).

I tried adding ‘camunda-bpm-spring-boot-starter-webapp’ or ‘camunda-bpm-spring-boot-starter-rest’ dependencies in pom.xml but they don’t seem to be relavent ones.

Can someone guide me what dependendencies to I need to add to define custom rest controllers and access TaskService/RuntimeService?

Thanks.

Hi @JGeek,

it seems that you got a bit confused about Camunda Platform 7 (C7) and 8 (C8).
The RuntimeService and TaskService are part of C7. In C8, we don’t have these services. Instead, we use a Zeebe client to interact with the workflow engine.

If you are familiar with C7 then check out the following guide: Migrating from Camunda Platform 7 | Camunda Platform 8

If you are looking for an example and starting point then check out the following repository: GitHub - camunda-community-hub/camunda-8-process-solution-template: Process Solution Template for Camunda Platform 8

Best regards,
Philipp

3 Likes

Ok thanks @Philipp_Ossler for sharing the insights. Yes I am indeed confused between C7 & C8.

From the shared C8 example code I do not see a way to fetch a task by its name and mark it complete. Any code examples to complete user tasks programmatically?

On reading the documentation further I found that we could define a job worker registered with job type “io.camunda.zeebe:userTask”. There are two questions I have

  1. Is there a code sample that shows how to define a worker for userTask job type?
  2. Would defining a worker for userTasks too be exactly similar to a worker for service task? How can we for e.g. accept the user input from a rest api call and mark the userTask complete?

Thanks.

Yes. It is exactly the same job, just using the job type “io.camunda.zeebe:userTask”. The job is completed like other jobs, using the Zeebe complete job command.

For example: Open a job worker | Camunda 8 Docs

@Philipp_Ossler - How can we accept the user input from a rest api call and mark the userTask complete?

This question is continued in Slack. Follow the discussion here: Complete Zeebe user tasks using the Zeebe client

1 Like