def complete(self):
     from_function = FromFunction()
     invocation_result = from_function.invocation_result
     context = self.context
     self.add_mutations(context, invocation_result)
     self.add_outgoing_messages(context, invocation_result)
     self.add_delayed_messages(context, invocation_result)
     self.add_egress(context, invocation_result)
     # reset the state for the next invocation
     self.batch = None
     self.context = None
     self.target_function = None
     # return the result
     return from_function.SerializeToString()
 def complete(self):
     from_function = FromFunction()
     invocation_result = from_function.sagas_function_invocation_result
     context = self.context
     self.add_invocation_pairs(context, invocation_result)
     self.add_response(context.success_response,
                       invocation_result.success_response)
     self.add_response(context.failure_response,
                       invocation_result.failure_response)
     # reset the state for the next invocation
     self.batch = None
     self.context = None
     self.target_function = None
     # return the result
     return from_function.SerializeToString()