/**
  * Handles receiving and storing the data from a form, files are stored on actual upload process
  * this only handles storing form data and can be used for resubmission too.
  *
  * @param type $xmlFile
  * @return string ResultID or false on failure
  */
 private function processReceivedForm($answerXmlFile)
 {
     //Log what we received
     $log = \Gems_Log::getLogger();
     //$log->log(print_r($xmlFile, true), \Zend_Log::ERR);
     $xml = simplexml_load_file($answerXmlFile);
     $formId = $xml->attributes()->id;
     $formVersion = $xml->attributes()->version;
     //Lookup what form belongs to this formId and then save
     $model = $this->getModel();
     $filter = array('gof_form_id' => $formId, 'gof_form_version' => $formVersion);
     if ($formData = $model->loadFirst($filter)) {
         $this->openrosaFormID = $formData['gof_id'];
         // Safeguard for when the form definition no longer exists
         try {
             $form = new OpenRosa_Tracker_Source_OpenRosa_Form($this->formDir . $formData['gof_form_xml']);
             $answers = $form->saveAnswer($answerXmlFile);
             return $answers['orf_id'];
         } catch (\Exception $exc) {
             return false;
         }
     } else {
         return false;
     }
 }