cancel
Showing results for 
Search instead for 
Did you mean: 

DB updated not in time during process execution

kayj
Champ in-the-making
Champ in-the-making
Hi,

I need to get notified (without adding ExecutionListeners to the BPMN model) about events. I'm using ActivitiEventListener to get notified.

mProcessEngine.getRuntimeService().addEventListener( new ActivitiEventListener() {
  @Override
  public void onEvent(ActivitiEvent event) {
  }
  …
}

Unfortunately it doesn't work as expected. It seems like the Activiti DB is not updated until a blocking entity is reached (e.g. waiting for a signaling). As a result of this behaviour I can't access variables from the DB which have already been written by a ScriptTask in the BPMN model, but are not yet written to the DB. Is this intended behaviour? Is it possible to force an update? Or do you have  different options for the requirement of getting nofied without adding listeners to the BPMN model?

Thank in advance,

Kathrin
10 REPLIES 10

jbarrez
Star Contributor
Star Contributor
> We often ran into the issue, that for instance a variable has not yet been written into the DB when it was accessed.

This is the Activiti way for everything we do, it is not an issue. Variables can always be retrieved through execution.getVariables.
If we would flush to the database constantly … performance would be seriously sucky.