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
  • 1.  (cvc-model-group.1) on UPDATE

    Posted Fri December 13, 2002 10:13 AM

    i have an element with inside a sequence of instance element.Each instance consist on 2 different element named watcher and tupleid.

    a
    b
    1
    3


    My desire is to add a new element watcher. So with jdom i do:

    List watchers = instance.getChildren(“watcher”);
    Element newatcher = new Element(“watcher”);
    newatcher.setText(“c”);
    watchers.add(newatcher);
    but i get:
    Update Error:com.softwareag.tamino.db.API.accessor.TUpdateException
    Access Failure:
    ReturnValue:7730
    Code:INOXDE7730
    MessageText:(cvc-model-group.1):invalid end of sequence
    MessageLine:Line 15, Column 2: [element “watcher” in element “instance”]
    effectively printing the element i get right expected:


    a
    b
    1
    3
    c


    something like the Muller Karla insert in ProcessPersonwithSchema in the TAmino example.
    But i don’t understand why because i have taken only the list of childen named “watcher”…
    What’s wrong?

    BEST REGARDs
    @nto


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


  • 2.  RE: (cvc-model-group.1) on UPDATE

    Posted Fri December 13, 2002 04:55 PM

    I can reproduce this JDOM problem and my bypass is pretty ugly but it works…

    If you create two lists (in your case), one of watchers and one of TupleIDs, then when you have finished adding watchers you can create a single list from both of these, and set the new combined list as the children of the parent node:

    watchers.add(newwatcher);
    List tupleIDs  = instance.getChildren("tupleID");
    watchers.addAll(watchers.size(),tupleIDs);
    instance.setChildren(watchers);

    This could get really nasty if the tree structure was more complex - does anyone know a better way?


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


  • 3.  RE: (cvc-model-group.1) on UPDATE

    Posted Fri December 13, 2002 05:47 PM

    i found i solution!!!
    watchers.add(0,newatcher);
    i add it in the first position, so the element sequence in my TSD is respected!!!
    it’s look so a fast (not too smart) solution!!!

    Thanks
    @nto


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


  • 4.  RE: (cvc-model-group.1) on UPDATE

    Posted Mon December 16, 2002 09:28 AM

    Yes or you can add to the end of the list with

    watchers.add(watchers.size(),newatcher);

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