[Erp5-report] r30630 - /erp5/trunk/products/ERP5/interfaces/rule.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Sun Nov 15 17:59:48 CET 2009
Author: jp
Date: Sun Nov 15 17:59:48 2009
New Revision: 30630
URL: http://svn.erp5.org?rev=30630&view=rev
Log:
Reviewed interface specification and comments.
Modified:
erp5/trunk/products/ERP5/interfaces/rule.py
Modified: erp5/trunk/products/ERP5/interfaces/rule.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/interfaces/rule.py?rev=30630&r1=30629&r2=30630&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/interfaces/rule.py [utf8] (original)
+++ erp5/trunk/products/ERP5/interfaces/rule.py [utf8] Sun Nov 15 17:59:48 2009
@@ -29,22 +29,43 @@
"""
Products.ERP5.interfaces.rule
"""
+from Products.ERP5.interfaces.movement_collection_updater import IMovementCollectionUpdater
-from zope.interface import Interface
-
-class IRule(Interface):
- """A Rule describes transformations of documents.
+class IRule(IMovementCollectionUpdater):
+ """Rule interface specification
+
+ Documents which implement IRule can be used to
+ expand applied rules in ERP5 simulation.
"""
-
- def constructNewAppliedRule(context):
- """Create a new applied rule in the context.
+ def constructNewAppliedRule(self, context, id=None,
+ activate_kw=None, **kw):
+ """
+ Create a new applied rule in the context.
An applied rule is an instanciation of a Rule. The applied rule is
linked to the Rule through the `specialise` relation.
+
+ context -- usually, a parent simulation movement of the
+ newly created applied rule
+
+ activate_kw -- activity parameters, required to control
+ activity constraints
+
+ kw -- XXX-JPS probably wrong interface specification
"""
- def expand(applied_rule):
- """Expand this applied rule to create new documents inside the
+ def expand(applied_rule, **kw):
+ """
+ Expand this applied rule to create new documents inside the
applied rule.
+
+ At expand time, we must replace or compensate certain
+ properties. However, if some properties were overwriten
+ by a decision (ie. a resource if changed), then we
+ should not try to compensate such a decision. The principles
+ of compensation are implemented through
+ IMovementCollectionUpdater API
+
+ kw -- XXX-JPS probably wrong interface specification
+ activate_kw should probably be defined explicitely here
"""
-
More information about the Erp5-report
mailing list