Skip to content

Instantly share code, notes, and snippets.

@jone
Created September 29, 2010 15:45
Show Gist options
  • Save jone/602987 to your computer and use it in GitHub Desktop.
Save jone/602987 to your computer and use it in GitHub Desktop.
wtool = getToolByName(task, 'portal_workflow')
review_state = wtool.getInfoFor(task, 'review_state', None)
print 'XXX', review_state
if review_state == from_review_state:
mtool = getToolByName(task, 'portal_membership')
current_user_id = mtool.getAuthenticatedMember().getId()
wf_ids = wtool.getChainFor(task)
if wf_ids:
wf_id = wf_ids[0]
comment = 'Initial state after editing successor metadata.'
wtool.setStatusOf(wf_id, task, {'review_state': to_review_state,
'action' : to_review_state,
'actor': current_user_id,
'time': DateTime(),
'comments': comment,})
task.reindexObject()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment