Commit af9ae7ac authored by Jean-Paul Smets's avatar Jean-Paul Smets

fixed bug in process


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1254 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 80b9b9e1
...@@ -93,11 +93,14 @@ class RAMDict(Queue): ...@@ -93,11 +93,14 @@ class RAMDict(Queue):
def hasActivity(self, activity_tool, object, **kw): def hasActivity(self, activity_tool, object, **kw):
if object is not None: if object is not None:
object_path = object.getPhysicalPath() object_path = object.getPhysicalPath()
for m in self.getDict(activity_tool).values():
if m.object_path == object_path:
return 1
else: else:
return 1 # Default behaviour if no object specified is to return 1 until active_process implemented object_path = None
active_process = kw.get('active_process', None)
for m in self.getDict(activity_tool).values():
# Filter active process and path if defined
if active_process is None or m.active_process == active_process:
if object_path is None or m.object_path == object_path:
return 1
return 0 return 0
def flush(self, activity_tool, object_path, invoke=0, method_id=None, **kw): def flush(self, activity_tool, object_path, invoke=0, method_id=None, **kw):
......
...@@ -79,10 +79,16 @@ class RAMQueue(Queue): ...@@ -79,10 +79,16 @@ class RAMQueue(Queue):
def hasActivity(self, activity_tool, object, **kw): def hasActivity(self, activity_tool, object, **kw):
object_path = object.getPhysicalPath() if object is not None:
object_path = object.getPhysicalPath()
else:
object_path = None
active_process = kw.get('active_process', None)
for m in self.getQueue(activity_tool): for m in self.getQueue(activity_tool):
if m.object_path == object_path: # Filter active process and path if defined
return 1 if active_process is None or m.active_process == active_process:
if object_path is None or m.object_path == object_path:
return 1
return 0 return 0
def flush(self, activity_tool, object_path, invoke=0, method_id=None, **kw): def flush(self, activity_tool, object_path, invoke=0, method_id=None, **kw):
......
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