'If we have a mapping for this result type, write it there.'

def _WriteResultToMappedAFF4Location(self, result, artifact_name, aff4_output_map):

    result_type = result.__class__.__name__
    if (result_type not in aff4_output_map):
        (aff4_obj, aff4_attr, operator) = self.GetAFF4PathForArtifactResponses(result_type)
        cache_entry = (aff4_obj, aff4_attr, operator, [])
        aff4_output_map[result_type] = cache_entry
    else:
        cache_entry = aff4_output_map[result_type]
    (aff4_obj, aff4_attr, operator, result_list) = cache_entry
    if (operator == 'Append'):
        result_list.append(result)
    elif (operator == 'Overwrite'):
        aff4_obj.Set(aff4_attr(result))
        self.Log('Wrote    %s    artifact    result    to    %s    on    %s', artifact_name, aff4_obj.urn, aff4_attr.predicate)
    else:
        raise RuntimeError('Bad    RDFMap    writing    method')
