Ejemplo n.º 1
0
 def dispatch_change(self, change: Event, path):
     try:
         try:
             _id, _file_type, ext = self._characterize(path)
         except KeyError as ker:
             LOG.error(ker)
             return
         try:
             if change is Event.DELETE:
                 LOG.debug('caught delete')
                 _contents = None
             elif ext == '.json':
                 _contents = self._get_file_contents(path, True)
             else:
                 _contents = self._get_file_contents(path, False)
         except JSONDecodeError:
             LOG.error(f'Could not decode valid json from {path}')
             return
         self.handle_change(change, _file_type, _id, _contents)
     except Exception as err:
         LOG.critical(f'Unexpected Critical Error: {type(err)}: {err}')
Ejemplo n.º 2
0
 def add_bpmn(self, _id, contents):
     try:
         res = next(self.zeebe_connection.deploy_workflow(_id, contents))
         LOG.debug(res)
     except Exception as err:
         LOG.critical(err)