From 64ac17e11c5571a0f94b554533494fbe9343cc46 Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Fri, 26 Oct 2012 15:37:02 +0200
Subject: [PATCH] Migrate friend allocation interaction.

---
 .../workflow_chain_type.xml                        |  2 +-
 .../interactions/Computer_setSubjectList.xml}      | 14 +++++++-------
 .../scripts/Computer_updateDestinationSection.xml} | 10 +++++-----
 .../bt/template_portal_type_workflow_chain_list    |  1 +
 master/bt5/vifib_erp5/bt/revision                  |  2 +-
 5 files changed, 15 insertions(+), 14 deletions(-)
 rename master/bt5/{vifib_erp5/WorkflowTemplateItem/portal_workflow/local_permission_vifib_interaction_workflow/interactions/SaleTradeCondition_setSubjectList.xml => slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/interactions/Computer_setSubjectList.xml} (90%)
 rename master/bt5/{vifib_erp5/WorkflowTemplateItem/portal_workflow/local_permission_vifib_interaction_workflow/scripts/SaleTradeCondition_updateDestinationSection.xml => slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/scripts/Computer_updateDestinationSection.xml} (88%)

diff --git a/master/bt5/slapos_cloud/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml b/master/bt5/slapos_cloud/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
index ad74c9f62..a64bb8b6a 100644
--- a/master/bt5/slapos_cloud/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
+++ b/master/bt5/slapos_cloud/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
@@ -1,7 +1,7 @@
 <workflow_chain>
  <chain>
   <type>Computer</type>
-  <workflow>computer_slap_interface_workflow</workflow>
+  <workflow>computer_slap_interface_workflow, slapos_cloud_interaction_workflow</workflow>
  </chain>
  <chain>
   <type>Computer Partition</type>
diff --git a/master/bt5/vifib_erp5/WorkflowTemplateItem/portal_workflow/local_permission_vifib_interaction_workflow/interactions/SaleTradeCondition_setSubjectList.xml b/master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/interactions/Computer_setSubjectList.xml
similarity index 90%
rename from master/bt5/vifib_erp5/WorkflowTemplateItem/portal_workflow/local_permission_vifib_interaction_workflow/interactions/SaleTradeCondition_setSubjectList.xml
rename to master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/interactions/Computer_setSubjectList.xml
index 75149089d..f6bfc6bc1 100644
--- a/master/bt5/vifib_erp5/WorkflowTemplateItem/portal_workflow/local_permission_vifib_interaction_workflow/interactions/SaleTradeCondition_setSubjectList.xml
+++ b/master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/interactions/Computer_setSubjectList.xml
@@ -27,15 +27,15 @@
         <item>
             <key> <string>after_script_name</string> </key>
             <value>
-              <tuple/>
+              <list>
+                <string>Computer_updateDestinationSection</string>
+              </list>
             </value>
         </item>
         <item>
             <key> <string>before_commit_script_name</string> </key>
             <value>
-              <list>
-                <string>SaleTradeCondition_updateDestinationSection</string>
-              </list>
+              <tuple/>
             </value>
         </item>
         <item>
@@ -50,7 +50,7 @@
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>SaleTradeCondition_setSubjectList</string> </value>
+            <value> <string>Computer_setSubjectList</string> </value>
         </item>
         <item>
             <key> <string>method_id</string> </key>
@@ -62,13 +62,13 @@
         </item>
         <item>
             <key> <string>once_per_transaction</string> </key>
-            <value> <int>1</int> </value>
+            <value> <int>0</int> </value>
         </item>
         <item>
             <key> <string>portal_type_filter</string> </key>
             <value>
               <list>
-                <string>Sale Trade Condition</string>
+                <string>Computer</string>
               </list>
             </value>
         </item>
diff --git a/master/bt5/vifib_erp5/WorkflowTemplateItem/portal_workflow/local_permission_vifib_interaction_workflow/scripts/SaleTradeCondition_updateDestinationSection.xml b/master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/scripts/Computer_updateDestinationSection.xml
similarity index 88%
rename from master/bt5/vifib_erp5/WorkflowTemplateItem/portal_workflow/local_permission_vifib_interaction_workflow/scripts/SaleTradeCondition_updateDestinationSection.xml
rename to master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/scripts/Computer_updateDestinationSection.xml
index 4585b1f8a..41825e39e 100644
--- a/master/bt5/vifib_erp5/WorkflowTemplateItem/portal_workflow/local_permission_vifib_interaction_workflow/scripts/SaleTradeCondition_updateDestinationSection.xml
+++ b/master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/scripts/Computer_updateDestinationSection.xml
@@ -50,17 +50,17 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>sale_trade_condition = state_change[\'object\']\n
-portal = sale_trade_condition.getPortalObject()\n
+            <value> <string>computer = state_change[\'object\']\n
+portal = computer.getPortalObject()\n
 \n
-subject_list = sale_trade_condition.getSubjectList()\n
+subject_list = computer.getSubjectList()\n
 person_list = []\n
 \n
 for subject in subject_list:\n
   if subject:\n
     person_list.extend([x.getObject() for x in portal.portal_catalog(validation_state="validated", portal_type="Person", default_email_text=subject)])\n
 \n
-sale_trade_condition.edit(destination_section_value_list=person_list)\n
+computer.edit(destination_section_value_list=person_list)\n
 </string> </value>
         </item>
         <item>
@@ -77,7 +77,7 @@ sale_trade_condition.edit(destination_section_value_list=person_list)\n
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>SaleTradeCondition_updateDestinationSection</string> </value>
+            <value> <string>Computer_updateDestinationSection</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/master/bt5/slapos_cloud/bt/template_portal_type_workflow_chain_list b/master/bt5/slapos_cloud/bt/template_portal_type_workflow_chain_list
index 2816745b1..3bb044234 100644
--- a/master/bt5/slapos_cloud/bt/template_portal_type_workflow_chain_list
+++ b/master/bt5/slapos_cloud/bt/template_portal_type_workflow_chain_list
@@ -1,5 +1,6 @@
 Computer Partition | computer_partition_slap_interface_workflow
 Computer | computer_slap_interface_workflow
+Computer | slapos_cloud_interaction_workflow
 Hosting Subscription | edit_workflow
 Hosting Subscription | hosting_subscription_workflow
 Hosting Subscription | instance_slap_interface_workflow
diff --git a/master/bt5/vifib_erp5/bt/revision b/master/bt5/vifib_erp5/bt/revision
index 77555c31d..f520b6ed4 100644
--- a/master/bt5/vifib_erp5/bt/revision
+++ b/master/bt5/vifib_erp5/bt/revision
@@ -1 +1 @@
-529
\ No newline at end of file
+530
\ No newline at end of file
-- 
2.30.9