code: private <T> T doInXOTransaction(TransactionalSupplier<T> txSupplier) throws RuleException {
          try {
              store.beginTransaction();
              T result = txSupplier.execute();
              store.commitTransaction();
              return result;
          } catch (RuleException e) {
              throw e;
          } catch (RuntimeException e) {
              throw new RuleException("Caught unexpected exception from store.", e);
          } finally {
              if (store.hasActiveTransaction()) {
                  store.rollbackTransaction();
              }
          }
      }
docs: Executes a {@link TransactionalSupplier} within a transaction.
  
  @param txSupplier
  The {@link TransactionalSupplier}.
  @param <T>
  The return type of the {@link TransactionalSupplier}.
  @return The value provided by the {@link TransactionalSupplier}.
  @throws RuleException
  If the transaction failed due to an underlying
  {@link XOException}.