All user tasks are unassigned in Camunda Optimize reports and there are no process variables retrieved

Hi,

I am experimenting with Camunda Optimize 3.3.0 demo and I was trying to create a report, But It seems that all the user tasks are unassigned as depicted below.

Also, the Variables choice in the report configuration is always disabled, although I have variables defined in the process.

The assignee and the process variables appear in the Cockpit app but not in Optimize.
I also checked the engine Rest API and it returns the expected non-empty values.

The process engine is version 7.14.0

I tried multiple things but failed to identify the problem, is there anything I might be doing wrong or do you have any suggestions?

Hi @Abdelrahman_Ibrahim!

That is indeed very odd. I am assuming this is a UserTask count groupBy Assignee report?
Lets first check the setup, can you confirm that:

  1. There are no filters applied and
  2. You have selected the correct version and tenant in the reportBuilderā€™s definition selection?

Hi @Helene,

Yes, you are right. I do mean the UserTask count groupBy Assignee report.
I didnā€™t apply any filters. I tried to see the user id values that I can filter with it only has one value and it is ā€œunassignedā€.
Regarding the version of the definition I have only one version and it is the latest one.

Regarding the tenant I wasnā€™t prompted anything related to it when I created the report and in the configuration file I also didnā€™t change the defaultTenant value.
I have no defined tenants on the process engine instance.

Hi @Abdelrahman_Ibrahim ,

Thanks for checking. One more thing: can you double check that Optimize is connected to the correct engine? You can see the engine name Optimize is connected to in the lower left hand corner of Optimize in your browser.

If it is connected to the correct engine, could you check the following:

  1. In your report setup, could you select Distributed By ā€œUserTaskā€ and check that all userTask names from your definition appear in the table header? I am wondering if it is assignee oder userTask data that is missing from this report.

  2. Also, can you confirm that the userTasks were assigned to users at the time they were completed? Optimize only displays the last value of the userTask assignee field in reports, so if the userTask was assigned to a user, then unassigned and then completed, Optimize will display this userTask as unassigned.

I also forgot to reply to this from your first messge:

GroupBy Variable is not a configuration that is available for userTask reports, so itā€™s normal that you cannot select it in the GroupBy dropdown if you have selected a UserTask View.
You should however be able to select it as a View or a GroupBy on other reports (eg after selecting ProcessInstance or FlowNode views).

Hi @Helene ,

I made sure that I have only one process engine instance available and that I am connected to it.

Yes, all of the task names appear correctly.

I double checked. At the moment TaskService.complete(TaskID) is called the task is assigned to a user.

GroupBy Variable is not a configuration that is available for userTask reports.

Sorry for not being clear in this part. Actually this is another problem not related to the assignee one. what I meant is that it is not enabled for all report views including ProcessInstance and FlowNode views

Hi again,

Thanks for checking all of that.
Did you alter your Optimize configuration in any way? If so, can you please post your new configuration.
And could you also provide the Optimize log? Maybe thereā€™s something in there explaining why this instance data has not been imported yet. I am assuming the instance count of 4 is correct, so there are no instances missing in Optimize?

Ah, so you are performing these tasks programmatically (not manually in Tasklist)? Could you share your code? The issue might be related to how the assignees (and variables) data is set in your code.

Interesting. Letā€™s tackle the assignee issue first, though they might be related.

If you are familiar with Elasticsearch, you could also have a look in the optimize-process-instance index to check if the process instance Ids match what you have in your engine DB. I would also be intrigued to see what the content of the assignee and assigneeOperations fields of the userTasks in the userTasks field of your instances is.

Hi,

Thanks for replying.

No, I didnā€™t. The only two values I changed are engines[ā€˜camunda-bpmā€™].name and engines[ā€˜camunda-bpmā€™].rest so I can connect to my process engine.

Sure, I checked it but found nothing special. optimize.log (2.2 KB)

Yes, no instances where missing.

Aha, I do that programatically. But sadly, I am not allowed to disclose the codebase. However I can tell which methods are used to claim/complete tasks.
they are
TaskService().claim(taskID, userID)
and
TaskService().complete(taskID)

I actually doubt that, because I used Postman to connect to the engineā€™s API and retrieve all the tasks in the history. Claimed tasks had their assignee value set as shown in the json response included in this attached file below.

This file (29.8 KB) contains the state of the engine and Elasticsearch.
4 active process instances and now 9 user tasks are in the system and some tasks have the assignee value of ā€œuserā€.
I also show that one of the process instances have variables and those are not reflected in Elasticsearch.

Hi @Abdelrahman_Ibrahim ,

Thanks for providing all this info.

The data from the engine is a bit misleading in this case, as there is no one-to-one relationship between engine and Optimize entities. Optimize does not get its userTask assignee and variable data straight from the activity instance engine data. Instead, it has its own engine endpoints which query for IdentityLinkLog and VariableUpdate data.
For example, for assignee data, Optimize retrieves a collection of IdentityLinkLogs which detail when a userTask was assigned/unassigned and to whom. This data then allows us to update Optimizeā€™s ProcessInstance data accordingly with a complete log of assignee changes, including the info of what the current assignee is.
Given that some event data like start- and endDates appear to have been imported into Optimize correctly, itā€™s possible that either the engine does not return the relevant IdentityLinkLog data or Optimize fails to import it correctly.

To figure out which one it is, lets try the following:

First, lets see what data the Optimize endpoints for IdentityLinkLogs and VariableUpdates are returning.

The endpoints are the following :
GET /engine-rest/optimize/identity-link-log and
GET /engine-rest/optimize/variable-update

If you have an import user configured, you need to use those users credentials when performing these rest calls.

The second step depends on what the above returns. If there is data returned, then lets try triggering a reimport with the relevant import log levels set to debug which should result in a more helpful Optimize log:

<logger name="org.camunda.optimize.service.importing.engine.fetcher" level="debug" />
<logger name="org.camunda.optimize.service.importing.engine.mediator" level="debug" />
<logger name="org.camunda.optimize.service.es.job.importing" level="debug" / >

If the first step did not return any data then the issue lies with the engine data and thereā€™s no need to reimport as that should not change anything.

1 Like

Hi @Helene ,

Thanks for replying,

Both endpoints return an empty list. So according to your reply, the problem lies in the process engine data. What do you suggest to solve this problem?

Hey again,

Glad to hear weā€™ve found a clue now, if these endpoints donā€™t return any data then that will be the reason there are no assignees and variables in Optimize.
Now the question is why the relevant logs donā€™t exist/arenā€™t returned from the engine, and there could be a few reasons as to why this is. For example, your history might be turned off but Iā€™m not an engine expert so I will reach out to the relevant team for you to get some more qualified help on this.
In the meantime, could you upload your engine configuration? Thatā€™ll help pinpoint the issue.

1 Like

Hi @Helene ,

Thanks for replying.

I was creating a process engine instance programmatically using ProcessEngineConfigurationImpl.buildProcessEngine(). I didnā€™t set the history to ProcessEngineConfiguration.HISTORY_FULL, I thought the default value HISTORY_AUDIT was enough in my case.

Thank you for your help!