[Zope-CMF] DCWorkflow innards. Why does the default state not honour automatic transitions??

robert rottermann robert@redcor.ch
Tue, 14 Jan 2003 22:39:52 +0100


Thanks for your answer,
When I copy a an existing Document the copy is treated like a newly creat=
ed=20
one and gets the initial state assigned. This is OK.=20
However since the Document is not really new I want it to aquire a state=20
different from the initial one. This transition could be done automatical=
ly=20
if only the workflow machinery would not stop short.

I can solfe my problem with a script within a transaction. But I would th=
ink=20
it more elegant if DCWorkflow would do it.

So my real question is wy does DCWorkflow show such a behaviour. Would=20
honouring automatic transactions have unwanted side effects?

Robert

Am Dienstag, 14. Januar 2003 20.39 schrieb Dieter Maurer:
> robert rottermann wrote at 2003-1-13 18:57 +0100:
>  > ...
>  > my farly recent version has the following method, which prevents the
>  > execution of any automatic transitions.
>
> You mix "tdef is None" with "self._getWorkfowStateOf(ob) is None"
>
> The "None" transaction means "entering the initial state".
> After you did this, "_getWorkflowStateOf" does not return "None"
> but the initial state.
> When it returns "None", no initial state is defined.
>
>  > ...
>  >     def _changeStateOf(self, ob, tdef=3DNone, kwargs=3DNone):
>  >         '''
>  >         Changes state.  Can execute multiple transitions if there ar=
e
>  >         automatic transitions.  tdef set to None means the object
>  >         was just created.         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  >         ~~~~~~~~~~~~^''
>  > ...
>  >                 sdef =3D self._executeTransition(ob, tdef, kwargs)
>  > ...
>  >             if sdef is None:
>  >                 break <--------------------------------------!!!!!!!=
!!!!
>  > ..
>
> Dieter
>
> _______________________________________________
> 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