Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

pass entire xml document to event

Avatar

Level 4

I'm trying to define he event data using something such as the following:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
   elementFormDefault="unqualified" attributeFormDefault="unqualified">
   <xs:import schemaLocation="http://myserver:8080/repository/Schema/formabc.xsd" namespace="pi"/> 
   <xs:element name="Transportation-Notice">
      <xs:complexType>
         <xs:sequence>
            <xs:element ref="pi:formabc"/>
         </xs:sequence>
       </xs:complexType>
   </xs:element>
</xs:schema>

I'm getting a failed to load data event when trying to use the event.  Can anyone provide a suggestion?

6 Replies

Avatar

Former Community Member

I do not believe it is possible to use a process variable of type 'xml' in event processing. I would suggest serializing the XML to a string, passing the string to the event handler, and deserializing the XML.

Steve

Avatar

Level 4

Can I use a process activity to do that or do I need to write code?

Avatar

Former Community Member

Yes, it can be done in a Set Value operation using functions.

to string - for the expression use the String function string(object?) where object? is the process variable of type 'xml'

to XML - for the expression use the Miscellaneous function deserialize(string)

Steve

Avatar

Level 4

Thanks, but it looks like I'm limited to a 4000 character length string for the serialized document due to a database data type constraint.  I hope it's enough.

Avatar

Level 10

You should be able to pass your xml as part of the Event Message Template portion of the event.

Jasmin

Avatar

Level 4

Thank you both.  I was able to pass the entire document as xs:xml.

The problem with the string length limit was odd.  It appeared that although I changed the lenght limit to unlimited, oracle did not change the data type of the variable.

I kept getting a ORA-01460.  So I eventually create a new variable with an unlimited length to attempt to serialize the document.  I didn't end up using the string variable, but I did learn a little lesson about how livecycle process variables are persisted.