martinweiler opened a new pull request, #7280:
URL: https://github.com/apache/incubator-kie/pull/7280

   Closes https://github.com/apache/incubator-kie/issues/7279
   
   For a node marked `customAsync`, the job that triggers it is recorded with a 
`node_instance_id` that doesn't match any node instance in the process 
instance. It also carries the same value as the `job_id`.
   
   This is a follow-up to an earlier report from 01/2026: jobs were indexed 
under the previous node instance. That behaviour came from 
`nodeInstanceId(from.getStringId())`. Commit `ff5db7b047c` (kie-issues#7162) 
changed it to the id of the virtual instance. The job no longer points at the 
wrong node, but it now points at an id that exists nowhere else.
   
   **Root cause**
   
   In `AsyncEventNodeInstance`:
   - `internalTrigger` sets `jobId = getStringId()`. It also uses 
`this.getStringId()` as the job's `nodeInstanceId`.
   - The wrapper node is `hidden`, so it never produces node events or a 
nodes-table row.
   - `triggerCompleted()` removes the wrapper and creates the real node 
instance with a new random UUID. The id the job recorded therefore never 
appears in any node event.
   
   **Fix**
   
   Changes in `AsyncEventNodeInstance`:
   1. `internalTrigger` gives the job its own id: 
`setJobId(UUID.randomUUID().toString())`.
   2. `triggerCompleted()` sets the wrapper's id on the real node instance: 
`((NodeInstanceImpl) actualInstance).setId(getStringId())`.
   
   `AsyncTest.testAsyncJobReferencesTheActualNodeInstance` is added. It records 
the scheduled `ProcessInstanceJobDescription`s and the triggered node instance 
ids. It asserts that every job's `nodeInstanceId` is a reported node instance 
and that no job id equals a node instance id.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to