From e7ea4804ead0c60658703b3f595a52f1f77c250f Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Fri, 19 Mar 2010 06:09:35 +0000
Subject: [PATCH] invoke delivery_simulation_interaction_workflow and
 delivery_movement_simulation_interaction_workflow's interactions only for
 non-temporary documents.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33894 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../interactions/unlink_simulation.xml        | 36 ++++++++++++++++++-
 .../interactions/update_simulation.xml        | 36 ++++++++++++++++++-
 .../interactions/reindex_simulation.xml       | 36 ++++++++++++++++++-
 .../interactions/update_simulation.xml        | 36 ++++++++++++++++++-
 bt5/erp5_base/bt/revision                     |  2 +-
 5 files changed, 141 insertions(+), 5 deletions(-)

diff --git a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_movement_simulation_interaction_workflow/interactions/unlink_simulation.xml b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_movement_simulation_interaction_workflow/interactions/unlink_simulation.xml
index 557871fc01..3a4cbca099 100644
--- a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_movement_simulation_interaction_workflow/interactions/unlink_simulation.xml
+++ b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_movement_simulation_interaction_workflow/interactions/unlink_simulation.xml
@@ -42,7 +42,7 @@
         <item>
             <key> <string>guard</string> </key>
             <value>
-              <none/>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
             </value>
         </item>
         <item>
@@ -84,4 +84,38 @@
       </dictionary>
     </pickle>
   </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="Guard" module="Products.DCWorkflow.Guard"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>expr</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <global name="Expression" module="Products.CMFCore.Expression"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>python:not here.isTempDocument()</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
 </ZopeData>
diff --git a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_movement_simulation_interaction_workflow/interactions/update_simulation.xml b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_movement_simulation_interaction_workflow/interactions/update_simulation.xml
index 9a4b950c09..ce25953c03 100644
--- a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_movement_simulation_interaction_workflow/interactions/update_simulation.xml
+++ b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_movement_simulation_interaction_workflow/interactions/update_simulation.xml
@@ -42,7 +42,7 @@
         <item>
             <key> <string>guard</string> </key>
             <value>
-              <none/>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
             </value>
         </item>
         <item>
@@ -84,4 +84,38 @@
       </dictionary>
     </pickle>
   </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="Guard" module="Products.DCWorkflow.Guard"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>expr</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <global name="Expression" module="Products.CMFCore.Expression"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>python:not here.isTempDocument()</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
 </ZopeData>
diff --git a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_simulation_interaction_workflow/interactions/reindex_simulation.xml b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_simulation_interaction_workflow/interactions/reindex_simulation.xml
index fbca1456b7..3c038c43d2 100644
--- a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_simulation_interaction_workflow/interactions/reindex_simulation.xml
+++ b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_simulation_interaction_workflow/interactions/reindex_simulation.xml
@@ -48,7 +48,7 @@
         <item>
             <key> <string>guard</string> </key>
             <value>
-              <none/>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
             </value>
         </item>
         <item>
@@ -100,4 +100,38 @@
       </dictionary>
     </pickle>
   </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="Guard" module="Products.DCWorkflow.Guard"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>expr</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <global name="Expression" module="Products.CMFCore.Expression"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>python:not here.isTempDocument()</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
 </ZopeData>
diff --git a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_simulation_interaction_workflow/interactions/update_simulation.xml b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_simulation_interaction_workflow/interactions/update_simulation.xml
index 0e79afebda..6f7ba09f21 100644
--- a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_simulation_interaction_workflow/interactions/update_simulation.xml
+++ b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_simulation_interaction_workflow/interactions/update_simulation.xml
@@ -42,7 +42,7 @@
         <item>
             <key> <string>guard</string> </key>
             <value>
-              <none/>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
             </value>
         </item>
         <item>
@@ -84,4 +84,38 @@
       </dictionary>
     </pickle>
   </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="Guard" module="Products.DCWorkflow.Guard"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>expr</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <global name="Expression" module="Products.CMFCore.Expression"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>python:not here.isTempDocument()</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
 </ZopeData>
diff --git a/bt5/erp5_base/bt/revision b/bt5/erp5_base/bt/revision
index 5b3e043c52..9c3167f28e 100644
--- a/bt5/erp5_base/bt/revision
+++ b/bt5/erp5_base/bt/revision
@@ -1 +1 @@
-703
\ No newline at end of file
+704
\ No newline at end of file
-- 
2.30.9