Commit 151fd60c authored by Jérome Perrin's avatar Jérome Perrin

add a method to find corresponding business process model


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26576 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7e81c1ba
......@@ -206,6 +206,29 @@ class AppliedRule(XMLObject):
return self
return self.getParentValue().getRootAppliedRule()
security.declareProtected(Permissions.AccessContentsInformation,
'getBusinessProcessModelValue')
def getBusinessProcessModelValue(self):
"""Return the business process model that has been used in this
simulation, or None if no business process has been used.
"""
root = self.getRootAppliedRule()
causality = root.getCausalityValue()
def findBusinessProcessModel(context):
if context.getPortalType() == 'Business Process':
return context
for specialise in context.getSpecialiseValueList():
business_process = findBusinessProcessModel(specialise)
if business_process is not None:
return business_process
if causality is not None and getattr(causality, 'getSpecialiseValueList',
None) is not None:
return findBusinessProcessModel(causality)
return None
security.declareProtected(Permissions.ModifyPortalContent,
'notifySimulationChange')
def notifySimulationChange(self, notify_dict):
......
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