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

Check that transition is possible before continuing.

parent fafbb5d2
......@@ -52,7 +52,8 @@
<key> <string>_body</string> </key>
<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
......
......@@ -50,8 +50,11 @@
</item>
<item>
<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
if context.getSimulationState() == \'confirmed\' and len(context.checkConsistency()) == 0:\n
if isTransitionPossible(context, \'start\'):\n
context.start()\n
if isTransitionPossible(context, \'stop\'):\n
context.stop()\n
</string> </value>
</item>
......
556
\ No newline at end of file
557
\ 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