code: def _process_terminal_state(self, freerun_entry, uow, flow_request=None):
          
          msg = 'UOW for {0} found in state {1}.'.format(freerun_entry.schedulable_name, uow.state)
          self._log_message(INFO, freerun_entry, msg)
          self.insert_and_publish_uow(freerun_entry, flow_request, reset_uow=True)
docs: method that takes care of processing unit_of_work records in
              STATE_PROCESSED, STATE_NOOP, STATE_INVALID, STATE_CANCELED states