User task local variable resets task incident

Hello,

I can see different incidents behavior depending on if user task has any input parameters (or output mapping) or not.

Without any Inputs or Outputs on user task:

  1. Fist task has Create Task listener, which sets incident from Java code:
    delegateTask.getExecution().createIncident();
  2. Then I answer fist task with API call.
  3. I can see that process contains incident and token is on second task.

If I add any Inputs into first task (does not matter if I set value or not):

  1. Fist task has Create Task listener, which sets incident from Java code:
    delegateTask.getExecution().createIncident();
  2. Process shows incident when token is on first task:
    Screenshot 2025-07-30 124052
  3. Then I answer fist task with API call.
  4. Process does not show any incidents. History api does not return any incidents by process instance ID.

Please, help to understand the difference in incident logic behavior. Scheme is attached.
10_Incidents.bpmn (3.3 KB)