Querying Trading Networkbs database

HOw do I query Trading Network’s (or webMethods) internal database?
Can anybody please explain to me how about the database that webMethods internally manages for all its operations?


It depends on what you’re trying to do. The WmTN package provides a variety of services to retrieve different pieces of data. The wm.tn.query folder contains services for retrieving documents in the same manner that TN Console does.

You can get a feel for the schema by reviewing the dbops.sql file found in the <integrationserver>\packages\WmTN\config directory.

Very often when a customer ask question like this, they’re looking to do a one-time (or infrequent periodic) query to produce a report. So this may or may not apply to what raghav is trying to do, but for the benefit of others, here’s something I do.

Two things commonly queried as the documents process (Transaction Analysis) and processes (Conversations in TN 4.*). For both, I perform a query to get what I need (in TN Console), and just do a “Export Query Result”, which creates a CSV representation of the query. I can then stick that into Excel, and do some simple analysis on them. Quick-N-Dirty of course! But hey, if it gets the job done…

For TN 6.*, pretty much the only meaningful thing left to query this way is Transaction Analysis…

New to Web Methods 6.1
I am looking for a way to dump the trading partner profiles to a delimited file (along with other data as our system grows). Can some one tell me the steps to do this.
I have tried the query in the Trading Networks Console. I have also tried to use wm.tn.query:createProfileQuery

I think TN Console used to be able to export the results of a profile query but I’m not sure. In any case, 6.1 doesn’t have that feature. :frowning:

There are a couple of ways for a do-it-yourselfer:

** Approach 1

Call wm.tn.profile:getProfileSummaries
The returned document list is a list of documents of the type defined by wm.tn.rec:ProfileSummary. Each document contains a variety of fields associated with a profile. You can use the ProfileID field that is returned to go get more stuff using the services in wm.tn.profile.

With this list, you can create your delimited strings holding the profile fields of interest and write them to a file. Or you could go all out and use the FF adapter to do that work.

** Approach 2

– set the parms to restrict results as desired
– this basically constructs the SQL statement under the covers

– set disablePaging to true

The output is a document list. The fields returned are
– PartnerID - the internal TN ID
– CorporationName
– UnitName
– Status

With this list in hand, you can use wm.tn.profile services to retrieve additional data.

To output, you’d do the same as approach 1 above.


** Approach 3

Multi-step job:

  • Export all profiles by using tnexport.[bat|sh] (depending on Unix or Win)
    — cd to $SERVER_ROOT$/packages/WmTN/bin
    — tnexport.[bat|sh] -xml TN_Profiles.xml -profiles

  • Write a Flow service reading in the export XML, and create your delimited file from Flow.

I didn’t say it was easy… 8(