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

Improved documentation

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@35764 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 909a4941
...@@ -44,10 +44,8 @@ class BusinessPath(Path, Predicate): ...@@ -44,10 +44,8 @@ class BusinessPath(Path, Predicate):
""" """
The BusinessPath class embeds all information related to The BusinessPath class embeds all information related to
lead times and parties involved at a given phase of a business lead times and parties involved at a given phase of a business
process. process. BusinessPath are also the most common way to trigger
the build deliveries from buildable movements.
BusinessPath are also used as helper to build deliveries from
buildable movements.
The idea is to invoke isBuildable() on the collected simulation The idea is to invoke isBuildable() on the collected simulation
movements (which are orphan) during build "after select" process movements (which are orphan) during build "after select" process
...@@ -60,12 +58,12 @@ class BusinessPath(Path, Predicate): ...@@ -60,12 +58,12 @@ class BusinessPath(Path, Predicate):
Pros: global select is possible by not providing a causality_uid Pros: global select is possible by not providing a causality_uid
Cons: global select retrieves long lists of orphan movements which Cons: global select retrieves long lists of orphan movements which
are not yet buildable are not yet buildable the build process could be rather
the build process could be rather slow or require activities slow or require activities
TODO: TODO:
- merge build implementation from erp5_bpm business template to ERP5 - IArrowBase implementation has too many comments which need to be
product code with backward compatibility fixed
""" """
meta_type = 'ERP5 Business Path' meta_type = 'ERP5 Business Path'
portal_type = 'Business Path' portal_type = 'Business Path'
...@@ -99,6 +97,11 @@ class BusinessPath(Path, Predicate): ...@@ -99,6 +97,11 @@ class BusinessPath(Path, Predicate):
interfaces.IPredicate, interfaces.IPredicate,
) )
# Helper Methods
def _getExplanationRelatedSimulationMovementValueList(self, explanation):
explanation_cache = _getExplanationCache(explanation)
return explanation_cache.getBusinessPathRelatedSimulationMovementValueList(self)
# IArrowBase implementation # IArrowBase implementation
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getSourceArrowBaseCategoryList') 'getSourceArrowBaseCategoryList')
...@@ -146,11 +149,6 @@ class BusinessPath(Path, Predicate): ...@@ -146,11 +149,6 @@ class BusinessPath(Path, Predicate):
#'destination_transport' #'destination_transport'
) )
# Helper Methods
def _getExplanationRelatedSimulationMovementValueList(self, explanation):
explanation_cache = _getExplanationCache(explanation)
return explanation_cache.getBusinessPathRelatedSimulationMovementValueList(self)
# XXX-JPS UNkonwn ? # XXX-JPS UNkonwn ?
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getArrowCategoryDict') 'getArrowCategoryDict')
...@@ -250,14 +248,18 @@ class BusinessPath(Path, Predicate): ...@@ -250,14 +248,18 @@ class BusinessPath(Path, Predicate):
return method() return method()
def getCompletionDate(self, explanation): def getCompletionDate(self, explanation):
"""Returns the date of completion of the movemnet """Returns the date of completion of business path in the
based on paremeters of the business path. This complete date can be context of the explanation. The completion date of the Business
the start date, the stop date, the date of a given workflow transition Path is the max date of all simulation movements which are
on the explaining delivery, etc. related to the Business Path and which are part of the explanation.
XXX - DOC explanation -- the Order, Order Line, Delivery or Delivery Line which
implicitely defines a simulation subtree and a union
business process.
movement -- a Simulation Movement NOTE:
It seems that current implementation makes sense mostly in the
context of a root explanation.
""" """
date_list = [] date_list = []
for movement in self._getExplanationRelatedSimulationMovementValueList(explanation): for movement in self._getExplanationRelatedSimulationMovementValueList(explanation):
...@@ -357,7 +359,13 @@ class BusinessPath(Path, Predicate): ...@@ -357,7 +359,13 @@ class BusinessPath(Path, Predicate):
return True return True
def isDelivered(self, explanation): def isDelivered(self, explanation):
"""XXX """Returns True is all simulation movements related to this
Business Path in the context of given explanation are built
and related to a delivery through the 'delivery' category.
explanation -- the Order, Order Line, Delivery or Delivery Line which
implicitely defines a simulation subtree and a union
business process.
""" """
for simulation_movement in self._getExplanationRelatedSimulationMovementValueList( for simulation_movement in self._getExplanationRelatedSimulationMovementValueList(
explanation): explanation):
......
...@@ -60,12 +60,14 @@ class IBusinessPath(Interface): ...@@ -60,12 +60,14 @@ class IBusinessPath(Interface):
""" """
def getCompletionDate(explanation): def getCompletionDate(explanation):
"""Returns the date of completion of the movemnet """Returns the date of completion of business path in the
based on paremeters of the business path. This completion date can be context of the explanation. The completion date of the Business
the start date, the stop date, the date of a given workflow transition Path is the max date of all simulation movements which are
on the explaining delivery, etc. related to the Business Path and which are part of the explanation.
XXXXXXXXXXXXXXXx explanation -- the Order, Order Line, Delivery or Delivery Line which
implicitely defines a simulation subtree and a union
business process.
""" """
def getExpectedQuantity(amount): def getExpectedQuantity(amount):
...@@ -126,7 +128,13 @@ class IBusinessPath(Interface): ...@@ -126,7 +128,13 @@ class IBusinessPath(Interface):
""" """
def isDelivered(explanation): def isDelivered(explanation):
"""XXX """Returns True is all simulation movements related to this
Business Path in the context of given explanation are built
and related to a delivery through the 'delivery' category.
explanation -- the Order, Order Line, Delivery or Delivery Line which
implicitely defines a simulation subtree and a union
business process.
""" """
def build(explanation): def build(explanation):
......
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