Commit ef63d39a authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

support updating solver decisions in buildSolverDecisionList().


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33573 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 25942607
...@@ -207,19 +207,29 @@ class SolverProcess(XMLObject, ActiveProcess): ...@@ -207,19 +207,29 @@ class SolverProcess(XMLObject, ActiveProcess):
# Now build the solver decision instances based on the previous # Now build the solver decision instances based on the previous
# grouping # grouping
# XXX-JPS: pseudocode for update (ie. rebuild) is not present solver_decision_list = self.objectValues(portal_type='Solver Decision')
index = 1 index = 1
for solver_decision_key, movement_dict in solver_decision_dict.items(): for solver_decision_key, movement_dict in solver_decision_dict.items():
if temp_object: causality, delivery_list = solver_decision_key
new_decision = self.newContent(portal_type='Solver Decision', matched_solver_decision_list = [
temp_object=True, x for x in solver_decision_list \
#id=index, if x.getDeliveryList() == list(delivery_list) and \
uid='new_%s' % index) x.getCausality() == causality]
index += 1 if len(matched_solver_decision_list) > 0:
solver_decision_list.remove(matched_solver_decision_list[0])
else: else:
new_decision = self.newContent(portal_type='Solver Decision') if temp_object:
new_decision._setDeliveryList(solver_decision_key[1]) new_decision = self.newContent(portal_type='Solver Decision',
new_decision._setCausality(solver_decision_key[0]) temp_object=True,
#id=index,
uid='new_%s' % index)
index += 1
else:
new_decision = self.newContent(portal_type='Solver Decision')
new_decision._setDeliveryList(solver_decision_key[1])
new_decision._setCausality(solver_decision_key[0])
# XXX what should we do for non-matched existing solver decisions?
# do we need to cancel them by using an appropriate workflow?
def _generateRandomId(self): def _generateRandomId(self):
# call ActiveProcess._generateRandomId() explicitly otherwise # call ActiveProcess._generateRandomId() explicitly otherwise
......
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