Setting Document Priorities in WebMethods Enterprise


Would like to know how do I set document priorities (both sending and receiving) for WM Enterprise ?


With document priorities, do you mean as in sending, using logic which go first ? Please be more specific as giving an example what you would like to do and what would you like to accomplish. If you would like to have document A and B to send to broker and before they reach the target you can use the out of the box “Join” adapter (included with the 4.6 version of the Enterprise Solution). It can provide you with the AND OR XOR logic within document send/recieving.

for more information you probally want to visit the advantage community which contains the documentation for the enterprise adapters (Join, Logger, Utility).



Basically, we have the following situation here

We have 2 Multi-Threaded intelligent adapters running within the WebMethods Enterprise Environment. Let’s call the 2 adapter Adapter-A and Adapter-B

We have the following Workflow/Integration Components hosted on Adapter-A

  1. Add Order (Adadper A will receive an addOrder message from an external order management system)
    This IC will lock (i.e. insert a lock entry in a database table), and then publish a plan order document
  2. Plan Order (Adapter A will subscribe to the plan order document published in step 1, validate the plan order document, and publish the plan shipment document)
  3. Receive Shipment Plan (Adapter A will subscribe to the shipment plan document published by adapter B), update the order persisted in database, and then Unlock the order (i.e. remove the lock entry from the database table)
  4. Receive ASN (Adapter A will subscribe to the ASN docment published by external order management system, lock the order, update the order in database, and then unlock the order)

When an addOrder message is received by Adapter A, it performs Add Order IC (Integration Compoents), which involves locking the order, then performs the Plan Order IC, then wait for the Shipment Plan document from Adadpter B. Meanwhile, an ASN document is received by Adapter A, it performs Receive ASN IC - cannot lock the order, this it waits (the application is designed wait for the lock). As long as there is no additional threads available, this will result in a deadlock situation. I.e. The Receive ASN IC is waiting for the lock, while the Receive Shipment Plan IC is waiting for a thread to continue

Advice Required

  1. If we can set priorities on document processing (i.e. assign higher priorities to those internal document - plan order, plan shipment, shipment plan document versus those external document - add order and ASN), we can miminize the occurences of these, at least in theory since Adapter A will always try to finish a AddOrder cycle before processing an ASN
  2. Another way is to make sure the AdadpterA will keep its thread of control from AddOrderIC -> PlanOrderIC->ReceiveShipmentPlan (so that it lock order, process/plan order, unlock order within the same thread) until it finishes.
    Is there any way to do it except by combining everything within ONE IC and merging Adapter A/B together

Thanks for advice

Find a large mountain of salt and take what I say with a couple of truckloads of it.

I don’t believe document priorities, as far as delivery by the broker is concerned, exists. The documents are stored in opaquely in the broker document storage facility.

One way to achieve the desired result for specific documents is to use a filters combined with subscriptions. Add the priority attribute to the document and use two different brokers. Configure one broker to subscribe to normal priority and the other to subscribe to high priority. This will at least create a situation where the high priority events will be delivered before most of the normal priority ones. TEST this before you rely on it.

BEWARE of the join adapter. It makes use of the broker storage to support your business logic requirement. Join functionality should really be implemented by your proprietary logic. This is real easy to implement programatically in Java or C++ but real hard using the existing GUI language of the adapters. This is why the Join adapter was created, to support GUI driven development. Please correct me if I am wrong.


Take a look at Chapter 2 in the CADK (Intelligent Architecture). There is a section titled Multi-threading Support for Adapters. It describes how you can control event ordering (a prioritization facility of sorts). I’m not sure there is a setting that will do what you need, however.

Another thought for consideration…

I assume in step 2. you really mean Adapter B where Adapter A was specified. Can steps 2 and 3 be made into a request/reply situation? When a plan order is published, a shipment is always returned in reply? Not sure if you can do that or not but it would prevent the thread in A from being released to process the next event–it would wait until a reply is received or a timeout occurs.

Not sure if this helps…


Cannot find the document CADK (Intelligent Architectue) you mentioned in my webMethods Install (v4.6). If possible, do you mind sending me a copy via email

thanks in advance


The doc is part of the wM Enterprise/Broker Online Library (or was) and is shipped on its own CD. You can also get it on Advantage.

Sorry but me sending it to you would probably violate NDAs/licenses.