public Void execute(CommandContext commandContext) { ExecutionEntity execution = commandContext.getExecutionManager() .findExecutionById(executionId); // fetch the variable instance but not the value (make sure the byte array is lazily fetched) VariableInstanceEntity varInstance = (VariableInstanceEntity) execution.getVariableInstanceLocal(varName); String byteArrayValueId = varInstance.getByteArrayValueId(); assertNotNull("Byte array id is expected to be not null", byteArrayValueId); CachedDbEntity cachedByteArray = commandContext.getDbEntityManager().getDbEntityCache() .getCachedEntity(ByteArrayEntity.class, byteArrayValueId); assertNull("Byte array is expected to be not fetched yet / lazily fetched.", cachedByteArray); monitor.sync(); // now trigger the fetching of the byte array Object value = varInstance.getValue(); assertNull("Expecting the value to be null (deleted)", value); return null; }
public Void execute(CommandContext commandContext) { ExecutionEntity execution = commandContext.getExecutionManager() .findExecutionById(executionId); // fetch the variable instance but not the value (make sure the byte array is lazily fetched) VariableInstanceEntity varInstance = (VariableInstanceEntity) execution.getVariableInstanceLocal(varName); String byteArrayValueId = varInstance.getByteArrayValueId(); assertNotNull("Byte array id is expected to be not null", byteArrayValueId); CachedDbEntity cachedByteArray = commandContext.getDbEntityManager().getDbEntityCache() .getCachedEntity(ByteArrayEntity.class, byteArrayValueId); assertNull("Byte array is expected to be not fetched yet / lazily fetched.", cachedByteArray); monitor.sync(); // now trigger the fetching of the byte array Object value = varInstance.getValue(); assertNull("Expecting the value to be null (deleted)", value); return null; }