class Connector(object): """ this is object will be used to catch all requests from falcon and map them to workflow engine. a request to domain.com/show_dashboard/ will invoke a workflow named show_dashboard with the payload json data """ def __init__(self): self.engine = ZEngine() def on_get(self, req, resp, wf_name): self.on_post(req, resp, wf_name) def on_post(self, req, resp, wf_name): self.engine.start_engine(request=req, response=resp, workflow_name=wf_name) self.engine.run()
class Connector(object): """ this is a callable object to catch all requests and map them to workflow engine. domain.com/show_dashboard/blah/blah/x=2&y=1 will invoke a workflow named show_dashboard """ # def __init__(self): # self.logger = logging.getLogger('dispatch.' + __name__) def __init__(self): self.engine = ZEngine() def on_get(self, req, resp, wf_name): self.on_post(req, resp, wf_name) def on_post(self, req, resp, wf_name): self.engine.start_engine(request=req, response=resp, workflow_name=wf_name) self.engine.run()