Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Unable to insert XML in CLOB (for Long Lived Processes)

Avatar

Level 7

I am trying to insert XML/XDP in a CLOB column of an Oracle Database. It seems to work in a short lived process. However, I get all sorts of errors when I convert it to long lived.

Anyway one know why?

I extract the XML/XDP using a process form submission module and convert it to string. Then, I run the insert through a custom script as setString.

Aditya

5 Replies

Avatar

Level 7

I get an ORA error saying string literal is too long. It doesn't give the error for the short lived process. Trying to increase the string variable size to unlimited crashed the workflow.

Can you suggest a better way to extract the XML/XDP and insert in the CLOC column.

Aditya

Avatar

Level 10

The reason you're not getting the error with a short lived process is because it doesn't save data to the database.

I'm surprised it crashes the workflow if you set the variable to unlimited.

Can you create another variable and set it to unlimited. I'm just wondering if it'll create the same data type when you set it to unlimited the first time as oppose to do a modification once it's been created.

In Mysql the data type should be LongBlob.

Jasmin

Avatar

Level 7

This has been an issue in the past. When I try to change the string size to unlimited, it doesn't allow me to save the process. However, when I create a new string variable and assign it to unlimited, it worked.

I am thinking, when the string variable is saved the first time with a limit or a lower limit, it saves it to a Varchar2 and it is unable to change to a different column type when a higher char limit or unlimited it set. Don't you think this is a serious issue in existing processes with lower limits on string variables. Do you know a stable work around?

Also, how can I get value from an XML variable, using a custom script? "patExecContext.getProcessDataValue" doesn't work.

Aditya

Avatar

Level 10

I just did a test on my server and the data type got updated to LongBlob, but there still might be a bug depending of the app server/database.

For the execute script, I tried the following which worked for me:

import org.w3c.dom.*;

org.w3c.dom.Document xmlDoc = patExecContext.getProcessDataValue("/process_data/inXML");

patExecContext.setProcessDataValue("/process_data/outXML",xmlDoc);

Jasmin