Commit 81e80209 authored by Jean-Paul Smets's avatar Jean-Paul Smets

merged Coramy changes


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@716 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f8957cb1
......@@ -80,10 +80,13 @@ class RAMDict(Queue):
return 1
def hasActivity(self, activity_tool, object, **kw):
if object is not None:
object_path = object.getPhysicalPath()
for m in self.dict.values():
if m.object_path == object_path:
return 1
else:
return 1 # Default behaviour if no object specified is to return 1 until active_process implemented
return 0
def flush(self, activity_tool, object_path, invoke=0, method_id=None, **kw):
......
......@@ -63,10 +63,13 @@ class RAMQueue(Queue):
return 0 # Keep on ticking
def hasActivity(self, activity_tool, object, **kw):
if object is not None:
object_path = object.getPhysicalPath()
for m in self.queue:
if m.object_path == object_path:
return 1
else:
return 1 # Default behaviour if no object specified is to return 1 until active_process implemented
return 0
def flush(self, activity_tool, object_path, invoke=0, method_id=None, **kw):
......
......@@ -120,7 +120,7 @@ class SQLDict(RAMDict):
if len(uid_list) > 0:
activity_tool.SQLDict_assignMessage(uid = uid_list, processing_node = VALIDATE_ERROR_STATE)
# Assign message back to 'error' state
m.notifyUser(activity_tool) # Notify Error
#m.notifyUser(activity_tool) # Notify Error
get_transaction().commit() # and commit
else:
# Lower priority
......@@ -147,6 +147,7 @@ class SQLDict(RAMDict):
if len(uid_list) > 0:
activity_tool.SQLDict_assignMessage(uid = uid_list, processing_node = INVOKE_ERROR_STATE)
# Assign message back to 'error' state
m.notifyUser(activity_tool) # Notify Error
get_transaction().commit() # and commit
else:
# Lower priority
......@@ -159,10 +160,13 @@ class SQLDict(RAMDict):
return 1
def hasActivity(self, activity_tool, object, **kw):
if object is not None:
my_object_path = '/'.join(object.getPhysicalPath())
result = activity_tool.SQLDict_hasMessage(path=my_object_path, method_id=method_id, **kw)
result = activity_tool.SQLDict_hasMessage(path=my_object_path, **kw)
if len(result) > 0:
return result[0].message_count > 0
else:
return 1 # Default behaviour if no object specified is to return 1 until active_process implemented
return 0
def flush(self, activity_tool, object_path, invoke=0, method_id=None, commit=0, **kw):
......
......@@ -85,6 +85,7 @@ class SQLQueue(RAMQueue):
# This is an error
activity_tool.SQLQueue_assignMessage(uid=line.uid, processing_node = VALIDATE_ERROR_STATE)
# Assign message back to 'error' state
#m.notifyUser(activity_tool) # Notify Error
get_transaction().commit() # and commit
else:
# Lower priority
......@@ -113,10 +114,13 @@ class SQLQueue(RAMQueue):
return 1
def hasActivity(self, activity_tool, object, **kw):
if object is not None:
my_object_path = '/'.join(object.getPhysicalPath())
result = activity_tool.SQLQueue_hasMessage(path=my_object_path, **kw)
if len(result) > 0:
return result[0].message_count > 0
else:
return 1 # Default behaviour if no object specified is to return 1 until active_process implemented
return 0
def flush(self, activity_tool, object_path, invoke=0, method_id=None, commit=0, **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