entities/wfobjs.py
changeset 3720 5376aaadd16b
parent 3675 5d143781a604
parent 3698 9f652194bfb3
child 3722 c414f402cbff
equal deleted inserted replaced
3678:29f74716fd70 3720:5376aaadd16b
   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         """