444 kwargs = {} |
444 kwargs = {} |
445 if comment is not None: |
445 if comment is not None: |
446 kwargs['comment'] = comment |
446 kwargs['comment'] = comment |
447 if commentformat is not None: |
447 if commentformat is not None: |
448 kwargs['comment_format'] = commentformat |
448 kwargs['comment_format'] = commentformat |
449 args = [('wf_info_for', 'E')] |
449 kwargs['wf_info_for'] = self |
450 kwargs['E'] = self.eid |
|
451 if treid is not None: |
450 if treid is not None: |
452 args.append( ('by_transition', 'T') ) |
451 kwargs['by_transition'] = self.req.entity_from_eid(treid) |
453 kwargs['T'] = treid |
|
454 if tseid is not None: |
452 if tseid is not None: |
455 args.append( ('to_state', 'S') ) |
453 kwargs['to_state'] = self.req.entity_from_eid(tseid) |
456 kwargs['S'] = tseid |
454 return self._cw.create_entity('TrInfo', **kwargs) |
457 return self._cw.create_entity('TrInfo', *args, **kwargs) |
|
458 |
455 |
459 def fire_transition(self, tr, comment=None, commentformat=None): |
456 def fire_transition(self, tr, comment=None, commentformat=None): |
460 """change the entity's state by firing transition of the given name in |
457 """change the entity's state by firing transition of the given name in |
461 entity's workflow |
458 entity's workflow |
462 """ |
459 """ |