In my Form Submission Preprocessor I retrieve the XML of the filled out form.
def xmlDoc = new XmlDoc(submissionDataBean.submittedData)
We then make a call to one of our internal systems using a web service call.
The web service call returns a receipt number.
I then try to write that receipt number to the XML and continue on to the delivery process.
def groovyService = ServiceLocator.getServiceForName(CALL_SYSTEM) responseMap = groovyService.invokeService(parameters)
Loop through responseMap and write value to XML
xmlDoc.setText("/AvokaSmartForm/FormRawValue/Value1", VALUE )
submission.setSubmissionPropertyValue("submissionXML",xmlDoc.toFormattedString()) return submissionDataBean
When I open the delivery service, the receipt number has not been written into XML.
I'm assuming that the delivery service gets the submission XML from the form and not the XML that I have just written?
How can I write to the XML in my Form Submission Preprocessor and make sure that the values aren't being overwritten?
The setSubmissionPropertyValue(name, value) method writes the xml to submission property and not to the submission itself.
There is a seperate service com.avoka.fc.core.service.SubmissionDataService which will allow you to set the receipt number and update the xml if needed.
Please look at below methods in SubmissionDataService
setSubmissionReceiptNumber(Submission submission, String receiptNumber)
setSubmissionXmlData(Submission submission, String xmlData, HttpServletRequest request)
I hope this helps. Please let us know if you need any other info in resolving this.