[Zope-CMF] workflow and deletes
Jens Vagelpohl
jens at dataflake.org
Wed Feb 14 10:42:58 EST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 14 Feb 2007, at 15:10, Miles wrote:
> I was wondering how - if at all - others have made a workflow react
> to deletion of an object. Is there any call for some hook/event
> that allows workflows to respond to this event? It seems a bit odd
> to me that workflows are carefully notified of creation via
> notifyCreated, but can't do anything about deletions.
The standard workflows shipping with CMF simply never cared, no one
had the need. I believe the same is true for the standard Plone
workflows.
> I thought of creating a 'delete' workflow action, but that would
> cause problems if ever the object were deleted via a different
> mechanism (e.g. zmi).
For older CMF versions you'd normally define your own
manage_beforeDelete to do whatever you want it to do just before the
onject is deleted.
In CMF-trunk, the future CMF 2.1, this has been changed to use events
instead. Take a look at CMFCore/events.zcml for how to register an
event handler and CMFCore/CMFCatalogAware.py to see some handlers.
Obviously this is a much better solution since you don't need to
change existing code, you just need to write a handler function and
register it using zcml.
jens
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iD8DBQFF0y4CRAx5nvEhZLIRAgOyAJ9t+poUDsWqiib5RTeQEAvgGTvVyQCfaDxg
CFfUEbRjGmZufvpnDSK5Il8=
=yOdI
-----END PGP SIGNATURE-----
More information about the Zope-CMF
mailing list