Zeebe user tasks: how to get task key

Dear community,
I wonder how to get the task key for zeebe user task in my main code and in my test code. In both cases I cannot accomplish this and reach out to you for support.

The zeebeclient.newUserTaskQuery method does not work. That gives an error on the configured target URI. Initially it is not set at all; and if I set it according to docs, it gives a 405. (after removing the duplicate v2 in the path).

The testlibrary documentation simply states that testing this is not supported since 8.5. Though I believe it is the preferred implementation for user tasks.

It is does not work, but I expect there is some workaround to be able to test processes with user tasks.

Can you help me out?

NB. It may also some misconception/misconfiguration on my side. I also notice that newCorrelateMessageCommand fails with the same error. Whereas newPublishMessageCommand does work.

Thanks,
Patrick

1 Like

Hello @Patrick ,

thank you for reaching out.

The test lib you are referring to is solely focused on zeebe. Therefore, I would assume that the rest api is not fully functional as it mixes zeebe commands with database queries.

As zeebe process test does not contain any database, there might be issues.

But: If you want to retrieve the user task key, you could try to find it in the zeebe record stream. The record would then contain a userTaskKey or something similar that you could act on.

Heads up: There is a new test library around (camunda process test or CPT) that is focused on the whole camunda platform and supports all apis:

Despite being in an early development state, this library already has clear advantages.

Also, we are happy to hear feedback regarding the current feature state and your requirements.

Best,

Jonathan

Hi Camunda Team,

I would greatly appreciate it if you could provide an example or a roadmap for making workflows with “Zeebe User Tasks” testable using JUnit.

Thank you in advance!

Juraj

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