Commit b8fa7d8c authored by Arnaud Fontaine's avatar Arnaud Fontaine

WWIP: Configurator Workflow: workflow.initializeDocument().

TODO:
  - state.getAvailableTransitionList()
  - state.executeTransition()
  - state.getWorkflowHistory()
  - state.undoTransition()
=> erp5_configurator_standard:testStandardConfigurationWorkflow
parent 142231f8
...@@ -101,7 +101,17 @@ class BusinessConfiguration(Item): ...@@ -101,7 +101,17 @@ class BusinessConfiguration(Item):
if len(self.objectValues("ERP5 Configuration Save")) > 0: if len(self.objectValues("ERP5 Configuration Save")) > 0:
raise ValueError("Business Configuration Cannot be initialized, \ raise ValueError("Business Configuration Cannot be initialized, \
it contains one or more Configurator Save") it contains one or more Configurator Save")
workflow.initializeDocument(self)
# TODO-BEFORE-MERGE: initializeDocument() in workflow_module
# implementation: Without this getCurrentState() is None and nothing
# happens because getNextTransition() returns None in such case. But
# there is no field to modify 'state_base_category' which is sets to
# 'current_state' and BusinessConfiguration uses getCurrentState() so is
# 'state_base_category' really needed?
self.setCategoryMembership(workflow.getStateBaseCategory(),
workflow.getSource())
workflow.notifyCreated(self)
security.declareProtected(Permissions.View, 'getNextTransition') security.declareProtected(Permissions.View, 'getNextTransition')
def getNextTransition(self): def getNextTransition(self):
......
...@@ -168,9 +168,6 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -168,9 +168,6 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
# Swallow. # Swallow.
pass pass
security.declarePrivate('initializeDocument')
initializeDocument = notifyCreated
def _generateHistoryKey(self): def _generateHistoryKey(self):
""" """
Generate a key used in the workflow history. Generate a key used in the workflow history.
......
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