'Allows this flow to send a message to its parent flow.
If this flow does not have a parent, the message is ignored.
Args:
response: An RDFValue() instance to be sent to the parent.
Raises:
RuntimeError: If responses is not of the correct type.'

def SendReply(self, response):

    if (not isinstance(response, rdfvalue.RDFValue)):
        raise RuntimeError('SendReply    can    only    send    a    Semantic    Value')
    if (self.runner_args.request_state.session_id and self.runner_args.send_replies):
        request_state = self.runner_args.request_state
        request_state.response_count += 1
        msg = rdf_flows.GrrMessage(session_id=request_state.session_id, request_id=request_state.id, response_id=request_state.response_count, auth_state=rdf_flows.GrrMessage.AuthorizationState.AUTHENTICATED, type=rdf_flows.GrrMessage.Type.MESSAGE, payload=response, args_rdf_name=response.__class__.__name__, args_age=int(response.age))
        self.queue_manager.QueueResponse(msg)
        if self.runner_args.write_intermediate_results:
            self.QueueReplyForResultCollection(response)
    else:
        self.QueueReplyForResultCollection(response)
