<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cache_affected_objects_review_history(portal):
 """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 """

    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