thanks for the thoughts... :)  I'm using zope.app.workflow (the X3.0 addon).  IRelease is just a content object.  I think, just like you mentioned, that I can work my way around it by looking at event.object...  Just like you mentioned, and Jim mentioned earlier, I think I was counting on a behavior that mirrored IObjectEvent (like someMethod(obj, event) to be the subscribing method). 

if I get it working using event.object instead of method(object, event), I might look at hacking out a change, at least to see how far i can get with it, to zope.app.workflow to redispatch, but I don't think I understand the event dispatch machinery well enough yet to know if it's within my grasp.  a review of IObjectEvent is in order for me ;)

Thanks much!

On 10/5/05, Florent Guillaume <[EMAIL PROTECTED]> wrote:

Pete Taylor wrote:
> hi all... question for any event subscriber gurus (or just anyone who knows
> more than me, which probably won't take much ;) )
> i have a set of actions that i would like to have trigger off of a
> particular state in a workflow. in my unittest i can see that the workflow
> fires the event, but my subscriber doesn't pick up on it. similarly, the
> subscriber i have in zcml in the application proper does not respond when
> the workflow transition event is fired.
> the functionality works if i explicitly call my subscription method against
> the event, but that only proves that the functionality of the code isn't
> broken...
> the relevant zcml portion is as follows:
> <subscriber
> for="">> zope.app.workflow.stateful.interfaces.IAfterTransitionEvent"
> factory=".release.notifyTransition"
> />
> the unittest subscribes with ztapi as follows:
> ztapi.subscribe((IRelease, IAfterTransitionEvent), None, notifyTransition)

As Jim mentioned, and as I discovered yesterday :), the ability to subscribe
using a multi-adapter is not "stock" behavior of the basic event
notification (which only sends one IEvent object), but actually behavior of
the IObjectEvents, which have a special subscriber re-dispatching on both
event.object and event, so that the multi-adapter subscribers can work.

What workflow framework are you using ? And what's
qarelease.interfaces.IRelease ? Is it a transition or something else ?

That framework could be updated to do the same dance, if there's a clear
"object" there. Or maybe some workflow event interfaces could be subclassed
from IObjectEvent.


Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]

Zope3-users mailing list

Reply via email to