Hash: SHA1

Jens Vagelpohl wrote:
> On 29 Aug 2006, at 01:36, Dmitry S. Makovey wrote:
>>> Sorry for crossposting it from Plone mailing list but I need some
>>> pointers ASAP :(
>>> I'm sure this topic came up before but I'm hard pressed right now and
>>> google returns nothing useful.
>>> What I need is to activate transitions on effective_date and
>>> expiration_date. Quick "screw-around" with automatic/WorkflowMethod
>>> transitions yeilded zero positive results (unless I'm doing it
>>> wrong). Anybody seen anything like this done before?

"Automatic" transitions can't fire by themselves in a request driven
world:  instead, they fire after any "user-driven" transition, assuming
that their guards pass, and keep firing until they "quiesce".

> Not sure what you mean by "transitions", the CMF (and I'm sure it's the
> same in Plone) use the effective/expiration dates to filter out items
> that are not effective yet or have expired when doing catalog searches.
> Since most views do rely on catalog searches this suppresses items quite
> effectively.

Yep -- this is how the "typical" site uses those dates.  However, some
folks want actual workflow transitions to happen ASAP after each date
passes.  In that case, you need to write a periodic task which searches
for objects which are in the "between" state (e.g., their expiration
date has passed but they are still "active"), and cause the workflow
tool to "tickle" the transition machinery.  E.g., as a Python Script::

  # untested
  for brain in context.portal_catalog.searchResults(
                        expiration_date={'query': ZopeTime(),
                                         'operator': 'max'}):
      obj = brain.getObject()
      wf_tool.doActionFor(ob, 'expire')

- --
Tres Seaver          +1 202-558-7113          [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"    http://palladion.com
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


Zope-CMF maillist  -  Zope-CMF@lists.zope.org

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to