equal
deleted
inserted
replaced
450 """change the entity's state by firing transition of the given name in |
450 """change the entity's state by firing transition of the given name in |
451 entity's workflow |
451 entity's workflow |
452 """ |
452 """ |
453 assert self.current_workflow |
453 assert self.current_workflow |
454 tr = self.current_workflow.transition_by_name(trname) |
454 tr = self.current_workflow.transition_by_name(trname) |
455 assert tr is not None, 'not a %s transition: %s' % (self.__regid__, trname) |
455 if tr is None: |
|
456 raise WorkflowException('not a %s transition: %s' % (self.__regid__, |
|
457 trname)) |
456 return self._add_trinfo(comment, commentformat, tr.eid) |
458 return self._add_trinfo(comment, commentformat, tr.eid) |
457 |
459 |
458 def change_state(self, statename, comment=None, commentformat=None, tr=None): |
460 def change_state(self, statename, comment=None, commentformat=None, tr=None): |
459 """change the entity's state to the given state (name or entity) in |
461 """change the entity's state to the given state (name or entity) in |
460 entity's workflow. This method should only by used by manager to fix an |
462 entity's workflow. This method should only by used by manager to fix an |