Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: CMF

Workflow transitions automatic state changing

 

 

Zope cmf RSS feed   Index | Next | Previous | View Threaded


thomas.dingeldey at camao

May 20, 2009, 1:45 AM

Post #1 of 2 (855 views)
Permalink
Workflow transitions automatic state changing

Hi,

I have a question about the transitions of a workflow.
In ZMI you could choose the option automatic in a transition. Does the option
only remove the action if you call "atool.listFilteredActionsFor(item)" or is
it intended to do some more?

We start a process with a workflow which runs a long time, if the process
starts, we move the object into another state with a transition:

wf = getToolByName(self.context, 'portal_workflow')
wf.doActionFor(self.context, 'send', comment='send')

If the process is finished we like to move the object automatically into
another state. Provides the workflow functions which assists this?

For example: If a certain method ist called after the process is finished,
could the workflow get aware of this?


Greetings
Thomas
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


wichert at wiggy

May 20, 2009, 1:59 AM

Post #2 of 2 (790 views)
Permalink
Re: Workflow transitions automatic state changing [In reply to]

Previously Thomas Dingeldey wrote:
> Hi,
>
> I have a question about the transitions of a workflow.
> In ZMI you could choose the option automatic in a transition. Does the option
> only remove the action if you call "atool.listFilteredActionsFor(item)" or is
> it intended to do some more?
>
> We start a process with a workflow which runs a long time, if the process
> starts, we move the object into another state with a transition:
>
> wf = getToolByName(self.context, 'portal_workflow')
> wf.doActionFor(self.context, 'send', comment='send')
>
> If the process is finished we like to move the object automatically into
> another state. Provides the workflow functions which assists this?

from plone.app.workflow:

# Trigger any automatic transitions, or else just make sure the role mappings are right
auto_transition = new_wf._findAutomaticTransition(obj, new_wf._getWorkflowStateOf(obj))
if auto_transition is not None:
new_wf._changeStateOf(obj, auto_transition)

new_wf is the workflow used for this object. You can grab that from the workflow
chain configured for the object. You should probably make sure to do this for
every workflow in the chain to make support you handle objects with multiple
workflows correctly.


Wichert.

--
Wichert Akkerman <wichert [at] wiggy> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests

Zope cmf RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.