hooks/workflow.py
changeset 3654 e4bed64e0ad7
parent 3629 559cad62c786
child 3674 387d51af966d
equal deleted inserted replaced
3653:ef71abb1e77b 3654:e4bed64e0ad7
   335         entity = self._cw.entity_from_eid(self.eidfrom)
   335         entity = self._cw.entity_from_eid(self.eidfrom)
   336         typewf = entity.cwetype_workflow()
   336         typewf = entity.cwetype_workflow()
   337         if typewf is not None:
   337         if typewf is not None:
   338             _WorkflowChangedOp(self._cw, eid=self.eidfrom, wfeid=typewf.eid)
   338             _WorkflowChangedOp(self._cw, eid=self.eidfrom, wfeid=typewf.eid)
   339 
   339 
   340 
       
   341 
       
   342 class DelWorkflowHook(WorkflowHook):
       
   343     __regid__ = 'wfdel'
       
   344     __select__ = WorkflowHook.__select__ & entity_implements('Workflow')
       
   345     events = ('after_delete_entity',)
       
   346 
       
   347     def __call__(self):
       
   348         # cleanup unused state and transition
       
   349         self._cw.execute('DELETE State X WHERE NOT X state_of Y')
       
   350         self._cw.execute('DELETE Transition X WHERE NOT X transition_of Y')
       
   351