List Info

Thread: Re: Workflow Script to set expiration date




Re: Workflow Script to set expiration date
country flaguser name
New Zealand
2007-03-19 00:19:36
Thanks Andreas - saved me loads of time trying to figure out the esoteric. For the record, the completed script is as follows:

object = state_change.object
object.setExpirationDate(DateTime() + 31)

It triggers after a change of state from 'new' to 'public' in the InventoryBuilder custom workflow.

Regards, Barry

----- Original Message ----
From: Andreas Jung <listszopyx.com&gt;
To: Andreas Jung <listszopyx.com&gt;; Barry Page <barry_pageyahoo.co.nz>; plone-userslists.sourceforge.net
Sent: Monday, 19 March, 2007 5:08:56 PM
Subject: Re: [Plone-Users] Workflow Script to set expiration date



--On 19. März 2007 06:02:45 +0100 Andreas Jung <listszopyx.com&gt; wrote:

&gt;
>
>; --On 18. März 2007 21:41:28 -0700 Barry Page <barry_pageyahoo.co.nz>
> wrote:
>;
>> I am using Plone to publish classified ads, which I want to expire
>;> automatically 31 days after publishing. &nbsp;I would like to write a workflow
&gt;> script that sets the object expiration date to current + 31, and don't
>> know how to go about that (ie what the python syntax etc would be).
>&gt; Could someone please point me in the right direction?
>
> Read this:
>
> <http://plone.org/documentation/tutorial/creating-workflows-in-plone/intr
&gt; oduction&gt;
>
>; As documented: the current object is available through the 'state_change'
> parameter passed to each workflow script. Setting the expiration date is
> trivial:
&gt;
>&nbsp; someobject.setExpirationDate(DateTime() + 31)
>

In addition: read the posting "Automated smpt message in plone" posted on
this list some hours ago.

-aj


Send instant messages to your online friends http://au.messenger.yahoo.com
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )