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.  Circular references?

    Posted Mon April 01, 2002 05:53 PM

    I am trying to define a simple schema that contains a “circular” reference and need some advice. I think this is a fairly standard situation.
    I have a list of users who belong to user groups. So I envision two doc-types in my schema - user and user-group. A user may belong to many user-groups and a user-group contains many users. How would I define my schema?

    Here is a sample schema that I would have thought should work. Tamino won’t let me define this because of the ordering (“missing node reference” error) but there is no way to fix this. What to do?

    Schema:
    <?xml version = "1.0" encoding = "US-ASCII"?>
    <xs:schema xmlns:xs = “XML Schema” xmlns:tsd = “http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition”>
    xs:annotation
    xs:appinfo
    <tsd:schemaInfo name = “test”>
    <tsd:doctype name = “user-group-role”>
    tsd:logical
    tsd:contentclosed</tsd:content>
    </tsd:logical>
    </tsd:doctype>
    <tsd:doctype name = “user”>
    tsd:logical
    tsd:contentclosed</tsd:content>
    </tsd:logical>
    </tsd:doctype>
    <xs:element name = “user”>
    xs:complexType
    xs:sequence
    <xs:element name = “user-group-role_obj_id” type = “xs:string” minOccurs = “0” maxOccurs = “unbounded”>
    xs:annotation
    xs:appinfo
    tsd:elementInfo
    tsd:physical
    tsd:native
    tsd:objectRef
    tsd:dereference</tsd:dereference>
    <tsd:accessPredicate operator = “=”>
    tsd:nodeRef/user-group-role/@ID</tsd:nodeRef>
    </tsd:accessPredicate>
    </tsd:objectRef>
    </tsd:native>
    </tsd:physical>
    </tsd:elementInfo>
    </xs:appinfo>
    </xs:annotation>
    </xs:element>
    </xs:sequence>
    <xs:attribute name = “userid” type = “xs:string”></xs:attribute>
    <xs:attribute name = “password” type = “xs:string”></xs:attribute>
    </xs:complexType>
    </xs:element>
    <xs:element name = “user-group-role”>
    xs:complexType
    xs:sequence
    <xs:element name = “user_obj_id” type = “xs:string” minOccurs = “0” maxOccurs = “unbounded”>
    xs:annotation
    xs:appinfo
    tsd:elementInfo
    tsd:physical
    tsd:native
    tsd:objectRef
    tsd:dereference</tsd:dereference>
    <tsd:accessPredicate operator = “=”>
    tsd:nodeRef/user/@ID</tsd:nodeRef>
    </tsd:accessPredicate>
    </tsd:objectRef>
    </tsd:native>
    </tsd:physical>
    </tsd:elementInfo>
    </xs:appinfo>
    </xs:annotation>
    </xs:element>
    </xs:sequence>
    <xs:attribute name = “group_name” type = “xs:string”></xs:attribute>
    </xs:complexType>
    </xs:element>


    #API-Management
    #Tamino
    #webMethods


  • 2.  RE: Circular references?

    Posted Tue April 02, 2002 06:14 PM

    Tamino’s schema does not allow to reference a doctype not yet fully being defined. Hence, it is not possible to define a schema with a cycle of doctypes referring each other in one step. Instead you have to define a restricted schema in the first step containing just the backward reference and the forward reference being removed:


    <xs:element name=“user-group-role”>
    xs:complexType
    xs:sequence
    <xs:element name=“user_obj_id” type=“xs:string” minOccurs=“0” maxOccurs=“unbounded”>
    xs:annotation
    xs:appinfo
    tsd:elementInfo
    tsd:physical
    tsd:native

    </tsd:native>
    </tsd:physical>
    </tsd:elementInfo>
    </xs:appinfo>
    </xs:annotation>
    </xs:element>
    </xs:sequence>
    <xs:attribute name=“group_name” type=“xs:string”/>
    </xs:complexType>
    </xs:element>

    After defining this schema successfully, you should be able to define your original schema.


    #API-Management
    #Tamino
    #webMethods


  • 3.  RE: Circular references?

    Posted Mon April 15, 2002 10:29 PM

    Ulrich, thanks for this. Sorry it took so long to acknowledge your help.

    I guess this means that if I want to have this kind of thing in my schema I have to keep multiple .TSD files around in order to recreate my schema. Ugh.

    Do you have any comments on my approach? Perhaps I should just use my own keys and implement my own “foreign key” checking? I have received that advice from one other person already but I am interested in your thoughts.


    #API-Management
    #webMethods
    #Tamino