[Zope-CMF] DcworkFlow swallows second parameter to ObjectMoved

Robert Rottermann robert@redcor.ch
Fri, 6 Sep 2002 13:07:23 +0200


Shane,
thanks for your answer.

> ObjectMoved exceptions.  I have created a simple workflow repository for
> a customer project; anyone interested in the code?

I am very much interested in your code.

Robert

----- Original Message -----
From: "Shane Hathaway" <shane@zope.com>
To: "Robert Rottermann" <robert@redcor.ch>
Cc: <zope-cmf@zope.org>
Sent: Wednesday, September 04, 2002 10:49 PM
Subject: Re: [Zope-CMF] DcworkFlow swallows second parameter to ObjectMoved


> Robert Rottermann wrote:
> > Hello,
> > I am trying to move an object during a transaction.
> > in the transaction script I raise ObjectMoved(neobj, "url to the new
> > object") exception.
> > However this second  parameter gets swallowed later on when ObjectMoved
is
> > rerisen.
>
> Well, in the current design, you're not supposed to use the second
> parameter.  It's reserved for use by the "workflow method" stuff.
>
> > This seems to be an error, or did I missunderstand something?
>
> It works, but it's misdesigned. :-)
>
> Dieter Maurer wrote:
>  > Funny code.
>  >
>  >   One would expect the author wanted to prevent a reraise
>  >   conciously. But, then, it reraises anyway. It just discards
>  >   the result.
>  >
>  >   Maybe, you ask Shane why he does this.
>
> The idea is that when a workflowed object has moved, you want to start
> manipulating the object in the new place rather than the old.  So
> DCWorkflow has to catch this exception to know what object to
> manipulate, then re-raise it so that outer code also knows to work with
> the object in the new place.  Perhaps we could hold on to the original
> exception and re-raise it, rather than creating a new exception.
>
> I think this oddness goes away if you store workflows independently of
> the object, in a "workflow repository".  It eliminates the need to raise
> ObjectMoved exceptions.  I have created a simple workflow repository for
> a customer project; anyone interested in the code?
>
> Shane
>
>
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
>
> See http://collector.zope.org/CMF for bug reports and feature requests
>