Alex Clark wrote:
Hi all,
In Products.todo (https://svn.plone.org/svn/collective/Products.todo/trunk)
I have a folderish 'Todo Item' content type that can contain one or more 'Todo Item'(s).
I've just added a workflow that contains states: 'not done', 'done' and when
state
is changed on a todo item with todo items inside of it, I want to change state
for all of those objects.
What is the best way to do that?
I'm thinking the "old way" of doing a catalog search or ZopeFind each time
is not be the best way. Is there a "new way" (i.e. using Zope Component Architecture)
I should try instead ?
Only the event subscriber that Hedley already mentioned I'd say.
BTW: I used to do this via workflow scripts "in the old days".
Something like:
obj = getattr(state_change, 'object')
transition_id = getattr(state_change, 'transition').getId()
for child in obj.contentValues():
try:
obj.portal_workflow.doActionFor(child,
transition_id,
comment="like my parent")
except WorkflowException:
pass # or do whatever you see fit
Raphael
Any thoughts appreciated,
Thx
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers