[Zope-CMF] Re: Zope 3 events from workflow

Tres Seaver tseaver at palladion.com
Tue Jan 2 11:07:22 EST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chris Withers wrote:
> Hi All,
> 
> Martin Aspeli wrote:
>> class IWorkflowEvent(IObjectEvent):
>>     """A workflow related event
>>     """
>>
>>     wf_name = TextLine(title=u"The name of the workflow this event is 
>> part of")
>>
>>     transition = TextLine(title=u"The name of the transition taking place")
>>
>>     state_before = TextLine(title=u"The object's state before the 
>> transition")
>>
>>     state_after = TextLine(title=u"The object's state after the 
>> transition")
> 
> I know I'm very late on this (sorry for taking a christmas vacation ;-) 
> but how would I go about subcribing to a particular transition of a 
> particular workflow?
> 
> This feels like the most common case for me, but it would seem that if 
> you want to do that with the current patch, you'd have to have a generic 
> subscriber that then if/then/else'd its way to only doing the right 
> thing for the right workflow and the right transition.
> 
> I thought avoiding that kind of if/then/else'ing was what event 
> subscribers were all about.

Not necessarily.  You could always register a "generic" subscriber which
then "republished" the more discrete events to those subscribers
interested.  Type-based dispatch is not an *end*, its a means, and
sometimes the burden needs to be distributed.

> Hopefully I'm just missing something, could someone enlighten me?
> (and by enlighten, I don't mean anything involving automotive fuel and 
> matches :-P)

No Yuletide bonfires here. ;)



Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFmoM5+gerLs4ltQ4RAu0PAJ9+VFrIxT5xhIMesaKAx3GXoFIveQCfVr8d
V19ywCpKDkBjCy9GEpomuZc=
=hP7n
-----END PGP SIGNATURE-----



More information about the Zope-CMF mailing list