Expand my Community achievements bar.

Error loading saved xml from database to form

Avatar

Former Community Member

Hi there,

I am having a problem reloading saved data to my form.  When I submit by email for testing purposes and then reload the data there are no issues, but when I submit data via a Workbench orchestration to a database and then reload the form with this same data it seems to be entering some kind of invisible data to some of the fields that were left empty before the save.

I can tell that something invisible is there because validation complains and if I enter something valid it over-writes what was there and validates without problems.  Also, when I submit by email from a form that has been reloaded with saved data empty tags, e.g. <tag />, are appearing for the fields in question whereas they are normally excluded from the xml if the fields are empty.

I am serializing the xml data in order to submit it to the database:

serialize(/process_data/xmlData, true())

I don't know if this has any relevance to the problem. 

The overall effect is I cannot successfully validate the form once it has been loaded with saved data.  Are there any ideas or known issues that might help solve this?

Thanks,

Kieran

7 Replies

Avatar

Level 10

As a first troubleshooting step, open your saved xml data from database and make sure that the entered data are present.

2:  make sure that the saved data is xdp compliant.

3: Make sure your form's schema and saved data hierarchy matches.

4. If all the above are okay, make sure that you use either SetValue or ImportData activity to merge the form data with form template appropriatelly.

If nothing works, send your LCA to nith.mof@gmail.com  I will try to fix the issue.

Nith

Avatar

Level 10

By the way, are you deserializing your saved data before merging it with the template?

Nith

Avatar

Former Community Member

Thanks for the suggestions Nith,

We are not deserializing.  Trying this we have inserted a SetValue operation after the database get operation.  In the mapping we have entered:

Location: /process_data/@form_data

Expression: deserialize(/process_data/@form_data)

But when testing we get error: 'java.lang.RuntimeException: Content is not allowed in prolog'

Is this how you would deserialize?

Another point: the first time we render a new form the xml data is not serialized, it only becomes serialized once we save.  Is there any issue with deserializing unserialized data?

Thanks again.

Kieran

Avatar

Level 10

Let me explain a typical case how to save your form data to database.

1. If you have created an xml variable to hold the form data (xdp content), you can directly serialize the xml variable and save it in a table (the column must be of varchar type).

2. later you can retrieve and use deserialize() to get the data back to your variable.

Or

In case, if you use document variable (which holds the PDF content), you need to use exportData() & ImportData() methods to get/set the XML data out of the PDF document.

If you can share your sample process, it would be easy to locate and fix the issue quickly.

Nith

Avatar

Level 10

But when testing we get error: 'java.lang.RuntimeException: Content is not allowed in prolog'

Content is not allowed in prolog: This error will occur if your variable has not data or some invalid data (e.g with any tag name, uncompleted tag etc)

So record and playback your process to look into the variable value.

Also, the following mapping does nothing; because deserialize is used to convert a String type to XML type.

Location: /process_data/@form_data

Expression: deserialize(/process_data/@form_data)

Nith

Avatar

Former Community Member

I had some sort of issue with reading in xml. I don't recall the issue, but to get it working I used an execute script to read it into a String variable then in a Set Value after, I move from the String variable into the xml variable. I am not using deserialize.

Avatar

Former Community Member

I may try using Post 5 by Jasmin from the thread below as an example to get rid of the extra Set Value step.

http://forums.adobe.com/thread/699858?tstart=30