Commit 6c88e86a authored by Aurel's avatar Aurel

- use id tool to generate activity tag.

- when creating an active process from the alarm, reindex it with the
last tag from the alarm so that the notify activity will wait for it
to be reindexed. This will make notify retrieve the real last active process.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23204 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5d1577d3
......@@ -303,9 +303,11 @@ class Alarm(XMLObject, PeriodicityMixin):
if method_id not in (None, ''):
# A tag is provided as a parameter in order to be
# able to notify the user after all processes are ended
# Tag is generated from portal_ids so that it can be retrieved
# later when creating an active process for example
# We do some inspection to keep compatibility
# (because fixit and tag were not set previously)
tag='Alarm_activeSense_%s_%s' % (self.getId(), DateTime())
tag = str(self.portal_ids.generateNewLengthId(id_group=self.getId()))
kw = {}
method = getattr(self, method_id)
name_list = method.func_code.co_varnames
......@@ -499,15 +501,19 @@ Alarm URL: %s
security.declareProtected(Permissions.ModifyPortalContent,
'newActiveProcess')
def newActiveProcess(self, **kw):
def newActiveProcess(self, activate_kw={}, **kw):
"""
We will create a new active process in order to store
new results, then this process will be added to the list
of processes
"""
tag = self.portal_ids.getLastLengthGeneratedId(id_group=self.getId())
if tag is not None:
activate_kw.setdefault('tag', str(tag))
portal_activities = getToolByName(self,'portal_activities')
active_process = portal_activities.newActiveProcess(start_date=DateTime(),
causality_value=self,
activate_kw=activate_kw,
**kw)
return active_process
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment