Commit 69eb4238 authored by Jérome Perrin's avatar Jérome Perrin

remove all verbose logs from new simulation


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44350 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 448c7766
...@@ -138,12 +138,6 @@ class BusinessProcess(Path, XMLObject): ...@@ -138,12 +138,6 @@ class BusinessProcess(Path, XMLObject):
kw.setdefault('portal_type', self.getPortalTradeModelPathTypeList()) kw.setdefault('portal_type', self.getPortalTradeModelPathTypeList())
kw.setdefault('sort_on', 'int_index') kw.setdefault('sort_on', 'int_index')
original_path_list = self.objectValues(**kw) # Why Object Values ??? XXX-JPS original_path_list = self.objectValues(**kw) # Why Object Values ??? XXX-JPS
LOG('self', 0, repr(self))
LOG('objectValues', 0, repr(self.objectValues()))
LOG('portal_type', 0, repr(kw['portal_type']))
LOG('objectValues kw', 0, repr(self.objectValues(**kw)))
LOG('trade_phase', 0, trade_phase)
LOG('original_path_list', 0, original_path_list)
# Separate the selection of trade model paths into two steps # Separate the selection of trade model paths into two steps
# for easier debugging. # for easier debugging.
# First, collect trade model paths which can be applicable to a given context. # First, collect trade model paths which can be applicable to a given context.
...@@ -152,7 +146,6 @@ class BusinessProcess(Path, XMLObject): ...@@ -152,7 +146,6 @@ class BusinessProcess(Path, XMLObject):
# Filter our business path which trade phase does not match # Filter our business path which trade phase does not match
if trade_phase is None or trade_phase.intersection(path.getTradePhaseList()): if trade_phase is None or trade_phase.intersection(path.getTradePhaseList()):
path_list.append(path) path_list.append(path)
LOG('path_list', 0, path_list)
# Then, filter trade model paths by Predicate API. # Then, filter trade model paths by Predicate API.
# FIXME: Ideally, we should use the Domain Tool to search business paths, # FIXME: Ideally, we should use the Domain Tool to search business paths,
# and avoid using the low level Predicate API. But the Domain Tool does # and avoid using the low level Predicate API. But the Domain Tool does
...@@ -187,7 +180,6 @@ class BusinessProcess(Path, XMLObject): ...@@ -187,7 +180,6 @@ class BusinessProcess(Path, XMLObject):
raise ValueError('a reference date method must be defined on every Trade Model Path') raise ValueError('a reference date method must be defined on every Trade Model Path')
explanation_cache = _getExplanationCache(explanation) explanation_cache = _getExplanationCache(explanation)
LOG('calling explanation_cache.getReferenceDate', 0, '%s %s %s %s' % (explanation, self, trade_date, reference_date_method_id))
reference_date = explanation_cache.getReferenceDate(self, trade_date, reference_date_method_id) reference_date = explanation_cache.getReferenceDate(self, trade_date, reference_date_method_id)
# Computer start_date and stop_date (XXX-JPS this could be cached and accelerated) # Computer start_date and stop_date (XXX-JPS this could be cached and accelerated)
...@@ -245,9 +237,9 @@ class BusinessProcess(Path, XMLObject): ...@@ -245,9 +237,9 @@ class BusinessProcess(Path, XMLObject):
# FIXME: Ideally, we should use the Domain Tool to search business links, # FIXME: Ideally, we should use the Domain Tool to search business links,
# and avoid using the low level Predicate API. But the Domain Tool does # and avoid using the low level Predicate API. But the Domain Tool does
# support the condition above without scripting? # support the condition above without scripting?
LOG('business_link_list', 0, repr(business_link_list))
if context is None: if context is None:
LOG('context is None', 0, repr(business_link_list)) LOG('ERP5.Document.BusinessProcess', 0, 'Context is None %r' %
(business_link_list,))
return business_link_list return business_link_list
return [business_link for business_link in business_link_list return [business_link for business_link in business_link_list
if business_link.test(context)] if business_link.test(context)]
...@@ -262,7 +254,6 @@ class BusinessProcess(Path, XMLObject): ...@@ -262,7 +254,6 @@ class BusinessProcess(Path, XMLObject):
business_link -- a Business Link document business_link -- a Business Link document
""" """
LOG('In isBusinessLinkCompleted', 0, repr(business_link))
# Return False if Business Link is not completed # Return False if Business Link is not completed
if not business_link.isCompleted(explanation): if not business_link.isCompleted(explanation):
return False return False
...@@ -362,9 +353,7 @@ class BusinessProcess(Path, XMLObject): ...@@ -362,9 +353,7 @@ class BusinessProcess(Path, XMLObject):
business_link -- a Business Link document business_link -- a Business Link document
""" """
# If everything is delivered, no need to build # If everything is delivered, no need to build
LOG('In isBusinessLinkBuildable', 0, repr(business_link))
if business_link.isDelivered(explanation): if business_link.isDelivered(explanation):
LOG('In isBusinessLinkBuildable', 0, 'business link is delivered and thus False')
return False return False
# We must take the closure cause only way to combine business process # We must take the closure cause only way to combine business process
closure_process = _getBusinessLinkClosure(self, explanation, business_link) closure_process = _getBusinessLinkClosure(self, explanation, business_link)
...@@ -522,10 +511,8 @@ class BusinessProcess(Path, XMLObject): ...@@ -522,10 +511,8 @@ class BusinessProcess(Path, XMLObject):
trade_state -- a Trade State category trade_state -- a Trade State category
""" """
LOG('In isTradeStateCompleted', 0, repr(trade_state))
for business_link in self.getBusinessLinkValueList(successor=trade_state): for business_link in self.getBusinessLinkValueList(successor=trade_state):
if not self.isBusinessLinkCompleted(explanation, business_link): if not self.isBusinessLinkCompleted(explanation, business_link):
LOG('A business link is not completed', 0, repr(business_link))
return False return False
return True return True
...@@ -837,6 +824,5 @@ class BusinessProcess(Path, XMLObject): ...@@ -837,6 +824,5 @@ class BusinessProcess(Path, XMLObject):
""" """
Build whatever is buildable Build whatever is buildable
""" """
LOG('In business process build', 0, repr(explanation))
for business_link in self.getBuildableBusinessLinkValueList(explanation): for business_link in self.getBuildableBusinessLinkValueList(explanation):
business_link.build(explanation=explanation) business_link.build(explanation=explanation)
...@@ -116,8 +116,6 @@ class ExplanationCache: ...@@ -116,8 +116,6 @@ class ExplanationCache:
simulation_movement_id = simulation_movement.getId() simulation_movement_id = simulation_movement.getId()
insert_movement = True insert_movement = True
for path_id in container_path: for path_id in container_path:
LOG('path_dict', 0, repr(path_dict))
LOG('local_path_dict', 0, repr(local_path_dict))
local_path_dict = local_path_dict.setdefault(path_id, {}) local_path_dict = local_path_dict.setdefault(path_id, {})
if type(local_path_dict) is not types.DictType: if type(local_path_dict) is not types.DictType:
# A movement was already inserted # A movement was already inserted
...@@ -125,7 +123,6 @@ class ExplanationCache: ...@@ -125,7 +123,6 @@ class ExplanationCache:
break break
if insert_movement: if insert_movement:
local_path_dict[simulation_movement_id] = simulation_movement local_path_dict[simulation_movement_id] = simulation_movement
LOG('path_dict result', 0, repr(path_dict))
# For each delivery movement # For each delivery movement
for movement in self._getDeliveryMovementList(): for movement in self._getDeliveryMovementList():
...@@ -137,8 +134,6 @@ class ExplanationCache: ...@@ -137,8 +134,6 @@ class ExplanationCache:
# assembling path '/erp5/portal_simulation/1/34/23/43%' # assembling path '/erp5/portal_simulation/1/34/23/43%'
result = [] result = []
def browsePathDict(prefix, local_path_dict): def browsePathDict(prefix, local_path_dict):
LOG('browsePathDict result in', 0, repr(result))
LOG('browsePathDict local_path_dict in', 0, repr(local_path_dict))
for key, value in local_path_dict.items(): for key, value in local_path_dict.items():
if type(value) is not types.DictType: if type(value) is not types.DictType:
# We have a real root # We have a real root
...@@ -147,7 +142,6 @@ class ExplanationCache: ...@@ -147,7 +142,6 @@ class ExplanationCache:
# XXX-JPS here we must add all parent movements XXX-JPS # XXX-JPS here we must add all parent movements XXX-JPS
else: else:
browsePathDict('%s/%s' % (prefix, key), value) # Recursing with string append is slow XXX-JPS browsePathDict('%s/%s' % (prefix, key), value) # Recursing with string append is slow XXX-JPS
LOG('browsePathDict result out', 0, repr(result))
# path_dict is typically like this: # path_dict is typically like this:
# {'': {'erp5': {'portal_simulation': {'3': {'4': <SimulationMovement at /erp5/portal_simulation/3/4>}}}}} # {'': {'erp5': {'portal_simulation': {'3': {'4': <SimulationMovement at /erp5/portal_simulation/3/4>}}}}}
...@@ -210,7 +204,6 @@ class ExplanationCache: ...@@ -210,7 +204,6 @@ class ExplanationCache:
kw['path'] = self.getSimulationPathPatternList() # XXX-JPS Explicit Query is better kw['path'] = self.getSimulationPathPatternList() # XXX-JPS Explicit Query is better
if kw.get('explanation_uid', None) is None: if kw.get('explanation_uid', None) is None:
kw['explanation_uid'] = self.getRootExplanationUidList() kw['explanation_uid'] = self.getRootExplanationUidList()
LOG('lookup movements', 0, repr(kw))
self.simulation_movement_cache[kw_tuple] = \ self.simulation_movement_cache[kw_tuple] = \
self.portal_catalog(portal_type="Simulation Movement", self.portal_catalog(portal_type="Simulation Movement",
**kw) **kw)
...@@ -342,7 +335,6 @@ class ExplanationCache: ...@@ -342,7 +335,6 @@ class ExplanationCache:
# whenever trade model path define time constraints within the same # whenever trade model path define time constraints within the same
# movement generator (ie. transformation with multiple phases) # movement generator (ie. transformation with multiple phases)
path_list = business_process.getTradeModelPathValueList(trade_phase=trade_phase, context=business_process) path_list = business_process.getTradeModelPathValueList(trade_phase=trade_phase, context=business_process)
LOG('path_list', 0, '%s' % trade_phase)
if not len(path_list): if not len(path_list):
raise ValueError('No Trade Model Path defines a reference data.') raise ValueError('No Trade Model Path defines a reference data.')
......
...@@ -98,7 +98,6 @@ class MovementGeneratorMixin: ...@@ -98,7 +98,6 @@ class MovementGeneratorMixin:
# Build a list of movement and business path # Build a list of movement and business path
input_movement_list = self._getInputMovementList( input_movement_list = self._getInputMovementList(
movement_list=movement_list, rounding=rounding) movement_list=movement_list, rounding=rounding)
LOG('_getInputMovementList', 0, repr(input_movement_list))
for input_movement in input_movement_list: for input_movement in input_movement_list:
# Merge movement and business path properties (core implementation) # Merge movement and business path properties (core implementation)
# Lookup Business Process through composition (NOT UNION) # Lookup Business Process through composition (NOT UNION)
......
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