elguardian opened a new issue, #2036:
URL: https://github.com/apache/incubator-kie-issues/issues/2036

   This logic has been observed that when the process instance is in memory the 
system might corrupt the process state due to the lack of control mechanism to 
serialize the access.
   
   This happens when 
   
   ```
    @Override
       public void signalEvent(String eventType, Object payload) {
           // we signal memory first
           List<String> idList = new ArrayList<>();
           listeners.getOrDefault(eventType, emptyList()).forEach(eventListener 
-> {
               eventListener.signalEvent(eventType, payload);
               if (eventListener instanceof KogitoProcessInstance 
kogitoProcessInstance) {
                   idList.add(kogitoProcessInstance.getId());
               }
           });
   
           var processInstancesWaiting = workflowInstanceResolver.stream()
                   .map(e -> e.waitingForEvents(eventType))
                   .flatMap(List::stream)
                   .filter(p -> !idList.contains(p.id()))
                   .toList();
   
           processInstancesWaiting.forEach(eventListener -> 
eventListener.send(SignalFactory.of(eventType, payload)));
       }
   ```
   
   the first event (when in memory) uses the raw jbpm logic without the façade. 
The idea is to unwrap the process and use the logic behind the façade.


-- 
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