Commit 967b7909 authored by Guillaume Michon's avatar Guillaume Michon

after_path now supports multiple pathes

Added after_path_and_method_id


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3347 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2b752fc4
......@@ -346,6 +346,8 @@ class SQLDict(RAMDict):
def _validate_after_path(self, activity_tool, message, value):
# Count number of occurances of path
if type(path) == type(''):
value = [value]
result = activity_tool.SQLDict_validateMessageList(method_id=None, message_uid=None, path=value)
if result[0].uid_count > 0:
return INVALID_ORDER
......@@ -358,6 +360,22 @@ class SQLDict(RAMDict):
return INVALID_ORDER
return VALID
def _validate_after_path_and_method_id(self, activity_tool, message, value):
# Count number of occurances of path and method_id
if (type(value) != type ( (0,) ) and type(value) != type([])) or len(value)<2:
LOG('CMFActivity WARNING :', 0, 'unable to recognize value for after_path_and_method_id : %s' % repr(value))
return VALID
path = value[0]
method = value[1]
if type(path) == type(''):
path = [path]
if type(method) == type(''):
method = [method]
result = activity_tool.SQLDict_validateMessageList(method_id=method, message_uid=None, path=path)
if result[0].uid_count > 0:
return INVALID_ORDER
return VALID
# Required for tests (time shift)
def timeShift(self, activity_tool, delay):
"""
......
......@@ -252,6 +252,8 @@ class SQLQueue(RAMQueue):
def _validate_after_path(self, activity_tool, message, value):
# Count number of occurances of path
if type(value) == type(''):
value = [value]
result = activity_tool.SQLQueue_validateMessageList(method_id=None, message_uid=None, path=value)
if result[0].uid_count > 0:
return INVALID_ORDER
......@@ -264,6 +266,22 @@ class SQLQueue(RAMQueue):
return INVALID_ORDER
return VALID
def _validate_after_path_and_method_id(self, activity_tool, message, value):
# Count number of occurances of method_id and path
if (type(value) != type( (0,) ) and type(value) != type ([])) or len(value)<2:
LOG('CMFActivity WARNING :', 0, 'unable to recognize value for after_path_and_method : %s' % repr(value))
return VALID
path = value[0]
method = value[1]
if type(path) == type(''):
path = [path]
if type(method) == type(''):
method = [method]
result = activity_tool.SQLQueue_validateMessageList(method_id=method, message_uid=None, path=path)
if result[0].uid_count > 0:
return INVALID_ORDER
return VALID
# Required for tests (time shift)
def timeShift(self, activity_tool, delay):
"""
......
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