A HistoryEventHandler with objects that have the Transient Flag set

From the code of VariableInstanceHistoryListener


/**
 * @author Thorben Lindhauer
 *
 */
public class VariableInstanceHistoryListener implements VariableInstanceLifecycleListener<VariableInstanceEntity> {

  public static final VariableInstanceHistoryListener INSTANCE = new VariableInstanceHistoryListener();

  @Override
  public void onCreate(final VariableInstanceEntity variableInstance, final AbstractVariableScope sourceScope) {
    if (getHistoryLevel().isHistoryEventProduced(HistoryEventTypes.VARIABLE_INSTANCE_CREATE, variableInstance) 
    && !variableInstance.isTransient()) {
      HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() {
        @Override
        public HistoryEvent createHistoryEvent(HistoryEventProducer producer) {
          return producer.createHistoricVariableCreateEvt(variableInstance, sourceScope);
        }
      });
    }
  }

Particularly the && !variableInstance.isTransient() at the end of the if statement means that any transient objects trigger no HistoryEventHandler that may be configured.

Is there a way of specifiying a different implementation of VariableInstanceHistoryListener as this doesn’t allow a lot of flexibility?

My use case is for debugging, I have an implementation of HistoryEventHandler that shows me when variables are being set/updated/deleted, only it doesn’t tell me anything about transient vars as they are excluded due to this statement.