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?
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.
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
Is there a code sample that shows how to define a worker for userTask job type?
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?
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.