Skip to content

Instantly share code, notes, and snippets.

@jone
Created September 29, 2010 15:42
Show Gist options
  • Save jone/602977 to your computer and use it in GitHub Desktop.
Save jone/602977 to your computer and use it in GitHub Desktop.
def set_workflow_state(self):
state = 'task-state-new-successor'
mtool = getToolByName(self.context, 'portal_membership')
wtool = getToolByName(self.context, 'portal_workflow')
current_user_id = mtool.getAuthenticatedMember().getId()
wf_ids = wtool.getChainFor(self.context)
if wf_ids:
wf_id = wf_ids[0]
comment = 'Created successor.'
wtool.setStatusOf(wf_id, self.context, {'review_state': state,
'action' : state,
'actor': current_user_id,
'time': DateTime(),
'comments': comment,})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment