User task after service task was skipped

Hello, I’m having an issue with Camunda self-managed.
image

I have a service task followed by a user task. After completing the service task, Camunda skips the user task, and I encounter an error at the gateway. How can I solve this? I use the Zeebe client to complete tasks.

@JobWorker(type = "validateForm")
  public void validateForm(final JobClient client, final ActivatedJob job) {
    logJob(job, "validateForm");

    var variables = job.getVariablesAsType(HolderVariables.class);
    service.checkOpenAccount(variables);

    client.newCompleteCommand(job.getKey()).send().join();
  }

Hey @dd_ss :wave:
Welcome to the Camunda Community :partying_face:

Can you attach your BPMN model by any chance?
Usually a User Task should never be skipped. :thinking: Did you attach any kind of form?

Best,
Thomas

Here is the xml.

businessRelationsGoal.bpmn (14.4 KB)

and process metadata:

{
“flowNodeId”: “usertask_approve_form”,
“flowNodeType”: “USER_TASK”,
“startDate”: “2023-11-21 16:51:28”,
“endDate”: “2023-11-21 16:51:28”,
“calledProcessDefinitionName”: null,
“calledDecisionDefinitionName”: null,
“eventId”: “4503599633316541_4503599633316603”,
“jobType”: “io.camunda.zeebe:userTask”,
“jobRetries”: 1,
“jobWorker”: “openAccount”,
“jobDeadline”: “2023-11-21 16:56:28”,
“jobCustomHeaders”: {
“io.camunda.zeebe:assignee”: “username”
},
“messageName”: null,
“correlationKey”: null,
“incidentErrorType”: null,
“incidentErrorMessage”: null,
“flowNodeInstanceKey”: “4503599633316603”,
“calledProcessInstanceKey”: null,
“calledDecisionInstanceKey”: null
}.

I don’t understand how a user task was skipped if I didn’t do anything.

Thanks for sharing all of this information.
Let’s try how the behaviour differs when adding a form to the user task which causes a problem. I have already added one to the BPMN model. Here is the updated version:

businessRelationsGoal.bpmn (15.2 KB)
approved-form.form (710 Bytes)

Maybe that already solves your issue. :thinking:
Let me know if it changes something.

Best,
Thomas

Thank you for all your help. I found a solution to this problem. The first user task should have been automatically solved using Zeebe, but this code finishes all user tasks, not just one by name.

zeebeClient.newWorker()
    .jobType("io.camunda.zeebe:userTask")
    .handler((jobClient, job) -> {
        jobClient.newCompleteCommand(job)
            .send()
            .join();
    })
    .name("openAccount")
    .open();

Now I am using the Tasklist client to complete the user task, and that has solved my problem.

1 Like

Oh, I see. :smiley:
Thanks for posting the solution to your problem.
P.S.: If you user workers to complete your user tasks, rather make it a service task right away. :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.