Ejemplo n.º 1
0
 /**
  * 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)
 {
     $body = $exchange->getIn()->getBody();
     if ($body instanceof Common\Mutable\HashMap) {
         $writer = new Config\JSON\Writer($body);
         $writer->config($this->policy->toDictionary());
         $writer->export($exchange->getOut());
         return BT\Task\Status::SUCCESS;
     }
     return BT\Task\Status::FAILED;
 }