IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
Expand all | Collapse all

Parameter 'XMLObjectOld' is empty when updating xml document

  • 1.  Parameter 'XMLObjectOld' is empty when updating xml document

    Posted Wed July 27, 2005 04:10 PM

    Hello,

    I set the ‘onUpdate’ trigger of a XML node to a Server Extension function.
    This Server Extension function is written in Java.
    When I try to get the content of the parameter ‘XMLObjectOld’ when the whole document will be updated, ‘XMLObjectOld’ is empty.

    The update of the document will be made with

    _xquery=declare namespace tf = "http://namespaces.softwareag.com/tamino/TaminoFunction"update replace input()/Document[tf:getInoId(.)=“1”] with ‹xmlcontent›…‹/xmlcontent›

    or

    _process=
    ‹ino:request xmlns:ino=“http://namespaces.softwareag.com/tamino/response2”›
    ‹ino:object ino:id=“1”›
    ‹xmlcontent›…‹/xmlcontent›
    ‹/ino:object›
    ‹/ino:request›

    How can I get the old value of the XML node?

    Thanks and best regards

    Jens


    #webMethods
    #Tamino
    #API-Management


  • 2.  RE: Parameter 'XMLObjectOld' is empty when updating xml document

    Posted Wed July 27, 2005 04:49 PM

    The standard behaviour is that you get the old and the new content in the update trigger.

    There is an exception for updating via inserting with ino:id. This actually deletes the old document and inserts the new, thus calling the update trigger twice; first with the old content and an empty new content and then with empty old content and the new content.

    I guess with your xquery update call on root node you get the same behaviour.

    One trick I use in these cases is to store the old object somewhere when the new object is empty and take the stored object as old object when the new object is there and the old is empty (you of course have to ensure that you get the right old object).

    Julius Geppert
    Software AG


    #API-Management
    #webMethods
    #Tamino


  • 3.  RE: Parameter 'XMLObjectOld' is empty when updating xml document

    Posted Thu July 28, 2005 09:38 AM

    Thanks for the answer but this doesn’t work in my case.

    When I query if the parameter ‘XMLObjectNew’ is empty or ‘null’,
    the parameter isn’t empty or ‘null’.

    I tried to update with the two queries I’ve listed in my first message.

    Do my two queries also call the update trigger twice?
    Is there is another query to update the whole document so that the
    update trigger will be called twice?

    Best regards

    Jens


    #API-Management
    #webMethods
    #Tamino