[Zope-CMF] DCWorkflow: detecting changes to object

Paul Winkler pw_lists@slinkp.com
Sat, 21 Jun 2003 03:27:58 -0400


I've been tasked with creating a workflow that sends an email
notification anytime an object is created or changed by ftp 
or webdav upload. This workflow is not used for anything other
than triggering these emails.

I've handled creation successfully, by creating two states
("new" and "notification sent"), and an automatic transition
from the former to the latter.  The transition ("notify")
has as its guard expression "python:1", and after the state
change it calls a script that sends email.  "new" is set as
the initial state.

That works just fine. But it seems that re-upload of an existing 
object counts as modification, not delete & create.  So 
in this case, the email is not sent - and we need it to be sent.

I think what I need is a guard expression that says something like
"Trigger this transition if the object's modification time is
less than the last time I triggered this transition for this object."  
But I can't figure  out how to do that.  Any suggestions?

-- 

Paul Winkler
http://www.slinkp.com