/** * This method processes the models and returns the status. * * @access public * @param BT\Exchange $exchange the exchange given to process * @return integer the status code */ public function process(BT\Exchange $exchange) { $status = BT\Task\Handler::process($this->task, $exchange); if ($this->isEnabled()) { switch ($status) { case BT\Task\Status::INACTIVE: $this->logger->add($this->level, 'Task: :task Status: Inactive', array(':task' => $this->task)); break; case BT\Task\Status::ACTIVE: $this->logger->add($this->level, 'Task: :task Status: Active', array(':task' => $this->task)); break; case BT\Task\Status::SUCCESS: $this->logger->add($this->level, 'Task: :task Status: Success', array(':task' => $this->task)); break; case BT\Task\Status::FAILED: $this->logger->add($this->level, 'Task: :task Status: Failed', array(':task' => $this->task)); break; case BT\Task\Status::ERROR: $this->logger->add($this->level, 'Task: :task Status: Error', array(':task' => $this->task)); break; case BT\Task\Status::QUIT: $this->logger->add($this->level, 'Task: :task Status: Quit', array(':task' => $this->task)); break; } } return $status; }