Ok, so the Work Order driver does not scale. This is because the shim
uses the Query command class which cannot query for dates in the
past/future.

Lothar solved this problem in his password notifier driver by using an
ECMA based ldapSearch() function, since LDAP can query for DateAttr >
201011111111Z or the like.

I have a WO driver that is dying under load, since there are tens of
thousands of WO's, and every polling interval (10 minutes!), the Shim
reads back EVERY WO in the tree, looks at their DirXML-DueDate, and does
a date compare on the value.

Now IDM is pretty quick for stuff like this, but with many 10s of
thousands of them, this eats up any quickness.

I decided to use Lothar's approach and in the ITP intercept the
<query-ex> events that get sent, convert to some simple one object, one
value returned <query> that in the OTP I detect, do the LDAP Search that
is approproate, and the clone the LDAP Search results into that single
object result.

This actually works and is WAY faster!

But I only see 4 query cases so far:
DirXML-DueDate (really wants past due ones)
DirXML-nwoDeleteDate and DirXML-nwoStatus=error (no dates involved here
so no improvements. (And the state of DirXML-nwoDeleteOnError)
DirXML-nwoDeleteDate status=configured, (look for past events, to delete)
and finally this one
DirXML-nwoDeleteDate, status=pending,
Which I am not entirely sure what the shim is doing with it.

Other queries should be fine and will be ignored, so I should not be
breaking any other core functionality.

But are there other tricky things that the shim does with Queries?
Anyone noticed anything cool in what it does?

I will of course make a Package (and right 10-15 articles on how it
works) and make it available once I am done, but it is quite amusing.