|
From: Vincenzo Di S. <e.d...@ic...> - 2001-10-20 09:38:48
|
I think the main problem with this kind of operations is that we use=20 "folder" to subclass all the workflow objects (except trasitions)and try=20 to use its CopySupport methods, but it doesn`t satisfy our requirements.=20 Now we need to refactor the structure of workflow objects, customizing=20 method for cut, paste, copy and delete operations. Juli=E1n Mu=F1oz Dom=EDnguez wrote: > Actually to copy a workflow you have to copy first the transactions, an= d > after the activities. > There is also problems when deleting some elements. >=20 > I think this is garbaging the workflow, when you copy, or rename it. >=20 > Attached is are 2 patches, for activity.py and transaction.py, do you l= ike > it? >=20 > In transaction.py in mange_afterAdd there is some try: expcept:, maybe = it > is possible to subsitute them with hasattr ??? (don't know if there are > here for another reason) >=20 >=20 >=20 >=20 >=20 > -----------------------------------------------------------------------= - >=20 > *** transaction.py.original_sin_cambiar_manager_aferAdd Fri Oct 19 13:4= 0:27 2001 > --- transaction.py Fri Oct 19 13:49:49 2001 > *************** > *** 68,75 **** > --- 68,77 ---- > =20 > def manage_beforeDelete(self, item, container): > if self._From: > + if hasattr(container, self._From): > getattr(container, self._From).removeTo(item.id) > if self._To: > + if hasattr(container, self._To): > getattr(container, self._To).removeFrom(item.id) > =20 > =20 >=20 >=20 > -----------------------------------------------------------------------= - >=20 > *** activity.py.original_sin_cambiar_manage_afterAdd Fri Oct 19 13:40:0= 4 2001 > --- activity.py Fri Oct 19 13:51:52 2001 > *************** > *** 79,86 **** > --- 79,88 ---- > =20 > def manage_afterAdd(self, item, container): > for transaction_id in self._To: > + if hasattr(self.aq_parent, transaction_id): > getattr(self.aq_parent, transaction_id).setFrom(self.id) > for transaction_id in self._From: > + if hasattr(self.aq_parent, transaction_id): > getattr(self.aq_parent, transaction_id).setTo(self.id) > Folder.manage_afterAdd(self, item, container) > =20 > *************** > *** 94,101 **** > --- 96,105 ---- > =20 > # 2) Delete transaction links to the activity > for transaction_id in self._To: > + if hasattr(self.aq_parent, transaction_id): > getattr(self.aq_parent, transaction_id).setFrom() > for transaction_id in self._From: > + if hasattr(self.aq_parent, transaction_id): > getattr(self.aq_parent, transaction_id).setTo() > =20 > # 3) Handle contained objects deletion >=20 --=20 Vincenzo Di Somma - Responsabile Ricerca e Sviluppo - Icube S.r.l. Sede: Via Ridolfi 15 - 56124 Pisa (PI), Italia E-mail: e.d...@ic... WWW: www.icube.it Tel: (+39) 050 97 02 07 Fax: (+39) 050 31 36 588 |