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.

 View Only
  • 1.  New Tamino functionality EX

    Posted Wed March 12, 2003 12:31 PM

    I need an example of code of the new functionality of Tamino 4.1, like partial update(or delete).
    Who can help me?
    Best,
    @nto


    #webMethods-Tamino-XML-Server-APIs
    #webMethods
    #API-Management


  • 2.  RE: New Tamino functionality EX

    Posted Wed March 12, 2003 05:38 PM

    Hello @nto,

    here is an example of updating part of a document:

       String URI = "http://localhost/tamino/test";
    TConnection conn = TConnectionFactory.getInstance().newConnection(URI);
    TAccessLocation tal = TAccessLocation.newInstance("AccessList");
    TXMLObjectAccessor xmlAccessor = conn.newXMLObjectAccessor(tal,
    TDOMObjectModel.getInstance());
    
    TXQuery updateQuery = new 
    TXQuery("update replace input()/AccessList/instance[@accesslistID=0]/watcher" +
    "       with <watcher>has been erased</watcher>");
    
    TResponse response = xmlAccessor.xquery(updateQuery);



    As mentioned by Stuart, the best place to look is in the Tamino documentation on XQuery, which you will probably find somewhere around here: C:\Program Files\Software AG\Tamino\Tamino 4.1.1.1\Documentation\xquery\xq-update.htm

    Keep in mind that when changing/deleting parts of documents it is easy to get into the situation that the document no longer conforms to the schema.

    I hope that helps,
    Trevor.


    #webMethods-Tamino-XML-Server-APIs
    #webMethods
    #API-Management


  • 3.  RE: New Tamino functionality EX

    Posted Wed April 30, 2003 11:19 AM

    Trevor,

    For single elements the query pattern hat you suggested works fine. But, my requirement is to update/replace multiple elements of a particular doctype.

    Any suggestions.
    Ravi


    #API-Management
    #webMethods-Tamino-XML-Server-APIs
    #webMethods


  • 4.  RE: New Tamino functionality EX

    Posted Wed April 30, 2003 09:48 PM

    Hello Ravi,

    if I take the schema from your CDATA posting, the following update query is one way to update multiple nodes with a single query:

       update for $data in input()/SharpStatementData
    let $stmtData := $data/StatementData,
    $stmtKey := $data/KeyRecord
    where $data/StatementID=1
    do (replace $stmtData with <StatementData>New StatementData</StatementData>
    replace $stmtKey  with <KeyRecord>New KeyRecord</KeyRecord>)


    How does that look?

    Greetings,
    Trevor.


    #webMethods-Tamino-XML-Server-APIs
    #webMethods
    #API-Management


  • 5.  RE: New Tamino functionality EX

    Posted Thu May 01, 2003 05:50 AM

    Trevor,
    That worked fine.

    This is the query …(almost the similar one, as you posted)

    update for $info in input()/SharpStatementInfo
    let $status := $info/Status,
    $completeFlag := $info/CompleteFlag
    where $info/StatementID=1 and $info/UserID=“admin”
    do (replace $status with Generated
    replace $completeFlag with N)

    Thanks a lot,
    Ravi.


    #API-Management
    #webMethods-Tamino-XML-Server-APIs
    #webMethods