Commit d9621295 authored by Łukasz Nowak's avatar Łukasz Nowak

Check that transition is possible before continuing.

parent fafbb5d2
...@@ -52,7 +52,8 @@ ...@@ -52,7 +52,8 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
if context.getSimulationState() == \'planned\' and context.getStartDate() < this_month:\n isTransitionPossible = context.getPortalObject().portal_workflow.isTransitionPossible\n
if context.getSimulationState() == \'planned\' and context.getStartDate() < this_month and isTransitionPossible(context, \'confirm\'):\n
context.confirm()\n context.confirm()\n
......
...@@ -50,9 +50,12 @@ ...@@ -50,9 +50,12 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>if context.getSimulationState() == \'confirmed\' and len(context.checkConsistency()) == 0:\n <value> <string>isTransitionPossible = context.getPortalObject().portal_workflow.isTransitionPossible\n
context.start()\n if context.getSimulationState() == \'confirmed\' and len(context.checkConsistency()) == 0:\n
context.stop()\n if isTransitionPossible(context, \'start\'):\n
context.start()\n
if isTransitionPossible(context, \'stop\'):\n
context.stop()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
556 557
\ No newline at end of file \ No newline at end of file
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