private void submitXForm(Document doc,String xml,String pathName,boolean archive,boolean propagateErrors) throws Exception {
  String xmlOriginal=xml;
  try {
    fillPatientIdIfMissing(doc);
    saveComplexObs(doc,true);
    setMultipleSelectValues(doc.getDocumentElement());
    xml=XformsUtil.doc2String(doc);
    if (isRemoteFormEntry()) {
      FormEntryWrapper.createFormEntryQueue(xml);
    }
 else {
      processDoc(xml,pathName,propagateErrors);
      String patientid=DOMUtil.getElementValue(doc,XformBuilder.NODE_PATIENT_PATIENT_ID);
      Patient patient=XformObsPatientEdit.updatePatientDemographics(patientid,xml);
      RelativeSubmission.submit(xml,patient);
      if (archive)       saveFormInArchive(xmlOriginal,pathName);
    }
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
    saveFormInError(xmlOriginal,pathName,e);
    throw e;
  }
}

private void submitXForm ( Document doc , String xml , String pathName , boolean archive , boolean propagateErrors ) throws Exception { String xmlOriginal = xml ; try { fillPatientIdIfMissing ( doc ) ; saveComplexObs ( doc , true ) ; setMultipleSelectValues ( doc . getDocumentElement ( ) ) ; xml = XformsUtil . doc2String ( doc ) ; if ( isRemoteFormEntry ( ) ) { FormEntryWrapper . createFormEntryQueue ( xml ) ; } else { processDoc ( xml , pathName , propagateErrors ) ; String patientid = DOMUtil . getElementValue ( doc , XformBuilder . NODE_PATIENT_PATIENT_ID ) ; Patient patient = XformObsPatientEdit . updatePatientDemographics ( patientid , xml ) ; RelativeSubmission . submit ( xml , patient ) ; if ( archive ) saveFormInArchive ( xmlOriginal , pathName ) ; } } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; saveFormInError ( xmlOriginal , pathName , e ) ; throw e ; } }
submits a form to the form entry queue for further processing .
