Handling an IllegalDataException for invalid XML during serialization

When you convert a string that contains ASCII control characters to XML, you receive an IllegalDataException during serialization. You can add a configurable property in the 100Custom.xml file to automatically make strings XML-compliant.

About this task

When you enter XML characters into a form, coach, or a JavaScript API, the tw.system.serializer.toXml JavaScript API takes the input as a TWObject, parses it, and converts it into XML. If the TWObject contains a string with invalid XML characters, such as control characters 0x01 or 0x02, it raises an IllegalDataException. To have IBM® Business Process Manager automatically correct the XML code, you can add a configuration flag <autocorrect-xml> in the 100Custom.xml file that automatically removes invalid characters in a string input and makes it XML-compliant.

Procedure

  1. Stop the server for IBM Process Server or IBM Process Center.
  2. Locate and open the 100Custom.xml configuration file in a text editor.
  3. Add the following code to the file:
    <server>
        <autocorrect-xml>true</autocorrect-xml>
    </server>
  4. Save your changes to the 100Custom.xml file.
  5. Start the server for Process Server or Process Center.