Пример #1
0
 def update_workflow_state(self, name, state, target_state,
                           transaction_state, uuid, forked_from_uuid):
     msg = service_pb2.UpdateWorkflowStateRequest(
         auth_info=self._auth_info,
         workflow_name=name,
         state=state.value,
         target_state=target_state.value,
         transaction_state=transaction_state.value,
         uuid=uuid,
         forked_from_uuid=forked_from_uuid
     )
     try:
         response = self._client.UpdateWorkflowState(
             request=msg, metadata=self._get_metadata())
         if response.status.code != common_pb2.STATUS_SUCCESS:
             logging.error(
                 'update_workflow_state request error: %s',
                 response.status.msg)
         return response
     except Exception as e:
         logging.error('workflow %s update_workflow_state request error: %s'
                       , name, repr(e))
         return service_pb2.UpdateWorkflowStateResponse(
             status=common_pb2.Status(
                 code=common_pb2.STATUS_UNKNOWN_ERROR,
                 msg=repr(e)))
Пример #2
0
 def update_workflow_state(self,
                           name,
                           state,
                           target_state,
                           transaction_state,
                           uuid,
                           forked_from_uuid,
                           extra=''):
     msg = service_pb2.UpdateWorkflowStateRequest(
         auth_info=self._auth_info,
         workflow_name=name,
         state=state.value,
         target_state=target_state.value,
         transaction_state=transaction_state.value,
         uuid=uuid,
         forked_from_uuid=forked_from_uuid,
         extra=extra)
     response = self._client.UpdateWorkflowState(
         request=msg,
         metadata=self._get_metadata(),
         timeout=Envs.GRPC_CLIENT_TIMEOUT)
     if response.status.code != common_pb2.STATUS_SUCCESS:
         logging.debug('update_workflow_state request error: %s',
                       response.status.msg)
     return response