Job worker for user task

Hi,

I have an application where the front end is in angular and camunda 8 is used for workflow alone. we have backend as springboot . so when a user clicks on complete button in UI, springboot API is called and which in turn has to complete the user task in camunda and new task gets created which will be shown in UI. now in order to do this, I have created a @JobWorker (type = io.camunda.zeebe:userTask) and completing the task using client.newCompleteCommand(job.getKey()).send.join()
My problem is whenever the new user task gets created, it automatically gets closed as well. I am not sure how I can complete the current user task on user request and the new task should not be completed unless user click on complete button.
Can someone, pls help me implement the requirement , so I can rectify the same.
Note :- I am using Spring zeebe client.

1 Like

Hi @syedkp,

By default, Autocomplete is active in the Spring-Zeebe client. Change your JobWorker annotation to:

@JobWorker(type =io.camunda.zeebe:userTask, autoComplete = false)

You can read more about this in the Github repository:

Thanks @StephanHaarmann . My question is if I have 2 processes deployed within a cluster, will the user job worker running in 1st process close the user tasks in 2nd process? since the type is same for all user tasks unlike service tasks.

The job worker will receive all user tasks of all process instances of all process models.

Thanks @StephanHaarmann .

Hello!

I have read this thread and wanted to add a question.
I did some tests with the a JobWorker for the task type: io.camunda.zeebe:userTask and noticed a few things:
A few minutes after a job is received and processed by the Worker, a TIME_OUT command is created by the Camunda Broker ( recordType : COMMAND, Intent: TIME_OUT, ValueType: JOB).
A few seconds later the Worker polls again for new jobs and receives the same jobs which get processed again. This is expected as the jobs are acquired but not completed.
My question is how is the broker and the microservice affected by this?
Does the timeout on the acquisition of a job cause any issues like threads blocking or any kind of delays or waster cpu cycles?

Regards

John

1 Like

@syedkp I would like to know whether you are using TaskList API or you are creating Job workers for User tasks by subscribing to io.camunda.zeebe:userTask

@AJS - I have subscribed using job worker.

1 Like