Commit 5badc64c authored by Jean-Paul Smets's avatar Jean-Paul Smets

implementation of time parameters and validation order methods. Only SQLDict...

implementation of time parameters and validation order methods. Only SQLDict supports these extensions at this time


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1290 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e8132078
master DateTime.equalTo_fix TMP-2to3 UpdateValidationStateFromConsistency UserPropertySheet_backward_compatibility addToDate_implicit_localtime allow_login_change allow_login_change_wip arnau arnau-RD-Components-CacheTool arnau-RD-Components-ERP5Form-ERP5Report arnau-RD-Components-ERP5Form-SelectionTool-MemcachedTool arnau-RD-Components-ERP5OOo arnau-RD-Components-PreferenceTool-Preference arnau-RD-Components-Products-import-compat arnau-RD-Components-astroid_cache_per_component_reset arnau-RD-Components-erp5_crm arnau-RD-Components-erp5_trade-TODO-Interactor arnau-RD-ERP5ify-portal_workflow-1-seb-merged-with-recent-master arnau-RD-ERP5ify-portal_workflow-2-do-not-rename-erp5_workflow-portal_types arnau-RD-ERP5ify-portal_workflow-BAK arnau-RD-ERP5ify-portal_workflow-WIP arnau-RD-ERP5ify-portal_workflow-WITHOUT-MIGRATION arnau-RD-ERP5ify-portal_workflow-WORKFLOWS-NOT-MIGRATED arnau-RD-py3-master-TM arnau-RD-py3-master-TM-BAK arnau-RD-py3-master-WIP arnau-RD-py3-master-WIP-BAK arnau-RD-py3-master-WIP-bt5-and-tests arnau-RD-zope4py3 arnau-TM-Components-Migrate-PortalTransforms arnau-TM-Components-ModuleSecurityInfo arnau-TM-FEC-output arnau-TM-WIP arnau-TM-isBuildable-with-multiple-BusinessLinks arnau-TM-newContent-temp_object arnau-TM-runUnitTest-clear-previous-execution-catalog arnau-TM-wkhtmltopdf arnau-WIP arnau-kns arnau-kns-without-property-mapping arnau-merge arnau-my2to3 arnau-poc arnau-real-time-inventory-accounting arnau-zope4py2 aurel-zope4py2 auto_extend_select_list autoflake backup_erp5_workflow bk_erp5ish_actions_tool bk_sqlcatalog boc-interaction-drop bt5_config cache cache-control-304-response callable-jupyter-storage catalog_filter catalog_fulltext catalog_fulltext_old cedric cedriclen cedriclen-eos certificate_authority cherry-pick-4a8e045d cleanJSByJSLint clean_up_upgrader cleanup_acquisition_base_category cloud_reliability_test credential_update_action cribjs-bootloader datetimefield deferred_listbox delivery_item_barcode douglas_forum dream_distributor drop-ZServer dsn-phase3 e2e-erp5 enhance_scalability_testing eos-dev erp5-component erp5-component-bak erp5-forum erp5-imt erp5-messenger erp5-preference erp5-release erp5-slapos-upgrade erp5-util-testing erp5-vifib erp5-vifib-cleanup erp5-vifib-no-Products.DCWorkflowGraph erp5_calendar erp5_catalog erp5_catalog_final erp5_corporate_identity erp5_drone_simulator erp5_free_subscription erp5_hal_json_style_fix_restricted_access_with_traverse erp5_payslip_migration erp5_workflow erp5testnode_max_timeout extend_login_once_form feat/catalog_unhandled_search_type_raise feat/coding_style_test feat/dedup_roles_in_pickles feat/dms_implicit_predecessor_successor_fields feat/erp5_ide feat/erp5pt feat/improve_rounding_tool feat/inventory_api_group_by_time_interval_list feat/lxml-html-snapshot feat/mariadb-10.11 feat/mariadb-10.11bis feat/mariadb-10.5 feat/mariadb-10.6 feat/notification-message-ignore-missing feat/olapy feat/python_language_support feat/round_half_up feat/selenium-unexpected-success feat/slapos_agent_distributor feat/subject_set_query feat/tester_role feature/renderjs-ui-no-header fix/TALES_hide_error fix/ZMI_editor_preference fix/advance_ecommerce_coding_crimes fix/erp5_site_global_id fix/login_validate_check_consistency fix/mariadb-1927 fix/monaco-altClick fix/officejs_support_request_rss_secu fix/state_var fix/support-request-app-empty fix/testnode_proctitle fix/workflow_method_security fix_web_illustration for_testrunner_1 for_testrunner_2 for_testrunner_3 gabriel gadget-json-value graphic_gadget_js hotfix/rjs-formfields-padding improve_default_caching_policy_manager initsite interaction-drop inventory isDeletable ivan jerome-bt-reference-doc jerome_graph_editor_renderjs jerome_user_preference_time_zone jio jm/form-action-guard js-ui kns lazy_simulation_causality lignan limit_accelerated_http_cache_manager lingnan listbox_url lle-bout/metadata-modules macros_fix mame-test-stock-indexation master-erp5-test-result-scalability master-erp5-test-result-scalability-rebase master-test-fix-additionalbt5path master_w mic_wind monitoring-graph mr1362 mrp my2to3 new-render-presentation nicolas-slice-price no_longer_simulated_state notebook_roque officejs override_cache_control_header_by_caching_policy_manager pere poc/json-forms-study portal_callables portal_solver_process_security_configuration presentation publish_recursiveReindexObject rebased_mrp refactor/base_edit reindex_calendar_after_change_calendar_exception restore-from-trashbin revert-192c2000 revert-38554dbe rfc/activate_default rjs_listbox_sort_icon roque_quick scalability-master scalability-master2 scalability-master2-rebase scalability-roque scalability-roque-2 scalability-run-command scalability_crash_mariadb shop-box shop-box-rebase streaming_fix streaming_fix-0 support_legacy_sftp_server support_relative_url_in_hyperlink_field support_request syncml taskdistribution-xmlrpc-binary test-renderjs-float-field-step test_cmfactivity_isolation_level test_dynamic_methods test_page testnode_software_link timezones tomo_testnode_slap_request translatable_path_master tristan tristan-merge tristan-performance trustable-x-forwarded-for ttrm unify_predicate_edit view-aggregated-amounts vivekpab_renderjs_interfaces waitForActivities_assertionMessage wenjie wenjie_branch without_legacy_workflow wsgi wsgi-gevent wsgi_backport_setbody_lock wsgi_medusa_stream_fix yryr yryr-components-cp yryr-inventory-cache yryr-test yryr-with-components zope2 zope2zope4py2 zope4py3 zope4py3-master-rebase 0.4.59.1 0.4.59 test-ui test-rjsacc test-rjs renderjs-test nexedi-erp5-vifib-20201105 erp5.util-0.4.74 erp5.util-0.4.73 erp5.util-0.4.72 erp5.util-0.4.71 erp5.util-0.4.69 erp5.util-0.4.68 erp5.util-0.4.67 erp5.util-0.4.66 erp5.util-0.4.65 erp5.util-0.4.64 erp5.util-0.4.63 erp5.util-0.4.62 erp5.util-0.4.61 erp5.util-0.4.60 erp5.util-0.4.59.1 erp5.util-0.4.59 erp5.util-0.4.58 erp5.util-0.4.57 erp5.util-0.4.56 erp5.util-0.4.55 erp5.util-0.4.54 erp5.util-0.4.53 erp5.util-0.4.52 erp5.util-0.4.49 erp5.util-0.4.46 erp5.util-0.4.44 erp5.util-0.4.43 erp5.util-0.4.41 erp5.util-0.4.40 erp5.util-0.4.37 erp5.util-0.4.1 erp5.util-0.4 erp5.util-0.3 erp5.util-0.2 erp5.util-0.1 erp5-vifib-20240326 erp5-vifib-20230331 erp5-vifib-20230201 erp5-vifib-20220526 erp5-vifib-20220302 erp5-vifib-20210707 erp5-vifib-20201229 erp5-vifib-20200129
No related merge requests found
......@@ -47,6 +47,24 @@ class ActiveObject(ExtensionClass.Base):
security = ClassSecurityInfo()
def activate(self, activity=DEFAULT_ACTIVITY, active_process=None, passive_commit=0, **kw):
"""
Reserved Optional parameters
at_date -- request execution date for this activate call
after_method_id -- never validate message if after_method_id
is in the list of methods which are
going to be executed
after_message_uid -- never validate message if after_message_uid
is in the list of messages which are
going to be executed
after_path -- never validate message if after_path
is in the list of path which are
going to be executed
"""
activity_tool = getattr(self, 'portal_activities', None)
if activity_tool is None: return self # Do nothing if no portal_activities
# activate returns an ActiveWrapper
......
......@@ -26,7 +26,7 @@
#
##############################################################################
import pickle
import pickle, sys
from Acquisition import aq_base
from Products.CMFActivity.ActivityTool import Message
from zLOG import LOG
......@@ -37,6 +37,11 @@ VALID = 0
INVALID_PATH = 1
INVALID_ORDER = 2
# Time global parameters
SECONDS_IN_DAY = 86400.0
MAX_PROCESSING_TIME = 900 / SECONDS_IN_DAY # in fractions of day
VALIDATION_ERROR_DELAY = 120 / SECONDS_IN_DAY # in fractions of day
class Queue:
"""
Step 1: use lists
......@@ -142,11 +147,12 @@ class Queue:
'Object %s does not exist' % '/'.join(message.object_path))
return INVALID_PATH
for k, v in kw.items():
if activity_tool.validateOrder(k, message, v):
if activity_tool.validateOrder(message, k, v):
return INVALID_ORDER
except:
LOG('WARNING ActivityTool', 0,
'Object %s could not be accessed' % '/'.join(message.object_path))
'Validation of Object %s raised exception' % '/'.join(message.object_path),
error=sys.exc_info())
# Do not try to call methods on objects which cause errors
return EXCEPTION
return VALID
......@@ -177,8 +183,8 @@ class Queue:
return pickle.dumps(m)
def getMessageList(self, activity_tool, processing_node=None):
return []
return []
# Transaction Management
def prepareQueueMessage(self, activity_tool, m):
# Called to prepare transaction commit for queued messages
......@@ -218,4 +224,11 @@ class Queue:
if hasattr(activity_buffer, '_%s_message_list' % class_name):
return filter(lambda m: m.is_registered, getattr(activity_buffer, '_%s_message_list' % class_name))
else:
return ()
return ()
# Required for tests (time shift)
def timeShift(self, activity_tool, delay):
"""
delay is provided in fractions of day
"""
pass
\ No newline at end of file
......@@ -27,8 +27,9 @@
##############################################################################
import random
from DateTime import DateTime
from Products.CMFActivity.ActivityTool import registerActivity
from Queue import VALID
from Queue import VALID, INVALID_ORDER, INVALID_PATH, EXCEPTION, MAX_PROCESSING_TIME, VALIDATION_ERROR_DELAY, SECONDS_IN_DAY
from RAMDict import RAMDict
from Products.CMFActivity.ActiveObject import DISTRIBUTABLE_STATE, INVOKE_ERROR_STATE, VALIDATE_ERROR_STATE
......@@ -55,10 +56,11 @@ class SQLDict(RAMDict):
# Transaction commit methods
def prepareQueueMessage(self, activity_tool, m):
if m.is_registered:
activity_tool.SQLDict_writeMessage(path = '/'.join(m.object_path) ,
activity_tool.SQLDict_writeMessage( path = '/'.join(m.object_path) ,
method_id = m.method_id,
priority = m.activity_kw.get('priority', 1),
message = self.dumpMessage(m))
message = self.dumpMessage(m),
date = m.activity_kw.get('at_date', DateTime()))
# Also store uid of activity
def prepareDeleteMessage(self, activity_tool, m):
......@@ -104,40 +106,55 @@ class SQLDict(RAMDict):
# Queue semantic
def dequeueMessage(self, activity_tool, processing_node):
if hasattr(activity_tool,'SQLDict_readMessageList'):
if hasattr(activity_tool,'SQLDict_readMessage'):
now_date = DateTime()
# Sticky processing messages should be set back to non processing
max_processing_date = now_date + MAX_PROCESSING_TIME
# Next processing date in case of error
next_processing_date = now_date + VALIDATION_ERROR_DELAY
priority = random.choice(priority_weight)
# Try to find a message at given priority level
result = activity_tool.SQLDict_readMessage(processing_node=processing_node, priority=priority)
# Try to find a message at given priority level which is scheduled for now
result = activity_tool.SQLDict_readMessage(processing_node=processing_node, priority=priority, to_date=now_date, to_processing_date = max_processing_date)
if len(result) == 0:
# If empty, take any message
# If empty, take any message which is scheduled for now
priority = None
result = activity_tool.SQLDict_readMessage(processing_node=processing_node, priority=priority)
result = activity_tool.SQLDict_readMessage(processing_node=processing_node, priority=priority, to_date=now_date)
if len(result) > 0:
line = result[0]
path = line.path
method_id = line.method_id
uid_list = activity_tool.SQLDict_readUidList( path=path, method_id= method_id, processing_node = None )
uid_list = activity_tool.SQLDict_readUidList( path=path, method_id= method_id, processing_node = None, to_date=now_date )
uid_list = map(lambda x:x.uid, uid_list)
# Make sure message can not be processed anylonger
if len(uid_list) > 0:
# Set selected messages to processing
activity_tool.SQLDict_processMessage(uid = uid_list)
get_transaction().commit() # Release locks before starting a potentially long calculation
# This may lead (1 for 1,000,000 in case of reindexing) to messages left in processing state
m = self.loadMessage(line.message, uid = line.uid)
# Validate message (make sure object exists, priority OK, etc.)
if m.validate(self, activity_tool) is not VALID:
if line.priority > MAX_PRIORITY:
# This is an error
if len(uid_list) > 0: # Add some delay here
activity_tool.SQLDict_assignMessage(uid = uid_list, processing_node = VALIDATE_ERROR_STATE)
# Assign message back to 'error' state
#m.notifyUser(activity_tool) # Notify Error
get_transaction().commit() # and commit
validation_state = m.validate(self, activity_tool)
if validation_state is not VALID:
if validation_state in (EXCEPTION, INVALID_PATH):
# There is a serious validation error
if line.priority > MAX_PRIORITY:
# This is an error
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
get_transaction().commit() # and commit
else:
# Lower priority
if len(uid_list) > 0: # Add some delay before new processing
activity_tool.SQLDict_setPriority(uid = uid_list, date = next_processing_date,
priority = line.priority + 1)
get_transaction().commit() # Release locks before starting a potentially long calculation
else:
# Lower priority
if len(uid_list) > 0:
activity_tool.SQLDict_setPriority(uid = uid_list,
priority = line.priority + 1)
# We do not lower priority for INVALID_ORDER errors but we do postpone execution
if len(uid_list) > 0: # Add some delay before new processing
activity_tool.SQLDict_setPriority(uid = uid_list, date = next_processing_date,
priority = line.priority)
get_transaction().commit() # Release locks before starting a potentially long calculation
else:
# Try to invoke
......@@ -163,7 +180,7 @@ class SQLDict(RAMDict):
else:
# Lower priority
if len(uid_list) > 0:
activity_tool.SQLDict_setPriority(uid = uid_list,
activity_tool.SQLDict_setPriority(uid = uid_list, date = next_processing_date,
priority = line.priority + 1)
get_transaction().commit() # Release locks before starting a potentially long calculation
return 0
......@@ -268,4 +285,30 @@ class SQLDict(RAMDict):
if processing_node > node_count:
processing_node = 1 # Round robin
# Validation private methods
def _validate_after_method_id(self, activity_tool, message, value):
# Count number of occurances of method_id
result = activity_tool.SQLDict_validateMessageList(method_id=value, message_uid=None, path=None)
if result[0].uid_count > 0:
return INVALID_ORDER
return VALID
def _validate_after_path(self, activity_tool, message, value):
# Count number of occurances of path
result = activity_tool.SQLDict_validateMessageList(method_id=None, message_uid=None, path=value)
if result[0].uid_count > 0:
return INVALID_ORDER
return VALID
def _validate_after_message_uid(self, activity_tool, message, value):
# Count number of occurances of message_uid
result = activity_tool.SQLDict_validateMessageList(method_id=None, message_uid=value, path=None)
if result[0].uid_count > 0:
return INVALID_ORDER
return VALID
# Required for tests (time shift)
def timeShift(self, activity_tool, delay):
activity_tool.SQLDict_timeShift(delay = delay * SECONDS_IN_DAY)
registerActivity(SQLDict)
......@@ -423,8 +423,16 @@ class ActivityTool (Folder, UniqueObject):
for activity in activity_list:
method_id = "_validate_%s" % validator_id
if hasattr(activity, method_id):
LOG('CMFActivity: ', 0, 'validateOrder calling method_id %s' % method_id)
if getattr(activity,method_id)(self, message, validation_value):
return 1
return 0
# Required for tests (time shift)
def timeShift(self, delay):
global is_initialized
if not is_initialized: self.initialize()
for activity in activity_list:
activity.timeShift(self, delay)
InitializeClass(ActivityTool)
......@@ -15,6 +15,7 @@ CREATE TABLE `message` (
`method_id` VARCHAR(40),
`processing_node` INT DEFAULT -1,
`processing` INT DEFAULT 0,
`processing_date` datetime,
`priority` INT DEFAULT 0,
`message` BLOB,
PRIMARY KEY (`uid`),
......@@ -23,5 +24,6 @@ CREATE TABLE `message` (
KEY `method_id` (`method_id`),
KEY `processing_node` (`processing_node`),
KEY `processing` (`processing`),
KEY `processing_date` (`processing_date`),
KEY `priority` (`priority`)
) TYPE = InnoDB;
......@@ -9,7 +9,9 @@ class_file:
</dtml-comment>
<params>uid</params>
UPDATE message
SET processing=1
SET
processing_date = <dtml-sqlvar "_.DateTime()" type="string">,
processing = 1
WHERE
<dtml-in uid>uid = <dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>
OR </dtml-if></dtml-in>
\ No newline at end of file
......@@ -8,13 +8,26 @@ class_name:
class_file:
</dtml-comment>
<params>processing_node
priority</params>
SELECT * FROM
priority
to_date
to_processing_date</params>
<dtml-if to_processing_date>UPDATE message
SET
processing = 0
WHERE
processing = 1
AND
processing_date < <dtml-sqlvar to_processing_date type="string">
<dtml-var "'\0'">
</dtml-if>SELECT * FROM
message
WHERE
processing <> 1
<dtml-if processing_node> AND processing_node = <dtml-sqlvar processing_node type="int"></dtml-if>
<dtml-if processing_node> AND processing_node = <dtml-sqlvar processing_node type="int"> </dtml-if>
<dtml-if priority> AND priority = <dtml-sqlvar priority type="int"> </dtml-if>
<dtml-if to_date>AND date <= <dtml-sqlvar to_date type="string"> </dtml-if>
ORDER BY
priority, date
......@@ -22,4 +22,4 @@ WHERE
GROUP BY
path, method_id, processing_node, processing
ORDER BY
priority, date
\ No newline at end of file
priority, date
\ No newline at end of file
......@@ -9,11 +9,13 @@ class_file:
</dtml-comment>
<params>processing_node
method_id
path</params>
path
to_date</params>
SELECT uid FROM
message
WHERE
processing <> 1
<dtml-if processing_node> AND processing_node = <dtml-sqlvar processing_node type="int"></dtml-if>
<dtml-if method_id>AND method_id = <dtml-sqlvar method_id type="string"></dtml-if>
<dtml-if path>AND path = <dtml-sqlvar path type="string"></dtml-if>
\ No newline at end of file
<dtml-if processing_node> AND processing_node = <dtml-sqlvar processing_node type="int"> </dtml-if>
<dtml-if method_id>AND method_id = <dtml-sqlvar method_id type="string"> </dtml-if>
<dtml-if path>AND path = <dtml-sqlvar path type="string"> </dtml-if>
<dtml-if to_date>AND date <= <dtml-sqlvar to_date type="string"> </dtml-if>
......@@ -8,12 +8,14 @@ class_name:
class_file:
</dtml-comment>
<params>uid:list
priority</params>
priority
date</params>
UPDATE
message
message
SET
priority = <dtml-sqlvar priority type="int">,
processing = 0
priority = <dtml-sqlvar priority type="int">,
processing = 0,
date = <dtml-sqlvar date type="string">
WHERE
<dtml-in uid>uid = <dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>
OR </dtml-if></dtml-in>
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>delay</params>
UPDATE
message
SET
date = date - <dtml-sqlvar delay type="int">,
processing_date = processing_date - <dtml-sqlvar delay type="int">
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>method_id
message_uid
path
</params>
SELECT
COUNT(DISTINCT uid) as uid_count
FROM
message
WHERE
processing_node >= -1
<dtml-if method_id>AND method_id = <dtml-sqlvar method_id type="string"> </dtml-if>
<dtml-if message_uid>AND uid = <dtml-sqlvar message_uid type="int"> </dtml-if>
<dtml-if path>AND path = <dtml-sqlvar path type="string"></dtml-if>
......@@ -10,13 +10,14 @@ class_file:
<params>path
method_id
message
priority</params>
priority
date</params>
INSERT INTO message
SET
path = <dtml-sqlvar path type="string">,
date = <dtml-sqlvar "_.DateTime()" type="string">,
method_id = <dtml-sqlvar method_id type="string">,
processing_node = -1,
processing = -1,
priority = <dtml-sqlvar priority type="int">,
message = <dtml-sqlvar message type="string">
path = <dtml-sqlvar path type="string">,
<dtml-if date>date = <dtml-sqlvar date type="string">, <dtml-else>date = <dtml-sqlvar "_.DateTime()" type="string">, </dtml-if>
method_id = <dtml-sqlvar method_id type="string">,
processing_node = -1,
processing = -1,
priority = <dtml-sqlvar priority type="int">,
message = <dtml-sqlvar message type="string">
......@@ -8,7 +8,9 @@ class_name:
class_file:
</dtml-comment>
<params>uid</params>
UPDATE message_queue
SET processing=1
UPDATE
message_queue
SET
processing=1
WHERE
uid = <dtml-sqlvar uid type="int">
uid = <dtml-sqlvar uid type="int">
......@@ -337,6 +337,7 @@ class TestCMFActivity(ERP5TypeTestCase):
self.assertEquals(len(message_list),1)
portal.portal_activities.distribute()
portal.portal_activities.tic()
# XXX HERE WE SHOULD USE TIME SHIFT IN ORDER TO SIMULATE MULTIPLE TICS
# Test if there is still the message after it crashed
message_list = portal.portal_activities.getMessageList()
self.assertEquals(len(message_list),1)
......@@ -421,6 +422,42 @@ class TestCMFActivity(ERP5TypeTestCase):
message_list = portal.portal_activities.getMessageList()
self.assertEquals(len(message_list),0)
def TryMethodAfterMethod(self, activity):
"""
Try several activities
"""
portal = self.getPortal()
def DeferredSetDescription(self,value):
self.setDescription(value)
def DeferredSetTitle(self,value):
self.setTitle(value)
from Products.ERP5Type.Document.Organisation import Organisation
Organisation.DeferredSetTitle = DeferredSetTitle
Organisation.DeferredSetDescription = DeferredSetDescription
organisation = portal.organisation._getOb(self.company_id)
default_title = 'my_test_title'
organisation.setTitle(default_title)
organisation.setDescription(None)
organisation.activate(activity=activity,after_method_id='DeferredSetDescription').DeferredSetTitle(self.title1)
organisation.activate(activity=activity).DeferredSetDescription(self.title1)
get_transaction().commit()
portal.portal_activities.distribute()
portal.portal_activities.tic()
get_transaction().commit()
message_list = portal.portal_activities.getMessageList()
self.assertEquals(len(message_list),1)
self.assertEquals(organisation.getTitle(), default_title) # Title should not be changed the first time
self.assertEquals(organisation.getDescription(),self.title1)
# Now wait some time and test again (this should be simulated by changing dates in SQL Queue)
from Products.CMFActivity.Activity.Queue import VALIDATION_ERROR_DELAY
portal.portal_activities.timeShift(2 * VALIDATION_ERROR_DELAY)
portal.portal_activities.tic()
get_transaction().commit()
message_list = portal.portal_activities.getMessageList()
self.assertEquals(len(message_list),0)
self.assertEquals(organisation.getTitle(),self.title1)
self.assertEquals(organisation.getDescription(),self.title1)
def test_01_DeferedSetTitleSQLDict(self, quiet=0, run=run_all_test):
# Test if we can add a complete sales order
if not run: return
......@@ -899,6 +936,16 @@ class TestCMFActivity(ERP5TypeTestCase):
LOG('Testing... ',0,message)
self.TryActiveProcessInsideActivity('RAMQueue')
def test_54_TryAfterMethodIdWithSQLDict(self, quiet=0, run=run_all_test):
# Test if after_method_id can be used
if not run: return
if not quiet:
message = '\nTry Active Method After Another Activate Method'
ZopeTestCase._print(message)
LOG('Testing... ',0,message)
self.TryMethodAfterMethod('SQLDict')
if __name__ == '__main__':
framework()
......
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