Ejemplo n.º 1
0
 public function processCheckInboundAction()
 {
     $inbound = new eFaxInbound();
     $inbounds = array();
     $ret = 0;
     //$inbound->checkInbounds();
     if ($ret > 0) {
         $inbounds[] = 'eFax: ' . $ret;
     }
     $ret = ePrescribe::pull();
     if ($ret > 0) {
         $inbounds[] = 'ePrescribe: ' . $ret;
     }
     if (!isset($inbounds[0])) {
         $data = 'none';
     } else {
         $data = "\n" . implode("\n", $inbounds);
     }
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct($data);
 }
Ejemplo n.º 2
0
 public function startProcessing($infinite = true)
 {
     $infinite = (bool) $infinite;
     do {
         $ctr = ePrescribe::pull();
         WebVista::log('ePrescribe messages received: ' . $ctr);
         $this->_populateAudits();
         foreach ($this->_audits as $audit) {
             WebVista::log('start processing auditId:[' . $audit->auditId . '], objectClass:[' . $audit->objectClass . '], objectId:[' . $audit->objectId . ']');
             $audit->_persistMode = WebVista_Model_ORM::REPLACE;
             $audit->_ormPersist = true;
             if ($audit->startProcessing == '0000-00-00 00:00:00') {
                 $audit->startProcessing = date('Y-m-d H:i:s');
                 $audit->persist();
             }
             $processResult = true;
             foreach ($this->_processes as $process) {
                 $process->preProcess($audit);
                 $result = $process->process($audit);
                 $process->postProcess($audit);
                 $processResult &= $result;
                 if ($result) {
                     continue;
                 }
             }
             if ($processResult) {
                 $audit->endProcessing = date('Y-m-d H:i:s');
                 $audit->persist();
             }
         }
         // invoke extra process that are not dependent on Audits
         foreach ($this->_processes as $process) {
             $process->extraProcess();
         }
         sleep($this->_sleepInterval);
     } while ($infinite);
 }