Implement service tasks with react

Hello,
I am building a custom web app that will connect with a camunda process. Is it possible to use forms in my app (react) to complete service tasks? The reason is I don’t want to have the “claim” functionality in my implementation.
Or maybe there is another way to approach this?
Thank you

Hey @camunda_kon!
That sounds like a cool project. Generally you can leverage Camunda’s GraphQL API in order to build a custom Tasklist. This provides also the human task management lifecycle - allowing you to claim, assign, … tasks.

A while ago I wrote a little blogpost showcasing what the GraphQL API can do:

There is also a nice example from consulting available on GitHub. Maybe @jonathan.lukas can elaborate a bit more on that topic:

Let me know if you have any further questions!
Thomas

1 Like

Hello @camunda_kon ,

in general, I would always recommend to use User Tasks as soon as actual users are involved in a task.

Good news: The engine treats user tasks in the same way than service tasks. See:

Even better news: There is no constraint in the mentioned GraphQL API that a user task has to be claimed to be completed. So you can just go ahead and implement your thing!

PS: The process application @Hafflgav mentioned as well does also not use the claim mutation. :wink:

Jonathan

2 Likes

Hello @jonathan.lukas , @Hafflgav .
Really appreciate the feedback. This was really helpful but there is a concept I have not completely understood. Do I have to use either the graphQL option or the job worker (io.camunda.zeebe:userTask) one? Or it is a combination of both?

To give you a better understanding of my thinking:

  • I have a C8 self-managed setup with docker.

  • So far, I have used spring boot to create a process instance (newCreateInstanceCommand) and I am calling this from my react app through a rest api call. (on a button click)

  • At this point I want to complete my first user task. The web app will not have a tasklist ui like in camunda. The user will be prompted just to fill a form (which will have the same fields as the one defined in modeler) and by this the user task should be completed and the instance will move to the next task.

I am not sure how to proceed regarding the last mentioned point. I have started following thw camunda tasklist api tutorial (Tutorial | Camunda Platform 8 Docs). Is this the right way?

Sorry for the long and vague question but at this time I am confused about this.
Thank you again for your help!

Great question!
The GitHub repository from Camunda Consulting, features a process application which combines both - a Spring Boot application, taking care of security and gRPC calls - as well as a frontend which leverages GraphQL for handling user-tasks.

@jonathan.lukas implemented this project, so I guess he can be way more elaborate on this topic than I can. :wink:

1 Like

Hello @camunda_kon ,

I implemented a tasklist in my example - which is available in a post above.

What I could advise you now to do is: take the process instance key from the start event. From this process instance, you will want to complete tasks. As the tasklist api does not offer a query parameter for process instance key atm, it would make sense to either filter the response OR to detach the client request from the server request.

I hope this helps

Jonathan

2 Likes