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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
Expand all | Collapse all

matching recursive elements in multiple collections

  • 1.  matching recursive elements in multiple collections

    Posted 10/06/04 02:25 PM

    Hello!

    I have a problem to construct a query to match enumeration in multiple collection and I don’t know if it is possible (I know the existence of “collection()” function, but I can’t construct a working query)

    My 2 schemas can be found at:
    Organisation Schema
    contract Schema

    I have to put the organisation schema into another collection because in the future we want to connect to an LDAP server.

    What I try to do is to find
    - all contract Number
    - where one of the responsibleUid is equal to an //organisationalPerson/cn, of a specified OrganisationalUnit or his subunits - ie:where OrganisationalUnit/ou = ‘toto’.

    Is it possible to create a query to return this result?


    Thanks


    #webMethods
    #Tamino
    #API-Management


  • 2.  RE: matching recursive elements in multiple collections

    Posted 10/07/04 12:47 PM

    Hi,

    As far as I understand your post you try to do a cross-collection join in order to retrieve all contracts that are related to a particular organisational unit.
    I think the following query should do the job:

    declare namespace ctC=?contract/contract?
    declare namespace ctO=“contract/contractOrganisation”

    for $a in collection(?contractColl?)/ctC:contract
    where for $b in collection(?contractOrg?)/ctO:contractOrganisation//ctO:OrganisationalUnit
    where $b/ctO:ou =?toto? and $b//ctO:OrganisationalPerson/ctO:cn = $a/ctC:contractResponsibleUid
    return $a/@ctC:ID

    It iterates over all contracts and checks for each contract if there is an OrganizationalUnit named ?toto? that has an OrganisationalPerson that is referred by the ctC:contractResponsibleUid sequence. For each successfully checked contract the ID attribute is returned. Please be ware that I didn?t check the query with the Tamino XQuery processor. So it may contain some syntax or typing errors.

    Best regards,

    Thorsten Fiebig


    #webMethods
    #API-Management
    #Tamino