Does VARIABLE_UPDATED event will fire just as soon as any variable updated for process/task ? or does it have any exceptional cases where only on those cases it will fire? Because I was testing to listen to this event by updating the variable using the following call
taskService.setVariables(task.getId(), processVaraibles);
With the above call the variable values are getting updated but I'm not receiving any event.
Here is my configuration:
<code>
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource" />
<property name="databaseType" value="oracle" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="false" />
<property name="jobExecutorActivate" value="false" />
<property name="enableDatabaseEventLogging" value="false" />
<property name="idGenerator">
<bean class="org.activiti.engine.impl.persistence.StrongUuidGenerator" />
</property>
<property name="typedEventListeners">
<map>
<entry key="VARIABLE_UPDATED" >
<list>
<ref bean="variableUpdateEventListner"/>
<!–<bean class="com.uprr.netcontrol.workflow.event.listeners.VariableUpdateEventListener"></bean>
–></list>
</entry>
</map>
</property>
</bean>
<code>
And listener class:
<code>
public class VariableUpdateEventListener implements ActivitiEventListener {
protected static final transient Logger LOGGER = LoggerFactory.getLogger(VariableUpdateEventListener.class);
private EventPublisher eventPublisher;
@Override
public final boolean isFailOnException() {
return false;
}
@Override
public final void onEvent(final ActivitiEvent event) {
switch (event.getType()) {
case VARIABLE_UPDATED:
LOGGER.INFO("variable update event fired for process id {}", event.getProcessInstanceId());
break;
default:
break;
}
}
}
<code>