code: def cache_affected_objects_review_history(portal):
      
      logger.info("Caching review_history ...")
      query = dict(portal_type=NEW_SENAITE_WORKFLOW_BINDINGS)
      brains = api.search(query, UID_CATALOG)
      total = len(brains)
      for num, brain in enumerate(brains):
          if num % 100 == 0:
              logger.info("Caching review_history: {}/{}"
                          .format(num, total))
          review_history = get_review_history_for(brain)
          review_history_cache[api.get_uid(brain)] = review_history
docs: Fills the review_history_cache dict. The keys are the uids of the objects
      to be bound to new workflow and the values are their current review_history