AnsweredAssumed Answered

Engine not ready beetween two messages reception

Question asked by madjlzz on Sep 22, 2017



I am currently having trouble using Activiti 5.22.0 with Spring Boot.


Consider the following workflow : 



To send messages to the activiti engine I am using this snippet of code :


public void sendMessageToActiviti(String processInstanceId, String activitiId, String messageName) {
    Execution execution = findExecutionById(processInstanceId
, activitiId);
    processEngine.getRuntimeService().messageEventReceived(messageName, execution.getId());
private Execution findExecutionById(String processInstanceId, String activitiId) {
    return processEngine.getRuntimeService().createExecutionQuery()

Those messages are thrown by user actions so I don't control when they are occurring.


The thing is that in some cases, when my message FooMessage is launched followed quickly by my BarMessage for the same processInstanceId, my query is returning for the execution null.


When the messages are coming slower, everything is working out of the box. Could the activiti engine be in a kind of non ready state when messages are triggered fast enough ?