Unable to Fetch Process Instances from External Task for Older Versions

Hello Camunda Community,

I am currently facing an issue with fetching process instances from an external task in older versions of my BPMN process. Despite successfully starting and reaching the process instances, I am unable to retrieve them when using the fetchAndLock API call for the external task. Here are the details of my setup and the steps I’ve taken:

Environment:
Camunda Version: 7.22
Database: MSSQL
Process Definition Key: Process_Juridico
External Task Topic: MinutaPrimeiraVersao

Process Definition:
I have deployed a BPMN process with an external task defined as follows:
<bpmn:serviceTask id="ST_GerarMinuta" name="Gerar 1ª versão minuta" camunda:asyncBefore="true" camunda:type="external" camunda:topic="MinutaPrimeiraVersao">

Issue Description:
Fetch Request: I am using the following JSON for my fetchAndLock request:

{
    "workerId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    "maxTasks": 10,
    "usePriority": false,
    "topics": [
        {
            "topicName": "MinutaPrimeiraVersao",
            "lockDuration": 60000,
            "processDefinitionId": "Process_Juridico:16:070d6b48-9604-11ef-b409-96e23c5077e7",
            "variables": [
                "id_processo",
                "id_documento",
                "id_utilizador",
                "acesso_nome"
            ]
        }
    ]
}

Response: The response from the fetchAndLock call returns an empty array (), indicating that no tasks are being fetched.

Process Instance ID: I can confirm that there are active process instances with the following ID:
57ec99ef-43b4-11eb-8c2e-00505694760d

Status: The process instance is not ended and is actively waiting at the external task.

Questions:
What could be causing the fetchAndLock call to return an empty response, despite having an active process instance?

Is there any specific configuration I should check in the BPMN model for older versions?

Are there any known limitations or bugs related to fetching tasks from older process versions in Camunda?

I would appreciate any guidance or suggestions on how to troubleshoot this issue. Thank you for your help!

Best regards,
Pedro Ferreira

Hi @ferreiralmpedro

Did you check out the content of the ACT_RU_EXT_TASK table and whether the tasks you are looking for exist (same process definition ID and topic name)?

Hi @hassang

I checked the table you mentioned, and there are no records, but in the cockpit, the task exists. What could I be doing wrong?

The cockpit image…

The call

{
    "workerId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    "maxTasks": 10,
    "usePriority": false,
    "topics": [
        {
            "topicName": "MinutaPrimeiraVersao",
            "lockDuration": 60000,
            "processDefinitionId": "Process_Juridico:12:0c2ee32b-1d4d-11ed-acc0-00505694760d",
            "variables": [
                "id_processo",
                "id_documento",
                "id_utilizador",
                "acesso_nome"
            ]
        }
    ]
}

Hey @ferreiralmpedro !

Just double checking if your Camunda instance is connected to your expected database.

Could you please check the Camunda Web-App Admin > Diagnostics and the value of database ?

Hi, @SafeAndSound,

I can confirm that the database is correct, because when I migrate all instances to the latest version, everything works fine, which is quite unusual.

Additionally, I have another Camunda workflow for a different process that’s working perfectly.

I’m using Camunda 7.22 with Java 21, and I have two workflows, both involving external tasks. In one of them, when the instance reaches the external task, the ACT_RU_EXT_TASK table isn’t populated if the instance isn’t on the latest definition version. Consequently, the external task is never picked up in my processes unless I migrate to the latest version. However, I have another workflow where this behaves differently: even with tasks in an older version of the workflow, the external task is picked up without any issues, and the ACT_RU_EXT_TASK table is populated as expected.

You probably specify the wrong process definition id. If you have multiple versions of it it’s easy to specify a wrong one. Why don’t you specify the processDefinitionKey instead? This would find jobs for all versions of the process model.

On the screenshot, I see that the model displayed has the version 12 (you specified 16). Hence I think that my guess was correct.

First of all, I apologize for the delayed response; I had been away from this subject for a while.

You are not wrong, but this was a typo. When I edited the issue, I was trying many things and ended up messing up the versions.

In fact, I don’t think the fetching process is the problem, because, as you can see in the example I send in the image, the instance appears in the cockpit, but there is no record for it in the table.

But in this next example, from another process, when the task is reflected in the cockpit, it is also registered in the table.

How can this be?

Thank you!

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