How can I determine the fully qualified name space of a document type at runtime

I am writing a service that takes as input a generic document type. I need to be able to determine the fully qualified name of the document that is passed in as input to this service. The end goal of the service is to be able to take a generic document, determine its fully qualified name, and resolve that name to the broker document type that is associated with the document. The broker document type name (minus the “::”) is being used as the topic name that I will be publishing this document to in Tibco EMS.

Troy

Troy,

Well, you can, of course, get the local name of the document type without the namespace (folder.subfolder) qualification using just the IDataCursor.getKey() method.

You could use the isValidService example to determine if that name was, in fact, the fully qualified name of a document type.

However, I don’t know of a way to derive a fully qualified document type name without using some external repository. If your service is called with only the non-qualified document type name, say PurchaseOrder, you would not have any way of knowing whether the correct document type was pub.accounting:PurchaseOrder or pub.inventory:PurchaseOrder.

The pub.publish:publish service takes an additional parameter so that it knows the correct document to publish to the broker. If you want to do the same thing, but derive the document type name you’ll have to either restrict the problem space (only documents in these folders, for example) or come up with a way to look up the name in some repository (xml file, database, etc.).

HTH,

Mark

The best approach, IMO, would be for the service to be passed the fully-qualified document type name. As Mark pointed out, all the wM-supplied services that need to know the document type name expect the caller to pass it in. The document type name cannot be determined by the document’s name in the pipeline.

One possibility is to use, or implement something similar, TN document type recognition. It is able to determin a TN doc type (which is different from an IS doc type) based on recognition rules you set up. Once you know the TN doc type, you can look up the IS doc type if the TN document type definition has been set up properly. Probably not a path to go down, however. Would highly recommend that your generic “publish to TIB” service have a required “documentTypeName” parameter.

Hi Troy and Carlson,

Is there any service “to find the services ,that publishes a particular document” when you give the document as input.
i.e… When I give a document name,I should get the services that publishes this document. ??

Thnx
Sajeevan

I’ve never found such a facility. One could be created but it would involve using non-public services/Java classes to do it.

you can do this by writing a java service with Service.DoInvoke() method, The service name you can set it to “pub:publish”.

Regards,
Pradeep

How would this help “to find the services ,that publishes a particular document”?