def pause(self): # Pause the target workflow. wf_ex_db = wf_svc.request_pause(self.execution) # Request pause of tasks that are workflows and still running. for child_ex_id in self.execution.children: child_ex = ex_db_access.ActionExecution.get(id=child_ex_id) if (child_ex.runner['name'] in ac_const.WORKFLOW_RUNNER_TYPES and child_ex.status == ac_const.LIVEACTION_STATUS_RUNNING): ac_svc.request_pause( lv_db_access.LiveAction.get(id=child_ex.liveaction['id']), self.context.get('user', None) ) status = ( ac_const.LIVEACTION_STATUS_PAUSING if wf_ex_db.status == wf_states.PAUSING or ac_svc.is_children_active(self.liveaction.id) else ac_const.LIVEACTION_STATUS_PAUSED ) return ( status, self.liveaction.result, self.liveaction.context )
def pause(self): # Pause the target workflow. wf_ex_db = wf_svc.request_pause(self.execution) # Request pause of tasks that are workflows and still running. for child_ex_id in self.execution.children: child_ex = ex_db_access.ActionExecution.get(id=child_ex_id) if self.task_pauseable(child_ex): ac_svc.request_pause( lv_db_access.LiveAction.get(id=child_ex.liveaction['id']), self.context.get('user', None)) if wf_ex_db.status == wf_statuses.PAUSING or ac_svc.is_children_active( self.liveaction.id): status = ac_const.LIVEACTION_STATUS_PAUSING else: status = ac_const.LIVEACTION_STATUS_PAUSED return (status, self.liveaction.result, self.liveaction.context)
def pause(self): # Pause the target workflow. wf_ex_db = wf_svc.request_pause(self.execution) # Request pause of tasks that are workflows and still running. for child_ex_id in self.execution.children: child_ex = ex_db_access.ActionExecution.get(id=child_ex_id) if self.task_pauseable(child_ex): ac_svc.request_pause( lv_db_access.LiveAction.get(id=child_ex.liveaction['id']), self.context.get('user', None) ) if wf_ex_db.status == wf_statuses.PAUSING or ac_svc.is_children_active(self.liveaction.id): status = ac_const.LIVEACTION_STATUS_PAUSING else: status = ac_const.LIVEACTION_STATUS_PAUSED return ( status, self.liveaction.result, self.liveaction.context )