Can anyone help me with this?
Which version of LiveCycle ES are you running? There was a problem in 8.0 that caused XML nodes to get clobbered.
We're running 8.2
Sorry. I also meant to ask if you post the XPath that you are using to replace the XML node.
No problem. The initial XML stored in the xml variable looks like this:
<comments>Why doesn't she like me? I like her.... What have I done?</comments>
The xpath I was trying to use to add information was:
/process_data/XMLData/History/IssueHistory for the Location
/process_data/FormData/object/data/xdp/datasets/data/CI/page1/IssueSummary/Middle/Submitte dBy for the expression
My thinking was that in adding it to the IssueHistory node, it would add another SubmittedBy but it didn't. But now looking at it I think I need whole other History node to do what I trying to do. But my problem is that it continues to overwrite the previous data in the xml variable. How can I insert the new data at the top?
You are right. You'll need to create a new <IssueHistory> element first and then use the set value with /process_data/XMLData/History/IssueHistory type of syntax to assign value to the newly created element.
I think there is no way to add an arbitary xml structure (something like 'create element as child of that element') in livecycle's xpath expression builder or basic components.
Obviously what you can do is to write some java code to create the xml structure and put it in Script component. Once you do that then use the set value to put values there.
Alternatively I know of a component that is designed just to do this history creation and it does all of the above. You just put that component after your user step and then you can configure what to put in history section.
Have a look at - http://www.avoka.com/avoka/components/TaskHistory/TaskHistory.shtml
Thanks for your help with this.
What did you endup doing?
Well because this was rushed, we went ahead and wrote to the database, and pulled back information when we needed it. When we get some more time, we'll probably have to re-work this solution with one that doesn't need to write to the DB between each step of the process. But for now it works....